This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: call-with-dynamic-root and fluids
Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:
>
> So my suggestion is:
>
> Remove `call-with-dynamic-root' from the Scheme interface, but keep it
> in the C API.
Perhaps in some situations Scheme code also has good reasons to not
let continuations jump into or out of a particular piece of code.
> The current dynamic roots *have* their own wind chain. What do you
> mean by "walk up and down"? What currently happens is that since
> they have a dynwind chain of their own, call-with-dynamic-root
> begins by winding itself out of the caller's dynamic context, in
> order to be able to start a new chain.
This causes strange an unexpected behavior in some cases though. If
you call-with-dynamic-root inside a dynamic-wind, your winders get
unwound even though you haven't really left the dynamic-wind's dynamic
extent. Dynamic roots should have a concept of being the child of
another root perhaps. But then they aren't really dynamic roots.
I guess what users really want is not `call-with-dynamic-root', but
`call-blocking-continuations' or something like that.
>
> Yes, I'd like dynamic roots to be only that: making a computation
> return once and preventing anyone outside to call its continuations.
>
> But this also means that dynamic roots *don't* have a wind chain of
> their own (they really don't need it actually) and that fluids are per
> thread, not per root.
I agree that fluids should have a value per-thread and not
per-dynamic-root.
> I think we should make threads as light as we can. If a computation
> needs a new set of fluid values, it can surround itself with a
> suitable fluid-let.
Is fluid-let in the classical Scheme/Lisp sense implementable on top
of Guile's fluids?
- Maciej