[R6RS] syntax-case SRFI

Michael Sperber sperber at informatik.uni-tuebingen.de
Tue Apr 11 11:33:48 EDT 2006

Here are some comments on the presentation from a first reading.  I'll
have more to say on some of the substantive issues, especially the
hygiene, once I've wrapped my mind around it.

1. Abstract

- "constants" -> "literal expressions"

- "original source code (or even source file locations [...])" seems
  redundant, or confusing.

3.1 Expansion Process

- The notion of "core forms" is somewhat vague.  I suppose the
  expansion really must be into forms of some R6RS core.  But we don't
  really want to specify that, say, COND *must* be a macro, right?

- The specification of processing order is scattered through the
  presentation, and that makes it hard to follow.  My interpretation
  is this:

    The expander makes two passes.  In the first pass, it sequentially
    processes all forms, extending the environment as it goes, and
    expanding them to the point where it can see which ones are
    definitions.  It then makes a second pass, again processing the
    original forms, but with an environment noting all the identifiers
    from the first pass for purposes of literal matching, and this time
    expanding all forms completely.

  This would imply that the sentence "Any definition that is intended
  to effect how other definitions are processed by the expander must
  appear before the other definitions." is incorrect, or at least

- As discussed in last week's conference, the description of hygiene
  is incomprehensible to mere mortals like me.

3.3 Transformers

- "A transformer is usually [...]": This kind of formulation appears
  numerous times, and it's really confusing because of the vagueness
  of "usually."  This should really be pinned down right there.

3.5 Parsing input and producing output

- I think the description of matching would be easier to understand if
  an R5RS-style EBNF would describe what a pattern could be.

- "The second of uses" -> "The second example uses"

- I can't find a definition of how `make-variable-transformer' works.

3.6 Identifier predicates

- I don't understand the description of `bound-identifier=?',
  `free-identifier=?', and `literal-identifier=?', despite having read
  it probably more than 20 times over the last five years.  This needs
  to refer to the description of hygiene.  The colloquial description
  in Martin G,'s dissertation is also much easier to undertand for me:

    Syntax-case [DHB92] defines two primitives for comparing
    identifiers with regard to their binding places:

    - free-identifier=? determines whether two identifiers are equal if
      they appear in the output of a macro and the output does not bind

    - bound-identifier=? determines whether two identifiers are equal if
      they appear in the output of a macro and the output binds them. 

  I'm totally clueless as to `literal-identifier=?'.

5. Issues

- There should be an issue bullet on local `define-syntax'.

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

More information about the R6RS mailing list