The main usage (at least for me) is avoiding reflection in the context
of direct call to a Java method.
if you write:
(defn foo [x]
(.clone x))
Thank you for the insightful explanation.
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post
The follow is the ring's source, and I am a newbie in Clojure.
what the defn of run-jetty looks like this form, what's the meaning of
#^Server in the defn and let?
Thanks in advance.
Limux.
(defn #^Server run-jetty
Serve the given handler according to the options.
Options:
:configurator
On Aug 9, 8:25 am, limux liumengji...@gmail.com wrote:
what's the meaning of
#^Server in the defn and let?
(defn #^Server run-jetty
...
(let [#^Server s (create-server (dissoc options :configurator))]
It's a type hint. In the defn it specifies the type of the return
value, in the let it
I see, heartly thanks, and there is no any words about it in API doc
of clojure.org yet!
Regards
limux.
On 8月9日, 下午3时04分, j-g-faustus johannes.fries...@gmail.com wrote:
On Aug 9, 8:25 am, limux liumengji...@gmail.com wrote:
what's the meaning of
#^Server in the defn and let?
(defn
The type hint can be placed on function parameters, let-bound names,
var names, and expressions.
And it can be placed behind or ahead of them. Isn't it?
On 8月9日, 下午3时31分, limux liumengji...@gmail.com wrote:
I see, heartly thanks, and there is no any words about it in API doc
of clojure.org
I am not 100% sure, but it seems they are always ahead.
(defn ^Bar foo ...)
tells that function foo returns something of class Bar.
(f ^Bar expr) says that expr is of type Bar.
(let [ ^Bar e expr] ... says that e is of type Bar.
(Bar can be a class or an interface.)
The main usage (at least