pika-dev
[Top][All Lists]
Advanced

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

[Pika-dev] SYNTAX-RULES literal matching


From: Matthew Dempsky
Subject: [Pika-dev] SYNTAX-RULES literal matching
Date: 06 Mar 2004 21:04:45 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Tom,

Apparently I was (at least partially) mistaken in my understanding of
literal matching for SYNTAX-RULES macros in R5RS:

        Identifiers that appear in <literals> are interpreted as
        literal identifiers to be matched against corresponding
        subforms of the input. A subform in the input matches a
        literal identifier if and only if it is an identifier and
        either both its occurrence in the macro expression and its
        occurrence in the macro definition have the same lexical
        binding, or the two identifiers are equal and both have no
        lexical binding.

For the most part, this seems like it wouldn't mandate that modules
export bindings for literals that refer to the top-level in the
definition environment, however, something like

    (let ((else #f))
      (let-syntax ((cond (syntax-rules (else)
                           [as defined in r5rs])))
        (eval some-code (make-module (the-environment)))))

seems like an issue where some-code uses the defined COND form along
with the ELSE clause: in the SYNTAX-RULES definition, ELSE has a
lexical binding and in evaluating some-code we would have to do some
icky magic to get it to do the Right Thing (unless I'm mistaken on
what the Right Thing is).

-jivera




reply via email to

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