[plt-scheme] Why isn't the car of a list of symbols a symbol?

From: Carl Eastlund (carl.eastlund at gmail.com)
Date: Thu Jul 9 20:12:15 EDT 2009

This digression is *really* muddying the original issue.  I do not
think this is enlightening for Brent, and possibly quite confusing;
furthermore it is off-topic.  I picked one way of writing down values.
 Some of you may prefer another (for instance, as self-evaluating
expressions; mine were not).  It's not worth arguing about; multiple
ways of writing down values can be explained in perfectly
self-consistent ways, so let's each keep our favorite and move on.

Carl Eastlund

On Thu, Jul 9, 2009 at 7:53 PM, Marco Morazan<morazanm at gmail.com> wrote:
>>> ((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.
>
> Huh? Really? How do you figure it evaluates to a list with two
> elements? Without the quote it IS an application expression!
>
> It is pretty straight forward:
>
> ((quote yes) (quote no)) is an application expression
>
> (quote ((quote yes) (quote no))) is a list with two elements
>
> '((quote yes) (quote no)) is a list with two elements
>
> I suggest a little testing:
>
> Welcome to DrScheme, version 4.2 [3m].
> Language: Essentials of Programming Languages (3rd ed.); memory limit:
> 128 megabytes.
>> (list? (quote ((quote yes) (quote no)) ))
> #t
>> (list? '((quote yes) (quote no)) )
> #t
>> (list ((quote yes) (quote no)))
> . . procedure application: expected procedure, given: yes; arguments were: no
>>
>
> That last one means that you are trying to apply 'yes to 'no. Clearly,
> it is an application expression.
>
> --
>
> Cheers,
>
> Marco


Posted on the users mailing list.