[Top][All Lists]

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

Re: syntax closures

From: Stefan Israelsson Tampe
Subject: Re: syntax closures
Date: Thu, 24 Jan 2013 08:11:09 +0100

Hi Alex!

> Note SRFI-72 is not an implementation of syntactic-closures.
> It's an alternate hygiene algorithm closer to the R6RS one which
> includes a compatible syntax-case and some convenience utilities.

To comments to this:
1. The main reason for SRFI-72 is to e.g. capture the let bound y in
the syntax in
     (define y 1)
     (define (f x) x)
     (let-syntax ((g (lambda (x) #`(let ((y 2)) #,(f #'y))))) g)
     -> 2
   And the same with #,@. In SRFI-72 they design a whole new hygiene
   method etc. for that. What I tried to do was to get this result as well at
   good approximation within the current syntax system.

2. I was actually hesistant to call this srfi-72 because of trying to
do what it want
   more than what it say's. A main trick to simulate the effect was to introduce
   a closure in the syntax at one point and therefore a choose the name
   syntax-closure not knowing that there is an already a notion of
that in the wild

> Syntactic-closures never had a formal specification, just
> an informal description and reference implementation, so
> it's not clear to me if SRFI-72's make-capturing-identifier is
> equivalent to the synclos free variables.

yeah I could be out of the blue saying srfi-72. Maybe the algorithm
needs a srfi
of it's own because it does useful stuff and integrates well with
standard syntax-case
systems which srfi-72 don't. And of cause the mentioning of synclos could be


reply via email to

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