When I make a list in Scheme, what does the cdr of the last pair point to? Is it an ’empty word’ or an ’empty list’? DrScheme doesnt mind (cons 'a empty) nor (cons 'a '()). Finally what is the difference between the empty word and the empty list?
When I make a list in Scheme, what does the cdr of the last
Share
DrScheme doesn’t mind your
cons-ing, becauseconscan do more than just build lists. From the reference,which means that
consbuilds pairs. It’s also perfectly legal to dowhich is not a list, but which still lets you do
But anyways, the “empty word” and the “empty list ” are the same object, as can be checked by