On Wed, Dec 29, 2010 at 6:59 AM, B Smith-Mannschott
<bsmith.o...@gmail.com>wrote:

> (In Clojure 1.3-alpha-3, which I happen to have lying around):
>
> double is a function, not a class. So, Clojure responds:
>
>  CompilerException java.lang.IllegalArgumentException: Unable to
> resolve classname ...
>
> (defn f [^double x] x)      ; does not work because double is not a class
> (defn f [^Double x] x)      ; does work. Double is a class
> (defn f [^Double/TYPE x] x) ; does not work. Double/TYPE is not a class,
>                            ; though it stands in for the java type 'double'
>                            ; for reflection.
>
> Short answer: use ^Double
>
> // Ben
>

That's not the problem, and that will give you boxed numbers.

You can't cast the contents of a sequence to a primitive type. And no more
than four arguments may be primitive.

David


> On Wed, Dec 29, 2010 at 10:35, Sunil S Nandihalli
> <sunil.nandiha...@gmail.com> wrote:
> > Hello everybody,
> >  I tried to do the following and I am unable to compile this.
> > (defn v-dot-double [[^double x1 ^double y1 ^double z1] [^double x2
> ^double
> > y2 ^double z2]]
> >   (+ (* x1 x2) (* y1 y2) (* z1 z2)))
> > Am I doing it wrong?
> > Sunil.
> >
> > --
> > 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<clojure%2bunsubscr...@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<clojure%2bunsubscr...@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

Reply via email to