[gambit-list] file local defines

Marc Feeley feeley at iro.umontreal.ca
Fri Jun 26 19:40:33 EDT 2009


On 26-Jun-09, at 7:35 PM, lowly coder wrote:

> ; foo.scm
>
> (magical-define x 100)
>
> ; bar.scm
>
> (define y (+ x 10)) ;
>
> ; all.scm
>
> (load "foo")
> (load "bar") ; <-- I want this here to be a syntax error
>
> Is there a way I make defines/variables _local_ to a single *.scm  
> file? I promise to not 'include it, and only 'load it. In essence,  
> I'm looking for the equiv of static vars in C. What I don't want to  
> do is something like:
>
> ;foo .scm
> (lambda ()
>   ... all of foo.scm
> )
>
> ; ... since there are other parts of foo.scm that I do want to be  
> visible.
>
> Yes, I do realize that what I'm asking for sounds like the basics of  
> a module system.
>
> Thanks!
> ______________


; foo.scm

(namespace ("foo#" x))
(define x 100)

Marc




More information about the Gambit-list mailing list