If I recall correctly, #^String is the "old" type hint syntax. Can't remember 
when the change
occurred however.

The later (^String) is the syntax to use.

Luc P.

On Wed, 31 Aug 2011 19:45:56 -0700 (PDT)
yeejlan <yf_he...@163.com> wrote:

> Hi Guys,
> 
> Here is what I did:
> 
> user=> (set! *warn-on-reflection* true)
> true
> user=> (def mystr "hello")
> #'user/mystr
> user=> (.substring mystr 1 2)
> Reflection warning, NO_SOURCE_PATH:23 - call to substring can't be
> resolved.
> "e"
> user=> (.substring #^String mystr 1 2)
> "e"
> user=> (.substring ^String mystr 1 2)
> "e"
> 
> I know #^String is a type hint, but why ^String works too? is ^String
> the same meaning as #^String?
> 
> Thank you,
> 
> yeejlan
> 



-- 
Luc P.

================
The rabid Muppet

-- 
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