Lisp has the best "variable names". Symbol names can be anything, which means any possible string containing any characters possible can be used. Not all are printable or readable directly without escaping the name, but that depends on the readtable-case and a few other rules.
>>20
Yes, but since ( and #' are both reader macros:
CL-USER> (get-macro-character #\()
#<FUNCTION SB-IMPL::READ-LIST>
NIL
CL-USER> (get-macro-character #\#)
#<FUNCTION SB-IMPL::READ-DISPATCH-CHAR>
T
CL-USER> (get-dispatch-macro-character #\# #\')
#<FUNCTION SB-IMPL::SHARP-QUOTE>
If you used a variable named that, the reader would end up calling the reader macros, thus your variable name won't end up being read. To explicitly use that symbol name, you have to use a multiple escape character to designate it: |(#'|:
CL-USER> (symbol-name '|(#'|)
"(#'"
For more information on this: http://www.lispworks.com/documentation/HyperSpec/Body/02_ade.htm
If you had some really strange/minimalistic readtable where you wouldn't use () to designate lists and #' wouldn't be a dispatch macro character for (function _), then you could actually use (#' freely as a symbol name without having to use the multiple escape.
The general idea is that once you give a character some special functionality as part of the syntax(be it some official standardized one, or something of your own making), using in symbol names without escaping it becomes impossible, but that's perfectly understandable. In a syntax of your own making, you can choose what needs to be escaped and what doesn't. CL tries leave a lot of characters unused, so you can make rich symbol names, or use it for your own syntax, while building upon CL's default syntax (of course, nothing forbids you from starting from scratch and just making your own syntax, or even defining your own reader - you could easily make it support some C syntax or Python syntax or whatever you please - some people have already done this!).
>>23
The symbol name is (#', but to actually get the default reader to read it, you would have to escape it. If you truly desire to use that as a variable name without escaping it, you would have to remove the ( macro character from the current readtable, an example of how to achieve such a broken syntax would be:
(progn
(set-syntax-from-char #\[ #\()
(set-macro-character #\( nil)
(set-macro-character #\# nil)
(set-macro-character #\' nil))
However, this would break a lot of things unless you are careful to patch things up (you should write your own #\( handler and so on).
There is no way (in any language out there) to allow any character in symbol names without escaping as long as you have SOME syntax, otherwise it would be theorethically(and practically) impossible to parse it. However, if you decide the syntax, you could easily make (#' a valid symbol name without requiring escaping. I don't see the use in doing this, but it's perfectly possible. In practice, most Lispers don't mess with the syntax, and prefer keeping it minimal, so it would indeed be used as |(#'| .
>>24
Stop this Lisp hoax. There ain't no language that lets the programmer modify the syntax, silly. This was fun back then in 1958, but now it's not anymore, today we joke about Trollgol.
IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT IF YOU CAN READ THIS, YOUR A MASSIVE FAGGOT
>>16
It actually did surprise me. I've never seen them used before (thankfully), but they seem to work in at least in gcc. K&R says that variable names must start with a letter or an underscore. What's up with this crap?