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 #<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 statement. > (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! Andy -- http://wingolog.org/