Does continuation marks take a snapshot? Shiro Kawai (15 Oct 2022 11:25 UTC)
Re: Does continuation marks take a snapshot? Marc Nieper-Wißkirchen (15 Oct 2022 22:22 UTC)
Re: Does continuation marks take a snapshot? Shiro Kawai (15 Oct 2022 23:26 UTC)
Re: Does continuation marks take a snapshot? Marc Nieper-Wißkirchen (16 Oct 2022 08:41 UTC)
Re: Does continuation marks take a snapshot? Shiro Kawai (16 Oct 2022 10:35 UTC)
Re: Does continuation marks take a snapshot? Marc Nieper-Wißkirchen (17 Oct 2022 05:59 UTC)
Re: Does continuation marks take a snapshot? Shiro Kawai (19 Oct 2022 07:02 UTC)
Re: Does continuation marks take a snapshot? Shiro Kawai (28 Oct 2022 17:14 UTC)
Re: Does continuation marks take a snapshot? Marc Nieper-Wißkirchen (28 Oct 2022 17:47 UTC)

Re: Does continuation marks take a snapshot? Marc Nieper-Wißkirchen 16 Oct 2022 08:41 UTC

Am So., 16. Okt. 2022 um 01:26 Uhr schrieb Shiro Kawai <xxxxxx@gmail.com>:
>
> Hmm, I'm modeling continuation marks as a slot in each continuation frame holding key-value pairs.  But that requires mutation of continuation frames when a new mark is pushed.  It seemed a bad idea now, but is there a spec that prohibits such a model?
>
> The reason I put the example is that the continuation frames CONT captured and the continuation frames of the continuation of (with-continuation-marks ...) are the same (shared), so if the marks are a part of a continuation frame, I thought attaching new marks to one would affect the other.   It is more like that a list of marks is a part of dynamic environment and call/cc captures it with a list of continuation frames, but there's no direct link between the activation records and continuation marks?

The sample implementation does it by not gluing the last activation
record and the last set of marks to a continuation frame. This only
happens, conceptually, for older frames.

In the example below, CONT conceptually contains the latest frame
without the continuation mark attached. Inside the evaluation of
`with-continuation-marks`, the current continuation has changed,
namely its latest frame has been replaced by one with a mark attached.

>
>
>
> On Sat, Oct 15, 2022 at 12:22 PM Marc Nieper-Wißkirchen <xxxxxx@gmail.com> wrote:
>>
>> Am Sa., 15. Okt. 2022 um 13:25 Uhr schrieb Shiro Kawai <xxxxxx@gmail.com>:
>> >
>> > Just to be sure.  In the following code, the returned mark set contains the key-value pair {key, mark1} but not {key, mark2}, correct?
>>
>> Continuation marks are attached without mutation like when you cons to a list.
>>
>> In the example below, CONT captured by call/cc does not include any of
>> the marks set by the code so the returned mark set neither contains
>> any key-value pair of the two.
>>
>> >
>> > ===
>> > (let ((marks #f))
>> >   (call/cc
>> >    (lambda (cont)
>> >      (with-continuation-marks 'key 'mark1
>> >        (begin
>> >          (set! marks (continuation-marks cont))
>> >          (with-continuation-marks 'key 'mark2 #f)))))
>> >   marks)
>> > ===
>> >
>> >