guile-user
[Top][All Lists]
Advanced

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

Re: loop translations (was: Re: language translator help)


From: John W. Eaton
Subject: Re: loop translations (was: Re: language translator help)
Date: Sun, 28 Apr 2002 09:29:53 -0500

On 28-Apr-2002, Marius Vollmer <address@hidden> wrote:

| "John W. Eaton" <address@hidden> writes:
|
| Your approach is essentially right.  Let me try to formalize it a bit
| with some macros:

Thanks.  With the macros, the loops are much more readable to me, but
there is still the (apparent, at least to a Scheme novice) complexity
of call/cc.

| The functions created by '(let loop ...)' are totally ordinary functions
| and calling them in a non-tail context will 'push stack' and they will
| eventually return to the caller.

OK, I thought that might be the case.  But I didn't see the way to use
call/cc to jump to the end of the loop and keep going.

| The problem with the macros above is that they are not hygienic,

Sorry, I'm not sure I understand what that means.

| avoiding call/cc is not so easy and is hopefully
| not really necessary.  One could generate continuation-passing code
| and hope that Guile will execute it more efficiently than the
| occasional call/cc,

What is continuation passing?

| or one could implement a cheaper version of
| call/cc that is not as powerful but is sufficient for 'with-exit'.  I
| think we should do the latter, if performance of call/cc turns out to
| be too bad.

It's important to me that looping not be any slower than it already is
in Octave.  It might be possible to scan loops for break/continue
statements and generate simpler loops when they are not present, but
I'd really rather avoid that if possible.  It would be much better if
break and continue statements did not generate a large performance
penalty.

jwe



reply via email to

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