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? On Sat, Oct 15, 2022 at 12:22 PM Marc Nieper-Wißkirchen < marc.nie...@gmail.com> wrote: > Am Sa., 15. Okt. 2022 um 13:25 Uhr schrieb Shiro Kawai < > shiro.ka...@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) > > === > > > > >