(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
On Wed, Dec 29, 2010 at 10:35, Sunil S Nandihalli
<[email protected]> 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 [email protected]
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en