guile-devel
[Top][All Lists]
Advanced

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

Re: Replacement for SCM_SETJMPBUF?


From: Rob Browning
Subject: Re: Replacement for SCM_SETJMPBUF?
Date: Fri, 14 Sep 2001 18:28:15 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7

Rob Browning <address@hidden> writes:

>> If guppi and scwm both needed this ability then maybe it's a flaw in
>> Guile that it's not provided.
>
> Could be.  I guess it depends on exactly what semantics they really
> need, and whether or not this is the most appropriate way to provide
> them.  I don't know enough about what guppi needs to do here to say
> for sure yet.

I'm not sure what bits of the current dynamic-root guppi and scwm may
need, but if it helps us determine whether or not we need to provide
additional functionality, here's what the main relevant comment in
guppi says:

/* Use scm_internal_cwdr to establish a new dynamic root - this causes
   all throws to be caught and prevents continuations from exiting the
   dynamic scope of the callback. This is needed to prevent callbacks
   from disrupting guppi's flow control, which would likely cause a
   crash. Use scm_internal_stack_catch to save the stack so we can
   display a backtrace. scm_internal_stack_cwdr is the combination of
   both. Note that the current implementation causes three(!) distinct
   catch-like constructs to be used; this may have negative, perhaps
   even significantly so, performance implications. */

If there's not a better way to handle things, one possibility might be
to augment call-with-dynamic-root to take an optional argument:

  (call-with-dynamic-root . unwind?)

with a default value of #t.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD



reply via email to

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