[plt-scheme] Semantics of quote

From: Robby Findler (robby at cs.uchicago.edu)
Date: Tue Jun 24 01:14:49 EDT 2008

On Tue, Jun 24, 2008 at 12:10 AM, Eli Barzilay <eli at barzilay.org> wrote:
> On Jun 23, Robby Findler wrote:
>> Oops, forgot to include this in my message below:
>>
>> Welcome to DrScheme, version 4.0.1-svn21jun2008 [3m].
>> Language: Module custom; memory limit: 128 megabytes.
>> > (list +)
>> (list +)
>
> I take it that you'll want to see this then:
>
>  > '(+)
>  (list '+)
>  > ''(+)
>  (list 'quote (list '+))
>  > '''(+)
>  (list 'quote (list 'quote (list '+)))
>  > '(if (< x y) (+ x y) -1)
>  (list 'if (list '< 'x 'y) (list '+ 'x 'y) -1)
>
> This is even worse.  I spent a few years working on getting the
> advantages of a constant-size addition for quotation (where each level
> of quotation can be represented by a constant (or at least linear)
> addition) -- in other words, I spent nearly a decade talking about why
> quoting is good, and you want to throw this natural advantage and
> intentionally make it print with the exponential representation.

Quoting is good. Of course. I never said it wasn't. Let me remind you
again about the quasiquote printer.

The "exponential representation" you're talking about is presumably
situations like this:

  (define x1 (list 'x))
  (define x2 (list x1 x1))
  (define x3 (list x2 x2))
  ..
  (define xn (list xn-1 xn-1))

But again, that's completely separate from the issue of how the
printer prints. If you don't turn on cycle detection with mzscheme's
current printer you get huge terms for that stuff too. "shared" is how
one detects & prints cycles for that stuff in my world.

Robby


Posted on the users mailing list.