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

2011-12-14 Thread David Kastrup
Mark H Weaver writes: > Andy Wingo writes: >> On Wed 14 Dec 2011 00:00, Noah Lavine writes: >>> I haven't really been contributing to this thread, so please take my >>> opinion with a grain of salt. But it does appear to me that we should >>> support capturing a lexical environment, as Mark and

[PATCH] Implement `capture-lexical-environment' in evaluator

2011-12-14 Thread Mark H Weaver
This is a _preliminary_ patch. In particular: * The compiler does not yet handle (capture-lexical-environment) (which uses a new tree-il type). * The lexical environment object is currently non-opaque list structure. * I deliberately avoided reindenting eval.scm so that the non-whitespace c

Re: [PATCH] Implement `capture-lexical-environment' in evaluator

2011-12-14 Thread David Kastrup
Mark H Weaver writes: > This is a _preliminary_ patch. In particular: > > * The compiler does not yet handle (capture-lexical-environment) > (which uses a new tree-il type). > > * The lexical environment object is currently non-opaque list structure. > > * I deliberately avoided reindenting ev

Re: [PATCH] Implement `capture-lexical-environment' in evaluator

2011-12-14 Thread Mark H Weaver
Another note: I realize that I shouldn't use `expand-top-sequence' to restart the expander within a local lexical environment. At first glance, I guess I should be using `expand' instead. Another possibility: if the (capture-lexical-environment) was found within a body or sequence where local def

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 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 for efficiency,

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

2011-12-14 Thread Andy Wingo
On Wed 14 Dec 2011 00:45, David Kastrup writes: > Andy Wingo writes: > >> On Wed 14 Dec 2011 00:00, Noah Lavine writes: >> >>> I haven't really been contributing to this thread, so please take my >>> opinion with a grain of salt. But it does appear to me that we should >>> support capturing a l

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

2011-12-14 Thread David Kastrup
Andy Wingo writes: > On Wed 14 Dec 2011 00:45, David Kastrup writes: > >> Andy Wingo writes: >> >>> On Wed 14 Dec 2011 00:00, Noah Lavine writes: >>> I haven't really been contributing to this thread, so please take my opinion with a grain of salt. But it does appear to me that we sh

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

2011-12-14 Thread David Kastrup
Andy Wingo writes: > On Wed 14 Dec 2011 08:50, Mark H Weaver 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 comp

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

2011-12-14 Thread Mark H Weaver
Andy Wingo writes: > On Wed 14 Dec 2011 08:50, Mark H Weaver 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 compi

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

2011-12-14 Thread David Kastrup
Mark H Weaver 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: Q: Why should

Re: guildhall update complain connection timeout

2011-12-14 Thread Nala Ginrut
On Tue, Dec 6, 2011 at 6:54 PM, Andy Wingo wrote: > Hello Nala :) > > > Did you find an answer here? > > We will need to change our assumptions if there are no ISO-8859-1 > converters on a fresh Chinese Ubuntu install. > > I confess I can not point what's the real issue for this problem since the

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 c

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 writes: > Andy Wingo writes: > >> On Wed 14 Dec 2011 08:50, Mark H Weaver writes: >> >>> I have successfully implemented the (capture-lexical-environment) >>> special form in the evaluator, and also primitive-local-eval. Let's call it `(the-en

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

2011-12-14 Thread Ludovic Courtès
Hello! Andy Wingo 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 semantics -- for ex

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

2011-12-14 Thread David Kastrup
l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo 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 evalu

Re: SRFI 41 for Guile

2011-12-14 Thread Ludovic Courtès
Hello! "Chris K. Jester-Young" 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 branch, as

Re: extensibility, compatible changes, and ocap security

2011-12-14 Thread Ludovic Courtès
Hello! Andy Wingo 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 default Guile? Th

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

2011-12-14 Thread David Kastrup
Andy Wingo 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. > > Reasons: > > * Lambda is standard, well-understood, and general. Well, if they are stan

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

2011-12-14 Thread Andy Wingo
On Wed 14 Dec 2011 16:21, David Kastrup writes: > Andy Wingo 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. >> >> Reasons: >> >> * Lambda is sta

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

2011-12-14 Thread Mark H Weaver
Andy Wingo writes: >>> On Wed 14 Dec 2011 08:50, Mark H Weaver 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 Guile > 1.8. Ah,

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

2011-12-14 Thread David Kastrup
Mark H Weaver 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 more coherentl

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

2011-12-14 Thread Mark H Weaver
Replying to myself: > Andy Wingo 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 use closures for this, but they simply are not po

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

2011-12-14 Thread David Kastrup
Mark H Weaver writes: > Replying to myself: > >> Andy Wingo 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 use closures for

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

2011-12-14 Thread David Kastrup
David Kastrup 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. Come to t

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

2011-12-14 Thread Mark H Weaver
Hi Noah, Noah Lavine 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 though > the evaluat

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

2011-12-14 Thread Ludovic Courtès
David Kastrup skribis: > l...@gnu.org (Ludovic Courtès) writes: > >> Andy Wingo 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 m

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

2011-12-14 Thread David Kastrup
Mark H Weaver writes: > Hi Noah, > > Noah Lavine 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 evalua

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

2011-12-14 Thread David Kastrup
David Kastrup 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 We

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 writes: > Noah Lavine 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 prevents the evaluator from running an a

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 writes: > Andy Wingo 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 use closures for thi

Re: Accessing the environment's locale encoding settings

2011-12-14 Thread Ludovic Courtès
Hi, Since adding an implicit setlocale(LC_ALL, "") cannot be done in Guile 2.0 (it would change the default port encoding as a side effect, etc.), I committed something similar to the hack proposed in [0]. Bruno Haible skribis: > If I were you, I would start using the gnulib-tool option --local