On Sat, Mar 28, 2009 at 2:32 AM, Victor Rodriguez <vict...@gmail.com> wrote:
>
> On Fri, Mar 27, 2009 at 5:51 PM, ke...@ksvanhorn.com
> <kvanh...@ksvanhorn.com> wrote:
>>
>> The Clojure documentation, under "Reader", gives a list of characters
>> allowed in a symbol name.  The characters, <, >, and = are not
>> included in this list.  How is it then that <, <=, >, >=, =, etc. are
>> symbols?  (I assume they are symbols because I can write (< 3 4),
>> etc.)
>
> Looks like the documentation is out of date:
>
> user> (def <>= 3)
> #'user/<>=
> user> <>=
> 3

This is not a valid conclusion.  Clojure does allow things that,
according to the documentation, you should not do.  And not because
the documentation is out of date.

e.g. symbols beginning or ending with a dot are reserved.  Yet you can do this:

user=> (def ... 123)
#'user/...
user=> ...
123

or this:

user=> (defmacro ... [x] x)
#'user/...
user=> (... 123)
123

Although this is currently allowed by Clojure, it is not guaranteed to
keep working as Clojure evolves.

Also, trying to do the same with a function instead of a macro does not work:

user=> (defn ... [x] x)
#'user/...
user=> (... 123)
java.lang.IllegalArgumentException: No matching field found: .. for
class java.lang.Integer (NO_SOURCE_FILE:0)

I don't know the answer to the original question.

-- 
Michael Wood <esiot...@gmail.com>

--~--~---------~--~----~------------~-------~--~----~
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 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to