Re: [PATCH] Fix the R6RS exact-integer-sqrt and import into core guile

2011-04-13 Thread Detlev Zundel
Hi Noah, You make good points, but I disagree. I think the ideal for Guile should be a situation where C and Scheme can be used basically interchangeably, with Guile providing the glue in between. Of course one can disagree, but then it immediately follows that there is no ideal for guile

Difference letrec environment binding

2011-04-13 Thread Hans Aberg
What is the practical difference between the two ways of doing the same thing (letrec or an environment). Is letrec more efficient in the implementation of Guile? Hans (letrec ( (even? (lambda (n) (if (zero? n) #t (odd? (- n 1) (odd? (lambda (n) (if (zero? n) #f (even? (- n

Re: Difference letrec environment binding

2011-04-13 Thread dsmich
Hans Aberg haber...@telia.com wrote: What is the practical difference between the two ways of doing the same thing (letrec or an environment). Is letrec more efficient in the implementation of Guile? Hans (letrec ( (even? (lambda (n) (if (zero? n) #t (odd? (- n 1)

Re: shift and reset, plus while

2011-04-13 Thread Andy Wingo
Hi Wolfgang, Another in a series of asynchronous replies :) Copying guile-devel for comments on the extensions to `while'. On Mon 04 Apr 2011 15:05, Wolfgang J Moeller w...@heenes.com writes: | GNU Guile 2.0.0 | scheme@(guile-user) (display (while #f 1)) | unnamed port:0:0: In procedure

Re: [PATCH] Fix the R6RS exact-integer-sqrt and import into core guile

2011-04-13 Thread Andy Wingo
On Wed 13 Apr 2011 10:59, Detlev Zundel d...@denx.de writes: But in the end maybe it is a question of whether one sees guile as a scheme interpreter with the possibility to interface easily with C or if one thinks of guile as a C library with a language built in. For me it is the first

Avoiding variable clashes

2011-04-13 Thread Hans Aberg
What method is Guile using to avoid substitution variable clashes (de Bruijn numbers, combinators, etc.)? Hans

A Modest Proposal

2011-04-13 Thread Noah Lavine
Hello Guile and Clisp developers, I'm writing to talk about vague big-picture ideas, but please bear with me for a minute, because I think this could be useful. I noticed in the recent GNU Summer of Code applications (I'm a mentor for Guile) that CLisp wants to become embeddable, and embed into

Re: Avoiding variable clashes

2011-04-13 Thread Hans Aberg
On 13 Apr 2011, at 16:19, Andy Wingo wrote: What method is Guile using to avoid substitution variable clashes (de Bruijn numbers, combinators, etc.)? Each lexical variable is given a fresh name (a gensym) when it is introduced. The expander keeps an environment as to what name maps to

Re: [shift and reset, plus] while

2011-04-13 Thread Wolfgang J Moeller
On Wed, 13 Apr 2011, Andy Wingo wrote: [...] I'd like to improve (while) as currently provided by ice-9/boot.scm (a) to always have a well-defined result This is a good idea; it allows `while' to be an expression, not just a statement. (b) to allow for (break arg ...) Also a good

Re: Avoiding variable clashes

2011-04-13 Thread Andy Wingo
On Wed 13 Apr 2011 16:34, Hans Aberg haber...@telia.com writes: On 13 Apr 2011, at 16:19, Andy Wingo wrote: What method is Guile using to avoid substitution variable clashes (de Bruijn numbers, combinators, etc.)? Each lexical variable is given a fresh name (a gensym) when it is

Re: [PATCH] Fix the R6RS exact-integer-sqrt and import into core guile

2011-04-13 Thread Mark H Weaver
Hi Detlev, Detlev Zundel d...@denx.de writes: Maybe it doesn't make sense to continue this discussion on a theoretical basis. Because on a theoretical basis I would probably cite the rule of modularity or even Antoine de Saint-Exupery: Perfection (in design) is achieved not when there is

Re: [shift and reset, plus] while

2011-04-13 Thread Andy Wingo
On Wed 13 Apr 2011 16:56, Wolfgang J Moeller w...@heenes.com writes: On Wed, 13 Apr 2011, Andy Wingo wrote: [...] I'd like to improve (while) as currently provided by ice-9/boot.scm (a) to always have a well-defined result This is a good idea; it allows `while' to be an expression, not

Re: Avoiding variable clashes

2011-04-13 Thread Hans Aberg
On 13 Apr 2011, at 17:27, Andy Wingo wrote: What method is Guile using to avoid substitution variable clashes (de Bruijn numbers, combinators, etc.)? Each lexical variable is given a fresh name (a gensym) when it is introduced. The expander keeps an environment as to what name maps to

Re: [PATCH] Fix the R6RS exact-integer-sqrt and import into core guile

2011-04-13 Thread Detlev Zundel
Hi Mark, Since you don't want to continue this discussion on a theoretical basis, can you please provide a concrete example of how the addition of scm_exact_integer_sqrt might be a maintenance burden in the future, given that our public C interface already consists of approximately 2K

Re: after-gc-hook recently broken for bdwgc 7.2alpha CVS

2011-04-13 Thread Ludovic Courtès
Hi Mark, Mark H Weaver m...@netris.org writes: Sometime between 2.0.0 and current stable-2.0, after-gc-hook has been broken on my system: FAIL: gc.test: gc: after-gc-hook gets called. FWIW Hydra has had this problem in the GCC 3.x build job: http://hydra.nixos.org/build/1043456 It first

Re: Avoiding variable clashes

2011-04-13 Thread Noah Lavine
I think that mechanism is all that Guile uses at present. However, it should be general enough to resolve all situations where variables of the same name refer to different entities, assuming you set up the environments correctly. Are you planning on implementing a theorem prover for Guile? That

Re: Avoiding variable clashes

2011-04-13 Thread Hans Aberg
On 13 Apr 2011, at 18:25, Noah Lavine wrote: I think that mechanism is all that Guile uses at present. However, it should be general enough to resolve all situations where variables of the same name refer to different entities, assuming you set up the environments correctly. Are you

Re: Avoiding variable clashes

2011-04-13 Thread Hans Aberg
On 13 Apr 2011, at 18:25, Andy Wingo wrote: Sorry, I don't know what you mean. References? There is an article here: http://en.wikipedia.org/wiki/Variable_binding_operator I still don't understand. What are you trying to do? The beta rule is in denotational semantics something like

Re: Trouble joining with threads from C

2011-04-13 Thread Ludovic Courtès
l...@gnu.org (Ludovic Courtès) writes: Hi! Howdy! Andy Wingo wi...@pobox.com writes: No, the issue is elsewhere, that the thread-exit handlers were not being called I just tried with 60582b7c2a495957012f9a20cd8691dc6307a850 and ‘on_thread_exit’ /is/ called after something like

Re: Trouble joining with threads from C

2011-04-13 Thread Ludovic Courtès
Hello, l...@gnu.org (Ludovic Courtès) writes: l...@gnu.org (Ludovic Courtès) writes: Andy Wingo wi...@pobox.com writes: No, the issue is elsewhere, that the thread-exit handlers were not being called I just tried with 60582b7c2a495957012f9a20cd8691dc6307a850 and ‘on_thread_exit’ /is/

Re: A Modest Proposal

2011-04-13 Thread Pascal J. Bourguignon
Noah Lavine noah.b.lav...@gmail.com writes: Hello Guile and Clisp developers, I'm writing to talk about vague big-picture ideas, but please bear with me for a minute, because I think this could be useful. I noticed in the recent GNU Summer of Code applications (I'm a mentor for Guile) that

Re: A Modest Proposal

2011-04-13 Thread Noah Lavine
Hello, I think we should first compare the virtual machines. If no obvious impossibility is observed, then perhaps modifying the compiler of clisp to generate guile VM code would be an easy path to obtain a CL implementation running on guile VM.  (This would disable the interpreter in