Quixotic symbolism of Lisps

I ported the Emacs psychotherapist from Emacs Lisp to Common Lisp just now, as a means of learning more about each language. This one particular discrepancy took an unreasonable amount of time for me to notice:

1
2
ELISP> (eq 'foo (intern "foo"))
t
1
2
CL-USER> (eq 'foo (intern "foo"))
NIL

The cause of this madness? Observe:

1
2
3
4
ELISP> (intern "foo")
foo
ELISP> (intern "FOO")
FOO
1
2
3
4
5
6
CL-USER> (intern "foo")
|foo|
:INTERNAL
CL-USER> (intern "FOO")
FOO
:INTERNAL

Symbols in Emacs Lisp behave much as strings with regard to case sensitivity, whereas in Common Lisp casing must be escaped with these curious vertical bars. Intern will perform the appropriate escaping, but raw symbol input is always read by CL as upcased. This may also trip you up in the inverse case of symbol->string conversion— make sure you use symbol-name or string instead of write-to-string!