But using symbols for something like this is a bit contrived anyway.
Maybe, but I've seen it in other Common Lisp books/tutorials before.
e.g. I'm sure PAIP was one of them.
Part of the motivation is that CL symbols always compare with EQ and
EQL, whilst strings are not required to do so:
cl-user(9): (eq (concatenate 'string "foo" "bar") "foobar")
nil
This means you can use nice constructs such as CASE with symbols, but
you need to roll your own using string-equal or string= to handle
strings.
(Using symbols also saves you typing all those double-quote
characters, as well as saving memory and computation during
comparison: symbols are interned, unlike strings.)
In Clojure (thanks to Java's immutable interned strings) strings
compare efficiently with = just like everything else, so there's less
motivation.
--
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
To unsubscribe from this group, send email to clojure+unsubscribegooglegroups.com or
reply to this email with the words "REMOVE ME" as the subject.