Re: 'dotimes' will not work inside a 'doto'...

2012-06-15 Thread Jim - FooBar();
On 15/06/12 01:00, Andy Fingerhut wrote: I highly recommend clojuredocs.org for adding examples of pitfalls/traps. I've added several there myself, e.g. for clojure.core/future (and also clojure.core/pmap, clojure.java.shell/sh): http://clojuredocs.org/clojure_core/cl

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Andy Fingerhut
I highly recommend clojuredocs.org for adding examples of pitfalls/traps. I've added several there myself, e.g. for clojure.core/future (and also clojure.core/pmap, clojure.java.shell/sh): http://clojuredocs.org/clojure_core/clojure.core/future It takes only a few minutes to do so. Andy On

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();
why not even go a bit further and add a tiny warning with regards to evaluating macros as well? I mean I don't know about you guys but I've not been 'burned' before when trying to use macros inside macros and the error message is not immediately obvious what it means...it does say that the argu

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Andy Fingerhut
On Jun 14, 2012, at 7:59 AM, Jim - FooBar(); wrote: > well, no... :-) > > Jim > > On 14/06/12 15:52, David Nolen wrote: >> >> On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar(); >> wrote: >> Evaluates x then calls all of the methods and functions with the >> value of x supplied at the front

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Walter Tetzner
On Thursday, June 14, 2012 8:09:50 AM UTC-4, Jim foo.bar wrote: > > It has to be 'do' instead of 'doto'... > Well, if you want to be able to use doto, you could do something like (doto foo (.bar x) (.baz y) (#(dotimes [i 10] (.zab % g -- You received this message because you are sub

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();
well, no... :-) Jim On 14/06/12 15:52, David Nolen wrote: On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar(); mailto:jimpil1...@gmail.com>> wrote: Evaluates x then calls all of the methods and functions with the value of x supplied at the front of the given arguments that's in the do

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread David Nolen
On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar(); wrote: > Evaluates x then calls all of the methods and functions with the > value of x supplied at the front of the given arguments > that's in the docstring for doto. but dotimes is not a method or a function is it? :) David -- You received t

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();
On 14/06/12 15:10, Tassilo Horn wrote: The docs clearly state that. Where? I don't see any warnings...It does say "... calls all of the methods and functions with the value of x supplied at the front of the given arguments" but it wasn't obvious to me at first! user=> (doc dotimes) --

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Aaron Cohen
On Thu, Jun 14, 2012 at 8:09 AM, Jim - FooBar(); wrote: > (doto foo >  (.bar x) >  (.baz y) >  (dotimes [i 10] (.zab g))) > > won't work because foo is substituted as the second argument of 'dotimes'! > It has to be 'do' instead of 'doto'... > > very subtle trap... > > Jim I think the "trap" here

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Tassilo Horn
"Jim - FooBar();" writes: > (doto foo > (.bar x) > (.baz y) > (dotimes [i 10] (.zab g))) > > won't work because foo is substituted as the second argument of > 'dotimes'! The docs clearly state that. > It has to be 'do' instead of 'doto'... Then, you need (.bar foo x), (.baz foo y), and (.za