[plt-scheme] Why isn't the car of a list of symbols a symbol?
On Thu, Jul 9, 2009 at 1:21 PM, Robby
Findler<robby at eecs.northwestern.edu> wrote:
> On Thu, Jul 9, 2009 at 3:18 PM, Carl Eastlund<carl.eastlund at gmail.com> wrote:
>> Following those rules, '('yes 'no) is (quote ((quote yes) (quote
>> no))), and it produces the value ((quote yes) (quote no)). Apply
>> those two rules, and quote shouldn't have any more surprises.
>
> ((quote yes) (quote no))
>
> is not a value. It is an application expression.
It most certainly is a value. It is a list of two elements.
There are many ways to construct such a value. Carl
suggested evaluating '('yes 'no).
> The way to keep your sanity here is to think of the printer as
> stripping off the outer quote when it prints out a value.
What are you smoking?! The printer isn't involved here and
it certainly isn't stripping anything.
Another way to get the value is to evaluate this:
(cons '(quote yes) (cons '(quote no) '()))
Which also prints as ((quote yes)(quote no))
but there is no `outer quote' for the printer to have removed.
--
~jrm