guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tree-il->scheme improvements


From: Mark H Weaver
Subject: Re: [PATCH] tree-il->scheme improvements
Date: Fri, 02 Mar 2012 13:34:20 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

I wrote:
> The last patch is new.  It minimizes the wraps of the embedded syntax
> objects in psyntax-pp.scm, such that they can no longer be used as the
> first argument to 'datum->syntax' but are otherwise equivalent.  (The
> resulting syntax-objects are the same as those returned by
> 'locally-bound-identifiers', but without the added anti-marks).

Sorry, I was mistaken about 'locally-bound-identifiers' doing the same
thing.  I expect that Andy will be worried about this change, so I
better talk about it a bit more.

First, to justify the time spent thinking about this: all of the other
improvements to 'tree-il->scheme' reduce psyntax-pp.scm by a factor of
two, but this syntax-object minimization alone reduces the size of
psyntax-pp.scm by an additional factor of 4.

Here's a complete list of the embedded syntax objects currently found in
psyntax-pp.scm:

Non-symbols:

  #f "append" "list" "list*" "list->vector" "quote" "value" "vector"

Globals:

  ... _ append begin cons define else identifier-syntax identifier?
  if include lambda lambda* let list list->vector macro-type
  make-variable-transformer memv not quasiquote quote set! setter
  syntax syntax-case syntax-rules unquote unquote-splicing vector

Identifiers that aren't globals, but were not present in the
syntax-object ribcage:

  doloop   (within definition of 'do' macro)
  dummy    (within definition of 'syntax-rules' macro)
  id       (within definition of 'identifier-syntax' macro)
  pad      (within definition of 'syntax-case' core form)
  patterns (within definition of 'syntax-rules' macro)
  private  (within definition of '@@' core form)
  public   (within definition of '@' core form)
  t        (within definition of 'case' macro)

Identifiers that were present in the syntax-object ribcage:

  x (within definition of 'define*' macro)
  x (within definition of 'identifier-syntax' macro)
  x (within definition of 'syntax-rules' macro)

As explained in sections 4.2 and 4.3 of "Syntactic Abstraction in
Scheme" by Dybvig, Hieb, and Bruggeman, identifiers could be represented
by ordered triples of the form (original-name binding-name marks) if not
for the need to support 'datum->syntax'.  Supporting 'datum->syntax'
requires that identifiers must also keep the set of substitutions
applied to them, so that these substitutions may be applied to the new
datums.

Therefore, the relevant question here is: is there ever a case where
someone is going to call 'datum->syntax' on one of these introduced
syntax objects?  It seems reasonably clear to me that the answer is
"no", and that keeping all of this cruft doesn't justify quadrupling the
size of psyntax-pp.scm.

What do you think?

    Thanks,
      Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]