Re: A plea for local-eval in 2.0.4

2012-01-14 Thread Mark H Weaver
David Kastrup writes: > Mark H Weaver writes: > >> Indeed, (local-eval '(set! x 5) ) is _not_ equivalent to >> (module-set! (current-module) 'x 5). > > To clarify: I was thinking about > > (local-eval '(set! x 5) ) vs > (local-eval '(module-set! (current-module) 'x 5) ) Unless `module-set!' or

Re: A plea for local-eval in 2.0.4

2012-01-14 Thread David Kastrup
David Kastrup writes: > Mark H Weaver writes: > >> Indeed, (local-eval '(set! x 5) ) is _not_ equivalent to >> (module-set! (current-module) 'x 5). > > To clarify: I was thinking about > > (local-eval '(set! x 5) ) vs > (local-eval '(module-set! (current-module) 'x 5) ) > >> Assuming that `x' is

Re: A plea for local-eval in 2.0.4

2012-01-14 Thread David Kastrup
Mark H Weaver writes: > Indeed, (local-eval '(set! x 5) ) is _not_ equivalent to > (module-set! (current-module) 'x 5). To clarify: I was thinking about (local-eval '(set! x 5) ) vs (local-eval '(module-set! (current-module) 'x 5) ) > Assuming that `x' is not locally bound within the captured

Re: A plea for local-eval in 2.0.4

2012-01-14 Thread Mark H Weaver
> David Kastrup writes: >> within local-eval, what is the return value of calling >> (current-module)? I would expect that it is the same as outside of >> local-eval I wrote: > Actually, this is not true. Within `local-eval', (current-module) is > temporarily restored (using dynamic-wind) to th

Re: A plea for local-eval in 2.0.4

2012-01-14 Thread David Kastrup
Mark H Weaver writes: > David Kastrup writes: >> within local-eval, what is the return value of calling >> (current-module)? I would expect that it is the same as outside of >> local-eval > > Actually, this is not true. Within `local-eval', (current-module) is > temporarily restored (using dyn

Re: A plea for local-eval in 2.0.4

2012-01-14 Thread Mark H Weaver
David Kastrup writes: > within local-eval, what is the return value of calling > (current-module)? I would expect that it is the same as outside of > local-eval Actually, this is not true. Within `local-eval', (current-module) is temporarily restored (using dynamic-wind) to the module saved in

Re: A plea for local-eval in 2.0.4

2012-01-14 Thread Andy Wingo
On Sat 14 Jan 2012 16:16, David Kastrup writes: > Andy Wingo writes: > >> On Sat 14 Jan 2012 09:59, David Kastrup writes: >> >>> so that (define x 5) inside of local-eval would _not_ be equivalent to >>> (module-define! (current-module) 'x 5) as the first one would take the >>> current module a

Re: A plea for local-eval in 2.0.4

2012-01-14 Thread Andy Wingo
Hi Mark, Thanks again for working on local-eval. I didn't like it at first, but you did an admirable job handling all of the semantic, implementation, and social nitty-gritties in order to solve the problem nicely. Excellent! If it is the case that it gets in for 2.0.4, then great. We should tr

Re: A plea for local-eval in 2.0.4

2012-01-14 Thread David Kastrup
Andy Wingo writes: > On Sat 14 Jan 2012 09:59, David Kastrup writes: > >> so that (define x 5) inside of local-eval would _not_ be equivalent to >> (module-define! (current-module) 'x 5) as the first one would take the >> current module at the-environment time, and the second one would take >> i

Re: A plea for local-eval in 2.0.4

2012-01-14 Thread Andy Wingo
On Sat 14 Jan 2012 09:59, David Kastrup writes: > In Guilev1, the module is probably recorded as part of the > procedure-environment. In Guilev2, a variable reference is compiled? > How does that work when there is no such variable? It gets created > with an undefined binding? Guile 2.0.x reco

Re: A plea for local-eval in 2.0.4

2012-01-14 Thread David Kastrup
Mark H Weaver writes: > Probably the easiest way to think about it is that (the-environment) > acts like (list (lambda () ) ...), with one `lambda' for each > expression that you will later pass to `local-eval'. Calling > `local-eval' simply calls the appropriate procedure in that list. Well, I

Re: A plea for local-eval in 2.0.4

2012-01-13 Thread Mark H Weaver
Probably the easiest way to think about it is that (the-environment) acts like (list (lambda () ) ...), with one `lambda' for each expression that you will later pass to `local-eval'. Calling `local-eval' simply calls the appropriate procedure in that list. Of course, it can't actually work that

Re: A plea for local-eval in 2.0.4

2012-01-13 Thread David Kastrup
Mark H Weaver writes: > David Kastrup writes: >> I am still fuzzy on what local-eval will do when the current module at >> the time of the-environment is different from that at the time of >> local-eval. > > (the-environment) saves the module (where it is textually located) in What does "where

Re: A plea for local-eval in 2.0.4

2012-01-13 Thread Mark H Weaver
David Kastrup writes: > I am still fuzzy on what local-eval will do when the current module at > the time of the-environment is different from that at the time of > local-eval. (the-environment) saves the module (where it is textually located) in the lexical environment object. If (the-environme

Re: A plea for local-eval in 2.0.4

2012-01-13 Thread David Kastrup
Mark H Weaver writes: > I'd like to make one last plea to include my simple `local-eval' > implementation in 2.0.4. My hope is that if we can ship it soon enough, > versions of Guile without `local-eval' will be rare enough to enable > Lilypond to eliminate their ugly hacks and simply declare th

Re: A plea for local-eval in 2.0.4

2012-01-12 Thread Bruce Korb
On 01/12/12 13:43, Mark H Weaver wrote: I worked very hard to produce a simple and maintainable implementation of `local-eval' in time for 2.0.4, so that we might rectify this unfortunate Lilypond unhappiness. It would be a shame if that work were wasted. Just for the record, I'm okay with tak