> (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 (iterate nextInt 0))) On Sun, Sep 25, 2011 at 3:51 PM, Dennis Haupt <d.haup...@googlemail.com> wrote: > -----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 to cast my "0" to a function? and how can i get rid > of the dummy parameter [a]? > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.14 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iQIcBAEBAgAGBQJOf4ZIAAoJENRtux+h35aG19UP/1tWgqcQifwUI5zHdkKWTcY8 > iY9vXGEr3IvTC2nB1yXJESJ6T/4OTpGhUT9ctX+6xGxPHFC9OPUdvnp5gGUOjCFQ > Qa9G8Qc6Za1uc0HFzbWYxP9yi8TAPg1WVA3RF046kKuS/m9X8uUMtCulSJH8y6m4 > VmREcGlyQNjgCDMSRmMX5Y7vVuU2e6KoV6VjSopBHzX/sXBsMd0AZcnCRokBUKre > 7J1PyK3YKBmRLZ6gdvnOTz4kDBoKE7yrbh2gpIsQciqsawZ0wWYlBou7JceSxtN3 > Zwzm64YLxW8f6DjaRL7ZUAwTVMBkIru86hgm2bMK5pFX5f8bzBcmx09eIgd1fgLV > c3bHtFYWzVrCRAGA+7iqeedQiFmkX2aK6yIcEma8KvoPXRlU5XhTiTN4B4sfPrpC > qHM0U30WVIV05qs9E8rW2JDmpm1X7RpkZ9P3PEQXgYV1yJaSjPPyxRC1R0wi7f0o > KUEXu+WO0egLyh3d8kfD1GMR/ztRGlS0UbJ3htqso710uD+R4GzFvRcitF99bQtm > cOgz7sLB0hJTS3AblNhRzwt0CRdsPjHfBixrqbxGbXcLvkXFyoZMebuJwMZNcpzY > wFhgEGyVxShXQASNub3dzNS8peU5fgoAGLexHh46e02K8a1YWjK3OOokZ3W9uCpt > ghqI1/wkly1r9F/FroFo > =+5YI > -----END PGP SIGNATURE----- > > -- > 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 that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- 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 that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en