guile-user
[Top][All Lists]
Advanced

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

Re: problem becouse scm_tc7_contin is not defined


From: Marius Vollmer
Subject: Re: problem becouse scm_tc7_contin is not defined
Date: 09 Sep 2002 20:43:12 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

P Pareit <address@hidden> writes:

> By doing a grep on scm_tc7_contin in the source tree of guile I
> found out that scm_tc7_contin is no longer supported and I have to
> use SMOB continuation for rootcont instead.

Scwm is digging into the innards of Guile, and we don't really support
code like scm_internal_cwdr_no_unwind.  Scm_internal_cwdr_no_unwind is
essentially a copy of Guile's scm_internal_cwdr with some bits
removed.  There is a reason why it is called scm_*internal*_cwdr. ;-)

However, scwm has probably a real need for
scm_internal_cwdr_no_unwind, and we do want to support something like
it officially in the future so that scwm does not need to provide its
own hack.

You might consider fixing scwm's hack like this

  SCM
  scm_internal_cwdr_no_unwind (scm_catch_body_t body, void *body_data,
                               scm_catch_handler_t handler, void *handler_data,
                               SCM_STACKITEM *stack_start)
  {
    SCM answer, old_winds;
    old_winds = scm_dynwinds;
    scm_dynwinds = SCM_EOL;

    answer = scm_internal_cwdr (body, body_data, handler, handler_data,
                                stack_stack);

    scm_dynwinds = old_winds;
    return answer;
  }

This will _only_ work when HANDLER does not do a non-local exit (via
longjmp, or similar).  If you want to support that (which I
recommend), you need to defer running HANDLER (with the same trick
that scm_internal_cwdr uses) until scm_dynwinds has been restored.

The above code should be more resilient against changes to the
internals of Guile, but it is still a hack.  We have a proposal to fix
this for real.  See workbook/extension/dynamic-roots.text in CVS.

You might also try to just scm_internal_cwdr instead of
scm_internal_cwdr_no_unwind.  That should work as well, but at a
slight performance loss.

Could you bring this up with the scwm developers so that we might find
a solution that makes everyone happy?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405




reply via email to

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