Hi, Am 06.03.2012 um 21:28 schrieb Frank Siebenlist:
> So… spaces are not allowed in symbol and keyword identifiers according to the > "spec"… > > although Stu doesn't quote the phrase following the allowed chars, which > reads: > > (other characters will be allowed eventually…) > > which seems to keep the door open for allowing spaces in the future (?). > > If space are not allowed, then it seems we have a bug in (keyword …) and > (symbol …), > if they will be allowed in the future, then (pr …) could/should be enhanced. I think this has been discussed several times in the past. This is *not* a bug in keyword or symbol. A string with spaces is simply not in the domain of these functions. So by definition it cannot be a bug. What happens is a pure decision by the implementer. The functions could throw an exception. Or they could return an invalid value. symbol and keyword do the latter. (Whether this is good or bad might be a matter of discussion, but it is not a bug.) And of course vice versa: the behaviour of symbol or keyword is *not* the definition of valid keywords/symbols. That is what Stu cited. I doubt that spaces will be officially allowed until there is – say – #|foo bar| for symbols and #:foo bar: for keywords. Until then a translation of {"Foo Bar" 35} to {:foo-bar 35} is a quite feasible workaround. BTW: Similarly you can use non-ASCII characters for symbols in your clojure code. This code would then be broken. The reader doesn't complain, but the “spec” says: only ASCII characters are allowed. Same situation as above. BTW2: There are a lot of things which might be desirable for various reasons. Spaces in symbols or keywords might be one of these things. But that doesn't mean it's a good idea to implement it. In Clojure's past there were several things which were requested with a lot of pressure (often combined with “sky is falling” comparisons), which were not implemented in the language. Only after long considerations changes went into the language (often) providing a superior solution to the previously requested versions. Patience is a required skill of a clojurian. ;) Sincerely Meikel -- 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