I’m trying to learn Scheme from the book ‘The Little Schemer’ using DrScheme on a Macintosh. It starts with things like ‘What is the car of l where l is the argument (a b c)?’
I understand that the answer to this question is a, but I’m not able to actually figure out what to type into Dr Scheme to ‘follow along’. A simple idea on how to assign to l such as > (def l (‘a ‘b ‘c))
gives me the error: ‘function call: expected a defined name or a primitive operation name after an open parenthesis, but found something else’
To define something:
So to define l:
This defines
las the list(a b c). The single quote mark quotes whatever is after it, whether it’s a symbol or a list, which means it’s not evaluated but read as-is. You don’t, however, quote the name that you’re setting it to. Thankfully, this is one of the very small number of operations in Scheme where you have this inconsistency.