[plt-scheme] Semantics of quote
I just got home from a midsummernight feast.
The answers have already been given.
It appears that you only were confused by getting 'a where you expected
(quote a).
Your concept of quote is right.
'a is just another way of writing (quote a), both in input nd output.
I have no opinion on whether to prefer 'a or (quote a) in the output.
According to your own concept (quote (my-quote a)) must indeed yield
(my-quote a)
The macro is not called. Quote makes (my-quote a)) data that is not to be
evaluated.
As another example: (quote (quasiquote x)) may yield `x or (quasiquote x)
depending on the Scheme you are using,
Even (list 'quasiquote 'a) may yield (quasiquote a) or `a. It's just a
matter of notation.
Jos
----- Original Message -----
From: "Mark Engelberg" <mark.engelberg at gmail.com>
To: "Jos Koot" <jos.koot at telefonica.net>
Cc: "pltscheme" <plt-scheme at list.cs.brown.edu>
Sent: Monday, June 23, 2008 9:08 PM
Subject: Re: [plt-scheme] Semantics of quote
> Some examples:
>
> (cons 'quote (cons 'a empty)) prints as 'a
>
> Consider:
> (define-syntax my-quote
> (syntax-rules ()
> ((my-quote expr)
> (quote expr))))
>
> (quote (quote a))
> and
> (quote (my-quote a))
>
> yield different outputs.
>
> --Mark
>
> On Mon, Jun 23, 2008 at 7:52 AM, Jos Koot <jos.koot at telefonica.net> wrote:
>> Can you be somewhat more specific? What kind of subtle things do you
>> encounter?
>> jos
>> ----- Original Message ----- From: "Mark Engelberg"
>> <mark.engelberg at gmail.com>
>> To: "pltscheme" <plt-scheme at list.cs.brown.edu>
>> Sent: Monday, June 23, 2008 6:25 AM
>> Subject: [plt-scheme] Semantics of quote
>>
>>
>>> Can anyone point me to a fairly precise explanation of quote?
>>> Sometimes I encounter subtle things that make me wonder whether my
>>> mental model of how quote works is accurate.
>>>
>>> --Mark
>>> _________________________________________________
>>> For list-related administrative tasks:
>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>>