Re: Auto reloading of dependencies with cider

2014-06-22 Thread Ralf Schmitt
Mark P  writes:

> What do other people generally do here?  I suspect there is a commandline 
> way of getting lein to do this for me.  Is that what people do?  Or do 
> people just make sure they do "C-c C-k" in each relevant buffer?  (But 
> isn't this error prone - ie if you forget to do this in some buffer that 
> you've changed?)

Take a look at tools.namespace [1], which handles reloading your
namespaces. Also please read
http://dev.solita.fi/2014/03/18/pimp-my-repl.html.

[1] https://github.com/clojure/tools.namespace

-- 
Cheers
Ralf

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Understanding when compilation occurs - for function producing functions

2014-06-22 Thread Alex Miller


On Sunday, June 22, 2014 11:35:25 AM UTC-5, Herwig Hochleitner wrote:
>
> 2014-06-22 9:12 GMT+02:00 Reid McKenzie >
> :
>
>>
>> since there's no other way that we can take a
>> function "as a value" prior to JVM 1.8 which has bytecode lambdas and
>> which the reference Clojure implementation doesn't leverage yet if ever.
>>
>
> Java 8 gained no such feature. Lambda expressions are syntax sugar for 
> almost the thing, clojure's fn does: Instantiating an anonymous inner class 
> for an interface with a single arity.
> The only concept that jvm has of a first class function, are the 
> interfaces in java.util.function, as of Java 8
>

I think (but would be happy to be corrected) that Java 8 lambdas *are* 
actually a little different than an anonymous class instantiation. 
Specifically, I believe the lambda is created via an invokeDynamic and 
cached at the call site, whereas the anonymous class instance would be 
constructed every time.

Alex

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: {ANN} clj.qrgen and securen-rand : generate QRCode and secure random in clojure

2014-06-22 Thread James Reeves
I maintain crypto-random ,
another secure-random wrapper. I suspect the advice you're using to
generate your SecureRandom instance is outdated, because in general the
default SecureRandom constructor is preferable.

This page  has more recent
information. Under *nix systems, SecureRandom mixes in /dev/urandom, which
is a much better source of entropy than SHA1PRNG. Under Windows, it falls
back to SHA1PRNG, but you can't have everything.

- James


On 23 June 2014 05:47, dennis zhuang  wrote:

> *clj.qrgen*:  https://github.com/killme2008/clj.qrgen
>
> Generate QRCode  in clojure:
>
>
> (as-file (from "hello world"))
>
> *secure-rand*:  https://github.com/killme2008/secure-rand
>
> Secure version for clojure.core/rand etc.
>
>
> (ns test
>   (:refer-clojure :exclude [rand rand-int rand-nth])
>   (:use [secure-rand.core :only [rand rand-int rand-nth]]))
> (rand)(rand 10)(rand-int 100)(rand-nth (range 10))
>
>
> Hope they could be helpful for someone.
> --
> 庄晓丹
> Email:killme2...@gmail.com xzhu...@avos.com
> Site:   http://fnil.net
> Twitter:  @killme2008
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


{ANN} clj.qrgen and securen-rand : generate QRCode and secure random in clojure

2014-06-22 Thread dennis zhuang
*clj.qrgen*:  https://github.com/killme2008/clj.qrgen

Generate QRCode  in clojure:

(as-file (from "hello world"))

*secure-rand*:  https://github.com/killme2008/secure-rand

Secure version for clojure.core/rand etc.

(ns test
  (:refer-clojure :exclude [rand rand-int rand-nth])
  (:use [secure-rand.core :only [rand rand-int rand-nth]]))
(rand)(rand 10)(rand-int 100)(rand-nth (range 10))


Hope they could be helpful for someone.
-- 
庄晓丹
Email:killme2...@gmail.com xzhu...@avos.com
Site:   http://fnil.net
Twitter:  @killme2008

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Understanding when compilation occurs - for function producing functions

2014-06-22 Thread Ryan Schmitt


> Okay. Functions as values. Go look at the IFn interface, 
>>
>> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java.
>>  
>>
>>
>
> Thanks for the link - this helps!  When the clojure compiler generates a 
> class type that conforms to this interface, does it generate a .java file 
> which is then compiled using the java compiler?  I am guessing not.  I am 
> guessing that clojure knows how to generate a byte code version of a class 
> type directly.
>

The Clojure compiler generates .class files and Java bytecode directly, 
using the ASM  library. Note that Clojure 
code is always compiled to Java bytecode, even in the REPL; Clojure is 
never directly interpreted. There are some good resources on how Clojure 
compilation works:

http://clojure.org/compilation
http://www.deepbluelambda.org/programming/clojure/how-clojure-works-a-simple-namespace
 
(namespaces also get compiled to Java classes, which is a bit less 
intuitive)
http://stackoverflow.com/questions/3123662/compiling-clojure (if you want 
to play around with invoking the Clojure compiler directly)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Understanding when compilation occurs - for function producing functions

2014-06-22 Thread Mark P

>
> Okay. Functions as values. Go look at the IFn interface, 
>
> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java. 
>
>

Thanks for the link - this helps!  When the clojure compiler generates a 
class type that conforms to this interface, does it generate a .java file 
which is then compiled using the java compiler?  I am guessing not.  I am 
guessing that clojure knows how to generate a byte code version of a class 
type directly.
 

> In C or C++ you can take a raw machine pointer to a function. The JVM 
> does not allow for this behavior the result of which is that whenever 
> you have a "function" really what you have is a function-like object 
> with the standard application/invocation member methods.


Thanks for explaining.  This sounds very much like a C++ functor.

For the record, the raw-pointer-to-function is the old-school thing to do 
in C++.  These days functors are often used - object types that have the 
function application operator defined (which is a method with special 
function application syntax) - because these are more powerful (eg 
templated methods allowing compile-time polymorphism) and allow for better 
performance (eg inlining of code).  So it sounds like what clojure does 
under-the-hood is to more-or-less define a functor type at compile time and 
then do various instantiations at run time.
 

> The "standard" Clojure compiler is pretty braindead when it comes to the 
> emitted bytecode, but this is due to the philosophy (backed up by 
> experience) that the JIT is typically good enough.


Good to know - thanks!  This makes things clearer for me.
 

> You could generate 
> better code, and my GSoC project is research into doing so but the 
> reality of Clojure programs is that function calls even with Var 
> indirection are free in comparison to the performance hits we take due 
> to using immutable datastructures and eschewing in place updates. 
>
> Reid  
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Auto reloading of dependencies with cider

2014-06-22 Thread Mark P
I am fairly new to using cider.  Initially I put all my code into my 
core.clj file that lein created for me.  But now I am splitting my file up 
into multiple clj files and using things like:

(ns myprog.core
  (:use [myprog.milk :as milkx :only []])
  (:use [myprog.cheese.brie :as briex :only [brielist]])
  (:use [myprog.cheese.cheddar :as chedderx :only [chedderlist]])
  (:gen-class))


to pull in definitions from other clj files into my core.clj.

This seems to be working well enough, except that, doing "C-c C-k" (ie 
cider-load-current-buffer) no longer always loads everything.

It seems to auto load all the other clj files the first time.  But when I 
make changes in these other files (which I save), these are not seen after 
doing a "C-c C-k" in core.clj.  It seems that I need to explicitly go to 
each buffer with a modification in it and do "C-c C-k" in each one.  Then I 
can do "C-c C-k" in the main buffer and all the changes will be seen.

I can cope with this, but it would be nice to be able to give a command in 
the core.clj buffer which effectively does "load core.clj and recursively 
reload any dependency buffers/files".  (Even better would be if it only 
reloaded those files/buffers which had changed since the last load.)

