Sorry - just noticed the "Re: cljs: extend-protocol to Keyword" discussion of a 
few days ago.
Maybe we should start maintaining an FAQ-like wiki-page with summaries of those 
issues/features…

-FS.


On Nov 30, 2012, at 5:17 PM, Frank Siebenlist <frank.siebenl...@gmail.com> 
wrote:

> When I ask for the type of a keyword, symbol or string, cljs gives me the 
> same answer:
> 
> ---
> ClojureScript:cljs.user> (type "jaja")
> #<function String() { [native code] }>
> ClojureScript:cljs.user> (type 'jaja)
> #<function String() { [native code] }>
> ClojureScript:cljs.user> (type :jaja)
> #<function String() { [native code] }>
> ClojureScript:cljs.user> (= (type :jaja)(type 'jaja)(type "jaja"))
> true
> ---
> 
> but the predicates for those types seem to work:
> 
> ---
> ClojureScript:cljs.user> (and (string? "jaja")(symbol? 'jaja)(keyword? :jaja))
> true
> ClojureScript:cljs.user> (or (string? 'jaja)(symbol? :jaja)(keyword? "jaja"))
> false
> ---
> 
> I understand that all those types map to javascript's native string.
> 
> The Q is, can you entend those types with protocols?
> 
> ...and if so how?
> 
> Thanks, FrankS.
> 
> 

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