Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clojure ^floats vs. #^floats?

Tags:

clojure

What is the difference between ^floats and #^floats in Clojure type annotations?

In a pull request, someone suggested I use this annotation:

(.put #^floats init-fft-array)

which did the trick, but I don't know why the '#' is there. I found this worked, too:

(.put ^floats init-fft-array)

Is there any difference?

like image 601
Roger Allen Avatar asked May 25 '15 00:05

Roger Allen


1 Answers

#^floats is a legacy syntax, with newer Clojure versions ^floats is preferred.

like image 167
noisesmith Avatar answered Sep 28 '22 05:09

noisesmith