Chapter 5: Please, tell me "what's your name?"
I’m gonna ask you two different requests:
- Please, tell me what’s your name
- Please, tell me “what’s your name”
Do you see the difference between the two requests?
To request #1, you will answer by telling me your name: John, Emily, Sandra, David…
And to request #2, you will answer by telling: “what’s your name”.
The difference is that in request #2, there are quotes.
The quote operation
Until now, we learned how to tell the computer to evaluate expressions, like this:
(+ 3 4)
If we want the computer to display expressions exactly as they are, we use the
quote operation, like this:
(quote (+ 3 4))
Feel free to play with the box below and ask the computer to quote any expression that you want
You can quote even expressions that have no sense, for example using variables that don’t exist:
(quote (a b c))
The only restriction is that the expression that you want to quote must be valid.
For instance, the following expression doesn’t work because the parentheses are not balanced:
(quote (+ 3 4 ())
And this one doesn’t work because
12.1.2 is not a valid number:
Can you think about other invalid expressions?
Send us a screenshot with your programs to email@example.com.