What do other people generally do here?  I suspect there is a commandline 
way of getting lein to do this for me.  Is that what people do?  Or do 
people just make sure they do "C-c C-k" in each relevant buffer?  (But 
isn't this error prone - ie if you forget to do this in some buffer that 
you've changed?)

Thanks,

Mark.



-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: doseq with index

2014-06-22 Thread Mikera
I found this to be fairly common pattern so I wrote a "doseq-indexed" 
macro, which is part of my clojure-utils library.

Source: 
https://github.com/mikera/clojure-utils/blob/master/src/main/clojure/mikera/cljutils/loops.clj

usage:

(doseq-indexed [x (some-sequence) i]
  ;; do things with x and i bound to the element and the index respectively 
 
)

On Sunday, 22 June 2014 20:50:15 UTC+1, Răzvan Rotaru wrote:
>
> Hi,
>
> Is there an elegant way to use a doseq or for and also get an index to 
> use? I find myself using map-indexed in these cases, and I prefer more the 
> for constructs.
>
>
> (doall (map-indexed
> (fn [i x]
>   ;do stuff with side effects using i and x
>  )
> a-lazy-seq))
>
>
> Cheers,
> Razvan
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help with basic macros

2014-06-22 Thread James Reeves
Consider how you'd write a function to perform a similar task. A function
can't delay evaluation, but it should work for something like:

(if-else (> 5 2) :else 'no-way :then 'sure)  =>  'sure

If you manage to write a function that can do the above, you're 90% of the
way to writing a macro.

- James


On 22 June 2014 21:28, Ryan Yogan  wrote:

> Hi, I am trying to understand macros and I am having trouble with the
> basics, I am working through some koans and I am stuck, an explanation not
> just a solution would be amazing.
>
> I would like to create a macro that can provide the following
>
> (if-else (> 5 2))
> => nil
>
> (if-else (> 5 2) :then 'sure)
> => sure
>
> (if-else (> 5 2) :else 'no-way :then 'sure)
> => sure
>
> (if-else (> 5 2) :else 'no-way :then
>   (println 'this-is-random) 'sure)
> => this is random
> sure
>
> I know this is not efficient and do would make more sense, but I am trying
> to understand a use case for this and how to accomplish this.
>
> Thank you!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help with basic macros

2014-06-22 Thread Ryan Yogan
Hi, I am trying to understand macros and I am having trouble with the 
basics, I am working through some koans and I am stuck, an explanation not 
just a solution would be amazing.

I would like to create a macro that can provide the following

(if-else (> 5 2))
=> nil

(if-else (> 5 2) :then 'sure)
=> sure

(if-else (> 5 2) :else 'no-way :then 'sure)
=> sure

(if-else (> 5 2) :else 'no-way :then
  (println 'this-is-random) 'sure)
=> this is random
sure

I know this is not efficient and do would make more sense, but I am trying 
to understand a use case for this and how to accomplish this.

Thank you!

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: doseq with index

2014-06-22 Thread Sam Ritchie

(doseq [[idx item] (map-indexed vector a-lazy-seq)]
   (do-stuff! item idx))


Răzvan Rotaru 
June 22, 2014 at 1:50 PM
Hi,

Is there an elegant way to use a doseq or for and also get an index to 
use? I find myself using map-indexed in these cases, and I prefer more 
the for constructs.



(doall (map-indexed
(fn [i x]
  ;do stuff with side effects using i and x
 )
a-lazy-seq))


Cheers,
Razvan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient 
with your first post.

To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google 
Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to clojure+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Sam Ritchie (@sritchie)
Paddleguru Co-Founder
703.863.8561
www.paddleguru.com 
Twitter // Facebook 



--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


doseq with index

2014-06-22 Thread Răzvan Rotaru
Hi,

Is there an elegant way to use a doseq or for and also get an index to use? 
I find myself using map-indexed in these cases, and I prefer more the for 
constructs.


(doall (map-indexed
(fn [i x]
  ;do stuff with side effects using i and x
 )
a-lazy-seq))


Cheers,
Razvan

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Understanding when compilation occurs - for function producing functions

2014-06-22 Thread Herwig Hochleitner
2014-06-22 9:12 GMT+02:00 Reid McKenzie :

>
> since there's no other way that we can take a
> function "as a value" prior to JVM 1.8 which has bytecode lambdas and
> which the reference Clojure implementation doesn't leverage yet if ever.
>

Java 8 gained no such feature. Lambda expressions are syntax sugar for
almost the thing, clojure's fn does: Instantiating an anonymous inner class
for an interface with a single arity.
The only concept that jvm has of a first class function, are the interfaces
in java.util.function, as of Java 8
Sorry for the nitpick!

Concerning more extensive compiler optimizations: The simplistic approach
of the compiler has the benefit of generating pretty predictable byte code,
which is good for a lot of cases, as long as the JIT can optimize it and as
long as you don't need fast startup.
The JIT can do pretty amazing stuff like inlining heap allocations onto the
stack, if they don't escape. So in theory that could eliminate lazy-seqs,
partial functions and other wrappers.

I'd also like to see more extensive optimization by the clojure compiler,
but I wouldn't pass the burden of implementing them onto anyone, before
clojure.tools.{analyzer,emitter} are used as the canonical compiler.

cheers

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Workflow: cljx, cljsbuild & tdd in one process

2014-06-22 Thread Bob Hutchison
Thanks for the tip, works nicely. I was doing the same thing Michal was doing.

Cheers,
Bob

On Jun 20, 2014, at 11:07 AM, Michael Griffiths  
wrote:

> There's also a Leiningen plugin called lein-pdo that lets you run tasks in 
> parallel: https://github.com/Raynes/lein-pdo
>  
> Example usage for cljx auto & cljsbuild auto: 
> https://github.com/DomKM/omelette/blob/master/project.clj#L59
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IntelliJ Cursive ClojureScript IDE slowdown

2014-06-22 Thread Colin Fleming
Hmm, that bug looks like a likely candidate. It's actually marked as fixed,
but only in the v14 branch - I'll see if I can militate for it to be
patched back to 13.1.

Thanks for the feedback on saving, Mike. IntelliJ saves on its own at a
couple of points - mostly on frame deactivation, i.e. when the main window
loses focus. This works well since if you switch to a web browser or
terminal, your work is saved by the time you get there. Cursive
additionally saves when switching from a normal editor to the REPL.
Everything is also saved at various other critical points, e.g. before
executing, running tests and similar tasks.

I'm interested because I'm currently working on the CLJS support in
Cursive, and I've wondered for a while how cljsbuild auto and things like
Midje autotest interact with the auto-save during real use - I've only
played around with them.




On 22 June 2014 14:35, Mike Fikes  wrote:

> Me too. I suspect it is an IntelliJ-specific problem, unrelated to
> Cursive. Perhaps Colin has the ability and insight to see where the problem
> lies.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IntelliJ Cursive ClojureScript IDE slowdown

2014-06-22 Thread Mike Fikes
Me too. I suspect it is an IntelliJ-specific problem, unrelated to Cursive. 
Perhaps Colin has the ability and insight to see where the problem lies.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IntelliJ Cursive ClojureScript IDE slowdown

2014-06-22 Thread Ewen Grosjean
Hi,

This is probably related to this bug 

.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IntelliJ Cursive ClojureScript IDE slowdown

2014-06-22 Thread Mike Fikes
Hi Colin,

I'm still in the habit of manually saving, but I've noticed that IntelliJ saves 
quite often on its own.

I usually work with :whitespace optimizations so that compilation completes 
within 3/10 s of saving. (I'm using this to build an iOS app using 
JavaScriptCore, so this is much quicker than I can switch over to Xcode to test 
a change.)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Understanding when compilation occurs - for function producing functions

2014-06-22 Thread Reid McKenzie

> Coming from a C++ background I'm not that familiar with functions as
> first class values.  We sort of do have them in C++ - as functors - ie
> a class that has the function invocation operator defined.  This class
> can have storage as well, which means you can have a functor object
> type which then can have particular instances instantiated with
> different particular parameters stored with the object instance.
>
> I'm wondering whether this is effectively what Clojure does
> under-the-hood, or whether it does something different / more
> sophisticated.

Okay. Functions as values. Go look at the IFn interface,
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java.
In C or C++ you can take a raw machine pointer to a function. The JVM
does not allow for this behavior the result of which is that whenever
you have a "function" really what you have is a function-like object
with the standard application/invocation member methods. Nothing really
sophisticated here, a single class is naively generated for each fn in
your program and a fn that returns a fn simply creates a new instance of
that fn and returns it since there's no other way that we can take a
function "as a value" prior to JVM 1.8 which has bytecode lambdas and
which the reference Clojure implementation doesn't leverage yet if ever.

The "standard" Clojure compiler is pretty braindead when it comes to the
emitted bytecode, but this is due to the philosophy (backed up by
experience) that the JIT is typically good enough. You could generate
better code, and my GSoC project is research into doing so but the
reality of Clojure programs is that function calls even with Var
indirection are free in comparison to the performance hits we take due
to using immutable datastructures and eschewing in place updates.

Reid

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.