Re: can't see the error

2011-09-27 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 27.09.2011 06:27, schrieb Baishampayan Ghose: >> i wasn't really trying to achieve anything useful - just messing >> around and see where i get. >> >> now i'm here: (defrecord point [x y z]) (defn genPoints [n] (let >> [random (new Random) randomI

Re: can't see the error

2011-09-26 Thread Baishampayan Ghose
> i wasn't really trying to achieve anything useful - just messing > around and see where i get. > > now i'm here: > (defrecord point [x y z]) > (defn genPoints [n] >  (let [random (new Random) >        randomInt #(.nextInt random) >        randomPoint #(new point (randomInt) (randomInt) (randomInt

Re: can't see the error

2011-09-26 Thread Andy Fingerhut
This: randomPoint #(apply new point (repeatedly 3 randomInt)) does not work, but is almost what you want. It doesn't work because new is a macro, and apply only works with functions as the first arg. Using the following two lines, first to define a function, then to use it with apply, seems lik

Re: can't see the error

2011-09-26 Thread Jeremy Heiler
On Mon, Sep 26, 2011 at 5:33 PM, Dennis Haupt wrote: > now i'm here: > (defrecord point [x y z]) > (defn genPoints [n] >  (let [random (new Random) >        randomInt #(.nextInt random) >        randomPoint #(new point (randomInt) (randomInt) (randomInt))] >    (repeatedly n randomPoint))) > > is

Re: can't see the error

2011-09-26 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 i wasn't really trying to achieve anything useful - just messing around and see where i get. now i'm here: (defrecord point [x y z]) (defn genPoints [n] (let [random (new Random) randomInt #(.nextInt random) randomPoint #(new point (

Re: can't see the error

2011-09-26 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 i don't have the magic eye to spot the parenthesis-errors yet Am 25.09.2011 22:15, schrieb Mark Rathwell: >> (let [rand (new java.util.Random) nextInt (fn [a] (.nextInt >> rand))] ((map (print) (iterate ((nextInt "dummy") 0) > > extra parenthesis

Re: can't see the error

2011-09-25 Thread Mark Rathwell
> (let [rand (new java.util.Random) nextInt (fn [a] (.nextInt rand))] > ((map (print) (iterate ((nextInt "dummy") 0) extra parenthesis in three places, and the first argument to iterate is a function, not a long: (let [rand (new java.util.Random) nextInt (fn [a] (.nextInt rand))] (map print

Re: can't see the error

2011-09-25 Thread Baishampayan Ghose
On Mon, Sep 26, 2011 at 1:21 AM, Dennis Haupt wrote: > (let [rand (new java.util.Random) nextInt (fn [a] (.nextInt rand))] > ((map (print) (iterate ((nextInt "dummy") 0) > > > the error is: > java.lang.ClassCastException: java.lang.Integer cannot be cast to > clojure.lang.IFn (NO_SOURCE_FILE:0

Re: can't see the error

2011-09-25 Thread Daniel Solano Gomez
On Sun Sep 25 21:51 2011, Dennis Haupt wrote: > (let [rand (new java.util.Random) nextInt (fn [a] (.nextInt rand))] > ((map (print) (iterate ((nextInt "dummy") 0) > > > the error is: > java.lang.ClassCastException: java.lang.Integer cannot be cast to > clojure.lang.IFn (NO_SOURCE_FILE:0) > >

can't see the error

2011-09-25 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 (let [rand (new java.util.Random) nextInt (fn [a] (.nextInt rand))] ((map (print) (iterate ((nextInt "dummy") 0) the error is: java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0) why does it want