Re: hygiene and macro-introduced toplevel bindings

2011-04-04 Thread Hans Aberg
On 9 Mar 2011, at 21:14, Andy Wingo wrote: >> I want a syntax that allows one to explicitly choose which macro-bound >> variables to export, but otherwise, they should never be visible outside >> the macro (i.e., be uninterned). When exported, they will just have the >> name indicated. > > You ha

Re: hygiene and macro-introduced toplevel bindings

2011-04-01 Thread Andy Wingo
Hello list, On Tue 08 Mar 2011 23:37, Andy Wingo writes: > On Mon 28 Feb 2011 22:28, Andy Wingo writes: > >> But you have to, I think. If that module that contained the above >> define-syntactic-accessor expansion exports "foo", then in another >> module you have: >> >> (define bar (lambda (

Re: hygiene and macro-introduced toplevel bindings

2011-03-09 Thread Andy Wingo
On Wed 09 Mar 2011 10:33, Hans Aberg writes: > I want a syntax that allows one to explicitly choose which macro-bound > variables to export, but otherwise, they should never be visible outside > the macro (i.e., be uninterned). When exported, they will just have the > name indicated. You have th

Re: hygiene and macro-introduced toplevel bindings

2011-03-09 Thread Hans Aberg
On 8 Mar 2011, at 23:37, Andy Wingo wrote: > Everyone appears to want gensymmed names. OK! Let's consider this to > be a bug, and that at some point in the future, Guile will start > gensymming this names. I want a syntax that allows one to explicitly choose which macro-bound variables to expo

Re: hygiene and macro-introduced toplevel bindings

2011-03-08 Thread Andy Wingo
On Mon 28 Feb 2011 22:28, Andy Wingo writes: > But you have to, I think. If that module that contained the above > define-syntactic-accessor expansion exports "foo", then in another > module you have: > > (define bar (lambda () (foo))) > > which expands to > > (define bar (lambda () val-2341

Re: hygiene and macro-introduced toplevel bindings

2011-03-08 Thread Andy Wingo
On Mon 28 Feb 2011 22:49, Noah Lavine writes: > val (defined in call to define-syntactic-accessor, file.scm:53) = 5 > val (defined in call to define-syntactic-accessor, file.scm:55) = 7 It's not a bad idea. Our docstring situation for values -- like ints, for example -- is not that good; if we

Re: hygiene and macro-introduced toplevel bindings

2011-02-28 Thread Ludovic Courtès
Hi, Andy Wingo writes: > But you have to, I think. If that module that contained the above > define-syntactic-accessor expansion exports "foo", then in another > module you have: > > (define bar (lambda () (foo))) > > which expands to > > (define bar (lambda () val-234123)) > > Val needs to

Re: hygiene and macro-introduced toplevel bindings

2011-02-28 Thread Noah Lavine
Hello all, I believe what I'm saying is equivalent to what Andreas said, but let me put it in this way: I think the Right Thing to do is to change what we think of as a name - instead of a name being a symbol, a name would be a symbol plus the environment it was defined in (which is what a syntax

Re: hygiene and macro-introduced toplevel bindings

2011-02-28 Thread Andy Wingo
On Mon 28 Feb 2011 01:15, Andreas Rottmann writes: > Andy Wingo writes: > >> (define-accessor get-x set-x! 0) >> > This example serves to illustrate the issue, but I want to make clear > that there are situations where one cannot work around "cleanly" around > this issue Sure, a better exampl

Re: hygiene and macro-introduced toplevel bindings

2011-02-27 Thread Andreas Rottmann
Andy Wingo writes: > Hello all, > > Andreas has been struggling with a nonstandard behavior of Guile's > recently, and we should discuss it more directly. > > The issue is in expressions like this: > > (define-syntax define-accessor > (syntax-rules () > ((_ getter setter init) >

Re: hygiene and macro-introduced toplevel bindings

2011-02-27 Thread Hans Aberg
On 27 Feb 2011, at 22:37, Andy Wingo wrote: > Andreas has been struggling with a nonstandard behavior of Guile's > recently, and we should discuss it more directly. > > The issue is in expressions like this: > > (define-syntax define-accessor >(syntax-rules () > ((_ getter setter init)