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

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 does

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

{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-ra

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

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

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 [br

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

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. - Jam

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

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

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)) Chee

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 sy

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

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

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@googlegr

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 tha

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 quick

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 whic