Re: Error in 1.3 alpha 3 - Only long and double primitives are supported
On Mon, 08 Nov 2010 14:14:16 -0500, lprefontaine wrote: Sticking to long and double gets away from Java semantic but it is done to improve numeric performances. You can actually hint in 1,3 on the return type of a function to avoid automatic boxing and have your code work entirely with a native type. Boxing if I recall correctly will convert systematically to BigDecimal. Any computation could then be carried on, even if it does not fit in one of the native types (long or double). If you work explicitly with longs or doubles, it's at the expense of (potential) overflow exceptions. If you have a intense numeric computations it is assumed that you know about these potential limits. As for the syntax to pass bytes, ints, ... to Java, I cannot recall the exact syntax to do it but it should be similar to type hints used in 1.2. No idea if the Conj videos are available yet... They don't seem to be mentioned on http://clojure-conj.org/ -- and http:// clojure.blip.tv/ has been mostly inactive. Could we see more videos posted on blip.tv? I like how you can actually download the original video files from there (and revver, and vimeo; unlike YouTube, bah -- officially, anyway). -- Michel Alexandre Salim Clojure contributor: http://clojure.org/contributing GPG key ID: 78884778 µblog: http://identi.ca/hircus | Jabber: hir...@jabber.ccc.de http://twitter.com/hircus | IRC:hir...@irc.freenode.net () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments -- 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
Error in 1.3 alpha 3 - Only long and double primitives are supported
Hi all, I was testing some code under Clojure 1.3 alpha 3 that works correctly in Clojure 1.2 and got the following error: CompilerException java.lang.IllegalArgumentException: Only long and double primitives are supported For some reason I don't get a full stack trace saying where the error occurred - the line that the error referred to was simply a (java.io File) in the middle of a namespace import statement. Any idea what might be going wrong here? Also - I'm a bit worried as the message suggests that Clojure won't support int and float primitives for some purposes - which are pretty essential for Java interop - surely that can't be true? Or is this just a temporary thing during the Alpha development? Mike. -- 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
Re: Error in 1.3 alpha 3 - Only long and double primitives are supported
Also - I'm a bit worried as the message suggests that Clojure won't support int and float primitives for some purposes - which are pretty essential for Java interop - surely that can't be true? Or is this just a temporary thing during the Alpha development? longs and doubles will be the default number types in Clojure starting with version 1.3. Clojure will still allow ints and floats, but only for the purpose of Java interop. You'll need to explicitely convert to int or float when you need it for interop, and I don't remember the recommended way to do this. Rich Hickey discussed these issues in one of his Clojure Conj presentations. -- 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
Re: Error in 1.3 alpha 3 - Only long and double primitives are supported
Sticking to long and double gets away from Java semantic but it is done to improve numeric performances. You can actually hint in 1,3 on the return type of a function to avoid automatic boxing and have your code work entirely with a native type. Boxing if I recall correctly will convert systematically to BigDecimal. Any computation could then be carried on, even if it does not fit in one of the native types (long or double). If you work explicitly with longs or doubles, it's at the expense of (potential) overflow exceptions. If you have a intense numeric computations it is assumed that you know about these potential limits. As for the syntax to pass bytes, ints, ... to Java, I cannot recall the exact syntax to do it but it should be similar to type hints used in 1.2. No idea if the Conj videos are available yet... Luc P. Mike Anderson mike.r.anderson...@gmail.com wrote .. Hi all, I was testing some code under Clojure 1.3 alpha 3 that works correctly in Clojure 1.2 and got the following error: CompilerException java.lang.IllegalArgumentException: Only long and double primitives are supported For some reason I don't get a full stack trace saying where the error occurred - the line that the error referred to was simply a (java.io File) in the middle of a namespace import statement. Any idea what might be going wrong here? Also - I'm a bit worried as the message suggests that Clojure won't support int and float primitives for some purposes - which are pretty essential for Java interop - surely that can't be true? Or is this just a temporary thing during the Alpha development? Mike. -- 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