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

I didn't sign in too far, but isn't the first line of code on their landing page a typo?

(define my-language 'English)

Looks like it's missing a closing single quote. I suppose it could be optional.



The code is correct. That's a Lisp thing called `quote`. https://docs.racket-lang.org/guide/Pairs__Lists__and_Racket_...


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




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: