[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shift and reset, plus "while"

From: Andy Wingo
Subject: Re: shift and reset, plus "while"
Date: Wed, 13 Apr 2011 11:47:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

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 <address@hidden> writes:

> | GNU Guile 2.0.0
> | scheme@(guile-user)> (display (while #f 1))
> | <unnamed port>:0:0: In procedure #<procedure 887aa60 at <current input>:1:0 
> ()>:
> | <unnamed port>:0:0: Throw to key `vm-error' with args `(vm-run "VM: Stack 
> overflow" ())'.

This is the same compiler bug as before, which is fixed in stable-2.0.
We'll push out a release Real Soon Now (TM).

> 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

> (b) to allow for (break arg ...)

Also a good idea.

Tricky, though; your comments indicate that you would want (break) to
return #t, instead of zero values.

> (c) to only take a single (call-with-prompt)

Why?  It's true that the optimizer doesn't live up to its name yet, but
it should be trivial to elide one or the other if the prompt tag is only
referenced by the <prompt> form.

> (d) to correct a buglet that currently transforms the non-operator `continue'
>     into a function of arbitrarily many (as opposed to zero)
>     arguments.

I have not seen this bug.  Do you have code that can reproduce it with
stable-2.0 ?

> Just a hint: (GPLed) CLISP's compiler is written in LISP and in my
> experience perfectly succeeds at removing all redundant
> branches. Maybe something to look at?

No doubt, it would be instructive!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]