Somewhat related, I noticed that the keyword function doesn't seem to make any attempt at ensuring keywords are even readable.
user=> (keyword "(foo)") :(foo) Is this intended? On Nov 24, 9:26 am, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Nov 23, 9:09 am, James Reeves <[EMAIL PROTECTED]> wrote: > > > > > On Nov 23, 11:38 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > Hi, > > > > According tohttp://clojure.org/reader: > > > > > Keywords are like symbols, except: > > > > > o They can and must begin with a colon, e.g. :fred. > > > > o They cannot contain '.' or name classes. > > > > Shouldn't this throw an exception? It seems that keywords aren't > > > checked for correctness at all right now. > > > I'd like to request that keywords continue to allow the '.' character, > > as it's useful for certain edge cases (Compojure and clj-html use it > > to specify class attributes, for instance). Does the inclusion of a > > '.' in a keyword introduce any syntax ambiguity I'm unaware of? > > > Disallowing class names in keywords seems a little odd too, especially > > with AOT. If you compiled a Clojure file like clojure.contrib.def, > > would that mean you'd lose the ability to use the keyword :def? > > I think you've both misread "they cannot name classes" to be - "They > cannot contain class names". > > The symbol String can name a class but the keyword :String can't, > that's all I meant there. > > As far as '.', that restriction has been relaxed. I'll try to touch up > the docs for the next release. > > Rich --~--~---------~--~----~------------~-------~--~----~ 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 To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---