Re: Understanding when compilation occurs - for function producing functions

2014-06-21 Thread Di Xu
> > Suppose at my REPL I do... > > (defn direct-report-oneplustwo [] (println (str "Direct one plus two is " > ((fn [n] (+ 1 n)) 2) "."))) > > ...then I presume that the compiler has compiled my > direct-report-oneplustwo function, and that this has included compilation > of my anonymous function (

Re: Understanding when compilation occurs - for function producing functions

2014-06-21 Thread Linus Ericsson
On Saturday, June 21, 2014, Di Xu wrote: > Suppose at my REPL I do... >> >> (defn direct-report-oneplustwo [] (println (str "Direct one plus two is " >> ((fn [n] (+ 1 n)) 2) "."))) >> >> ...then I presume that the compiler has compiled my >> direct-report-oneplustwo function, and that this has in

Re: Is it the right Clojure group for a newbie

2014-06-21 Thread J Irving
+1 Throw them a bone. This is a great book. It's like Richard Bach for computer science. Sorta. This is the book I took with me to help me nurse my mother thru her final days. And I mean that as an uplifting story heh. Definitely worth your cash. Cheers, J On Friday, June 20, 2014, Jeff Heon

Re: Understanding when compilation occurs - for function producing functions

2014-06-21 Thread David Andrews
A toy project I've worked intermittently on makes heavy use of *partial* to dynamically build complex functions. I wish that *partial* was smart enough to recompile its first argument, maybe taking advantage of whatever type inference the compiler can make, but partial

Re: Is it the right Clojure group for a newbie

2014-06-21 Thread Daniel Higginbotham
Hi Abha, Clojure for the Brave and True is directed at people who are new to Clojure but who already have some programming experience. I definitely hope you find it useful, but it might be better to start with The Little Schemer (I need to update the site to include this disclaimer). As others

Re: Supplied-p parameter in clojure similar to lisp lambda lists

2014-06-21 Thread Jason Felice
If you destructure the parameters like this: (defn f [& {:as a-map}] ...) You can use map primitives on a-map. But you can also supply defaults here. On Jun 20, 2014 2:14 PM, "Dave Tenny" wrote: > What is the commonly accepted technique for declaring/using 'supplied-p' > type lambda list funct

IntelliJ Cursive ClojureScript IDE slowdown

2014-06-21 Thread Mike Fikes
Just sharing a tooling hint: If you are using IntelliJ / Cursive to edit ClojureScript (on a Mac at least), opening a Terminal “pane” at the bottom of the IDE in order to run `lein cljsbuild auto` is nice because you can readily see any errors or warnings the ClojureScript compiler might emit.

Re: IntelliJ Cursive ClojureScript IDE slowdown

2014-06-21 Thread Colin Fleming
Hmm, thanks for the report - I'll take a look at this and see if I can figure out what's happening. One related question - how have you found the interaction between IntelliJ's automatic saving and 'cljsbuild auto'? Are you manually saving to trigger the compilation, or relying on the save on fram

Re: IntelliJ Cursive ClojureScript IDE slowdown

2014-06-21 Thread Mark Mandel
Yah, I noticed this as well. I figured it was something in the terminal plugin. Sent from my mobile doohickey On 22/06/2014 3:13 PM, "Colin Fleming" wrote: > Hmm, thanks for the report - I'll take a look at this and see if I can > figure out what's happening. > > One related question - how have

Re: Understanding when compilation occurs - for function producing functions

2014-06-21 Thread Mark P
> > >> ​Well, you misunderstand it, as far as I know, clojure treat all fn as > object, so in your adder-maker example, clojure compiled two fn as object, > that's adder-maker itself and anonymous function it returns. > You must be right. As far as I know, the compiler is only called as part

Re: Understanding when compilation occurs - for function producing functions

2014-06-21 Thread Mark P
> > > What's the reason for asking? If you aim for making efficient code (that > is running very many times in tight loops), I think most of this will be > inlined by the JIT, as long as it is not confused by side effects and other > things. I'm asking mostly because I want to better understa

Re: Understanding when compilation occurs - for function producing functions

2014-06-21 Thread Mark P
> > A toy project I've worked intermittently on makes heavy use of *partial* > to dynamically build complex functions. I wish that *partial* was smart > enough to recompile its first argument, maybe taking advantage of whatever > type inference the compiler can make, but partial >