Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Strings in Lisp are surrounded with double quotes. In this case, 'English is not a string, but a symbol. Symbols are arbitrary flags with readable names.

There are lots of languages with symbols. Some of them even use the same syntax, like Scala (symbol usage in Scala is uncommon, though). However, the most prominent non-Lisp language that uses symbols all the time is probably Ruby.



Well, rather, english is not a string, but a symbol.

Because symbols denote variable names in Lisp code, the expression english calls for the value of english.

If we want the value of the expression to be the english symbol object itself, we need (quote english).

Because that is too verbose for a language in which symbolic processing is prime time, there is a shorthand prefix notation for it, 'english.


> 'English is not a string, but a symbol

'ENGLISH is not a symbol, it's actually a shorter notation for the list (QUOTE ENGLISH). But it evaluates to a symbol: ENGLISH




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: