This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How often are continuations created?


Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:

> But this has nothing to do with `letrec'.  Notice that you could
> replace `letrec' with `let' and get the same result.

Yes.

> The problem here is `set!'.  Keisuke was asking for further problems,
> and `letrec' shouldn't be one.

I was just pointing out there are hidden set!s in letrec.

I agree with your statement "But in any correct implementation of
letrec, it is still OK to keep the bindings on the stack" as long as
we add "as long as there is no explicit set! to the bindings."

At least, I think so.  I.e. because the letrec initializers are evaluated
in unspecified order, no correct (portable) program can care if the
letrec bindings are kept on the stack (as long as there is no explicit set!).

I actually think it would have been more useful if internal defines had been
specified to evaluate in program order, rather than by a re-write to letrec.
If you follow that (non-portable) model, then you would have to handle
internal defines just like set!.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]