I don't think you're supposed to use spaes in keywords.

On Tue, Mar 6, 2012 at 20:48, Frank Siebenlist
<frank.siebenl...@gmail.com> wrote:
> One other option I should have tried before:
>
> user=> (pr-str k)
> ":jaja nee"
> user=> (read-string (pr-str k))
> :jaja
> user=>
>
> but unfortunately that doesn't help either.
>
> -FrankS
>
> On Mar 6, 2012, at 10:44 AM, Frank Siebenlist wrote:
>
>> I kind of accidently discovered that you can create keywords with an 
>> embedded space… not sure if that's a good idea, but you can:
>>
>> user=> (def k (keyword "jaja nee"))
>> #'user/k
>> user=> (str k)
>> ":jaja nee"
>> user=> (name k)
>> "jaja nee"
>> user=> (keyword? k)
>> true
>> user=> (keyword? :jaja nee)
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol: nee 
>> in this context, compiling:(NO_SOURCE_PATH:15)
>> user=> (keyword? :jaja\ nee)
>> RuntimeException Unsupported character: \ nee  
>> clojure.lang.Util.runtimeException (Util.java:156)
>> RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException 
>> (Util.java:156)
>> user=> (keyword? :jaja\\ nee)
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol: nee 
>> in this context, compiling:(NO_SOURCE_PATH:17)
>> user=>
>>
>> The Q is how do you escape such an embedded space such that the reader will 
>> interpret it as a keyword?
>>
>> -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



-- 
Moritz Ulrich

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