[r6rs-discuss] [Formal] Trivial Enhancement of macros in v5.91: capture-syntax

From: Lynn Winebarger <owinebar>
Date: Tue Nov 28 00:54:54 2006

---
This message is a formal comment which was submitted to formal-comment_at_r6rs.org, following the requirements described at: http://www.r6rs.org/process.html
---
The macro system needs a way of redefining core forms without losing their primitive definitions.
     Scheme is a language without reserved words.  However, while it is possible to redefine
core forms such as lambda, doing so will render the system useless, because the original
primitive transformer will be lost.  The v 5.91 draft has admitted that syntactic transformation
is accomplished by closures.  These closures should be accessible.  The following code
illustrates the idea.
(define-syntax primitive-lambda (capture-syntax lambda))
(define-syntax lambda (capture-syntax trace-lambda))
<code to be traced>
(define-syntax lambda (capture-syntax primitive-lambda))
A more serious example might extend the definition of lambda to take keyword arguments or
more patterns in the argument than a simple list.  The capture-syntax form should be trivial
to implement.
Lynn Winebarger
Received on Sun Nov 26 2006 - 20:57:50 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC