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

Marco Maggi marco.maggi-ipsu at poste.it
Tue Oct 6 17:12:26 EDT 2009


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)))))))
> 
> ;;; the program
> (import (rnrs) (lib))
> (write (thing))

Okay,  that  is  a  stupid  example...  Anyway,  why  is  it
different from:

> (library (sublib)
>   (export h)
>   (import (rnrs))
>   (define (blue)
>     456)
>   (define h
>     (make-eq-hashtable))
>   (hashtable-set! h 'b (syntax 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)))))))
> 
> ;;; the program
> (import (rnrs) (lib))
> (write (thing))

? Creating a  syntax object is done exactly  to maintain the
lexical context informations, no?
-- 
Marco Maggi



More information about the Larceny-users mailing list