guile-devel
[Top][All Lists]
Advanced

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

Re: Replacement for SCM_SETJMPBUF?


From: Gary Houston
Subject: Re: Replacement for SCM_SETJMPBUF?
Date: 15 Sep 2001 14:01:14 -0000

> From: Rob Browning <address@hidden>
> Date: Fri, 14 Sep 2001 20:10:37 -0500
> 
> Gary Houston <address@hidden> writes:
> 
> > static long guppi_seq = 100000;
> 
> [...]
> 
> >       contregs->dynenv = SCM_EOL;
> >       contregs->base = stack_start;
> >       contregs->seq = ++guppi_seq;
> >       contregs->throw_value = SCM_BOOL_F;
> 
> I understand everything you did except adding the guppi_seq.  Is there
> any documentation regarding the semantics of seq?  I can see from
> continuations.h it's the dynamic-root identifier, but is there any
> significance to the choice of 100000, or are you just picking
> something that's unlikely to ever clash with normal dynamic roots?

When a continuation is captured it stores the seq of the current dynamic
root.  When the continuation is applied it's an error if the stored seq
doesn't equal the seq of the current dynamic root.  This is how the
continuation-blocking property of call-with-dynamic-root is implemented.

The choice of 100000 is arbitrary.  I guess it would be possible for a
program to reach this number if a new dynamic root was generated for
every callback.



reply via email to

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