[Larceny-users] [long] identifier bindings and visibility across phases

Andre van Tonder andre at het.brown.edu
Tue Oct 6 19:05:06 EDT 2009


On Tue, 6 Oct 2009, Marco Maggi wrote:

> I have written:
>>   But, if it is an export problem, why the following works?
>> BLUE is not exported by (sublib):
>>
>> (library (sublib)
>>   (export h)
>>   (import (rnrs))
>>   (define (blue)
>>     456)
>>   (define h
>>     (make-eq-hashtable))
>>   (hashtable-set! h 'b blue))
>>
>> (library (lib)
>>   (export thing)
>>   (import (rnrs) (for (sublib) expand run))
>>   (define-syntax thing
>>     (lambda (stx)
>>       (syntax-case stx ()
>> 	((_)
>> 	 (with-syntax ((f (hashtable-ref h 'b #f)))
>> 	   #'('f)))))))

This should not work (portably) at all.

You are constructing a syntax object with an embedded procedure object.
That has no portable meaning in R6RS.  Although certain implementations
might allow it for their own inscrutable purposes, it would really be
better for an implementation to raise a syntax error in cases like
these.








More information about the Larceny-users mailing list