Re: lein test-refresh - I am so loving it!

2016-05-22 Thread Jake McCrary
Author of lein-test-refresh here! I’m glad you’re loving it. Thanks for sharing that. It feels great to know others are finding it useful. A couple tips that are somewhat buried in the projects readme

Re: reader conditional not handling defmacro?

2016-05-22 Thread Herwig Hochleitner
This thread just came up, while I was in the process of composing a mail on this topic to clojure-dev: https://groups.google.com/d/msg/clojure-dev/f6ULUVokXrU/3uue5okSAgAJ 2016-05-20 23:22 GMT+02:00 Dan Burton : > What about something like > > (def obj #?(:clj Object :cljs js/Object)) > Unfortun

lein test-refresh - I am so loving it!

2016-05-22 Thread Alan Thompson
I just discovered this today by accident, and I am loving it! When I run tests for the Tupelo library , it requires 8.5 sec to do "lein test". This seems to be mostly compiling Clojure itself, since JVM startup takes only 0.038 sec. Using "lein test-refresh" i

Re: When/how are top-level side effects in a namespace executed?

2016-05-22 Thread Thiago Massa
1. It depends, if you reload the namespace for some reason, the value will be reset to what is specified in the file, otherwise it's just once. By using defonce you avoid it being reset. 2. Attemping what, reloading your code? I believe this is some scenario people don't care too much about. Also

Re: When/how are top-level side effects in a namespace executed?

2016-05-22 Thread Colin Yates
Others will have more idea, but my observation is that it is evaluated once, so a namespace which is required by multiple namespaces will only be evaluated once. Should you explicitly re-evaluate it then it will of course be evaluated again. You might be interested in reading Stuart Sierra's 'relo

When/how are top-level side effects in a namespace executed?

2016-05-22 Thread lvh
Hi, Suppose I have a namespace that has some ns-level side effect, e.g. `(def atom {})`. 1. When is that executed? How often? (I think, from observation, that the answer is “when it is first required”, and “exactly once”; but it’s important for the correctness of my program that this is the c

Re: Following type annotations across call sites to eliminate reflection?

2016-05-22 Thread lvh
Hi Reid, > On May 21, 2016, at 11:44 PM, Reid McKenzie wrote: > > You should be able to do this: > > (defn f [a ^bytes b ^bytes c] >(if (instance? ByteBuffer a) > (.f binding ^ByteBuffer a b c) > (.f binding ^bytes a b c))) > > > You have a bimorphic function and yes there isn'