Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread Andy Wingo
On Wed 14 Dec 2011 08:50, Mark H Weaver m...@netris.org writes: I have successfully implemented the (capture-lexical-environment) special form in the evaluator, and also primitive-local-eval. I dunno, Mark. That's a neat hack, but why should we have it in Guile? It can't compile. It's not

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Wed 14 Dec 2011 00:45, David Kastrup d...@gnu.org writes: Andy Wingo wi...@pobox.com writes: On Wed 14 Dec 2011 00:00, Noah Lavine noah.b.lav...@gmail.com writes: I haven't really been contributing to this thread, so please take my opinion with a

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Wed 14 Dec 2011 08:50, Mark H Weaver m...@netris.org writes: I have successfully implemented the (capture-lexical-environment) special form in the evaluator, and also primitive-local-eval. I dunno, Mark. That's a neat hack, but why should we have it in

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread Mark H Weaver
Andy Wingo wi...@pobox.com writes: On Wed 14 Dec 2011 08:50, Mark H Weaver m...@netris.org writes: I have successfully implemented the (capture-lexical-environment) special form in the evaluator, and also primitive-local-eval. I dunno, Mark. That's a neat hack, but why should we have it in

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
Mark H Weaver m...@netris.org writes: Also, I think that it is crucially important to keep the Lilypond developers happy with Guile. We don't have very many users. We should make an effort to keep our existing users happy. Basically, you want to be able to write the following in the FAQ:

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread Noah Lavine
Perhaps this is obvious to everyone else, but it just occurred to me that (capture-local-environment) is just (call-with-current-continuation), but running in the environment of the evaluator instead of the program being evaluated. It's as though the evaluator was going to look in a tree for more

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread Andy Wingo
Hi David, On Wed 14 Dec 2011 11:27, David Kastrup d...@gnu.org writes: Andy Wingo wi...@pobox.com writes: On Wed 14 Dec 2011 08:50, Mark H Weaver m...@netris.org writes: I have successfully implemented the (capture-lexical-environment) special form in the evaluator, and also

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread Ludovic Courtès
Hello! Andy Wingo wi...@pobox.com skribis: But, in the event that David wants to continue with his current strategy, there are other things that can be done. David, did you know that Guile's evaluator is implemented in Scheme? That means that if you want an evaluator with different

Re: SRFI 41 for Guile

2011-12-14 Thread Ludovic Courtès
Hello! Chris K. Jester-Young cky...@gmail.com skribis: Just writing to say that after many months of being busy with other stuff, I finally got around to finishing my Guile port of SRFI 41: https://github.com/cky/guile2-modules Nice, thank you! Could you integrate it in the Guile tree in a

Re: extensibility, compatible changes, and ocap security

2011-12-14 Thread Ludovic Courtès
Hello! Andy Wingo wi...@pobox.com skribis: However, this effectively gives another /capability/ to anyone that has access to the previously idempotent `current-input-port' procedure: namely, the ability to change the current input port. The question is, can we make this change in the

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread Mark H Weaver
Andy Wingo wi...@pobox.com writes: On Wed 14 Dec 2011 08:50, Mark H Weaver m...@netris.org writes: I have successfully implemented the (capture-lexical-environment) special form in the evaluator, and also primitive-local-eval. Let's call it `(the-environment)', as it is what it was called in

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
Mark H Weaver m...@netris.org writes: Personally, I don't view `the-environment' and `local-eval' as an ugly hack, but rather as a cool feature like delimited continuations. It's something Guile 1.8 could brag about. I wish it had bragged about it at all (in the case of the-environment) or

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
Mark H Weaver m...@netris.org writes: Replying to myself: Andy Wingo wi...@pobox.com writes: It is my opinion -- and I could be wrong here, either by misunderstanding (again!) the issues, or for whatever reason -- that closures are the best solution to the #{#} problem. I would love to

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
David Kastrup d...@gnu.org writes: To be fair: this is what we currently do, and we only actually call those lambdas that end up actually being recognized by the grammar. So as long as (primitive-eval `(lambda () ,(read))) is guaranteed to not ever choke, the potential for error is limited.

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread Mark H Weaver
Hi Noah, Noah Lavine noah.b.lav...@gmail.com writes: Perhaps this is obvious to everyone else, but it just occurred to me that (capture-local-environment) is just (call-with-current-continuation), but running in the environment of the evaluator instead of the program being evaluated. It's as

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
David Kastrup d...@gnu.org writes: (define (my-eval form env) (call-with-current-continuation (lambda (x) (env (list x form) (define-macro (my-env) (call-with-current-continuation identity)) (format #t ~a (my-eval '(+ x 3) (let ((x 4)) (my-env Mark H

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread Andy Wingo
On Wed 14 Dec 2011 22:03, Mark H Weaver m...@netris.org writes: Noah Lavine noah.b.lav...@gmail.com writes: [(the-environment)] is just (call-with-current-continuation), In fact it makes me wonder whether `the-environment' and `local-eval' could actually be implemented this way. This

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread Andy Wingo
On Wed 14 Dec 2011 18:26, Mark H Weaver m...@netris.org writes: Andy Wingo wi...@pobox.com writes: It is my opinion -- and I could be wrong here, either by misunderstanding (again!) the issues, or for whatever reason -- that closures are the best solution to the #{#} problem. I would love