Re: Video on continuations, and call/cc-safe programming in the SRFI
Bradley Lucier 18 Aug 2022 14:50 UTC
On 8/17/22 3:58 PM, Marc Nieper-Wißkirchen wrote:
> ---- External Email: Use caution with attachments, links, or sharing data ----
>
>
> Wouldn't it be enough to say that a "pure" (= "call/cc-safe"
> procedure) is a procedure that behaves as if doesn't mutate any
> location in the store?
>
> The only locations visible by the rest of the program are those
> created outside the "pure" procedure, the locations referenced by the
> procedure's return values, and the locations referenced by the
> arguments and continuation passed to its call-back arguments. So a
> "pure" procedure must not change these locations (or, if it does so,
> must reset them to their old values before control leaves its code).
>
> Just saying that the locations captured by reifying the current
> continuation are not mutated is not enough. On the other hand, the
> above definition includes the captured stack.
>
> Marc
I prefer what I've said in the document, as I don't understand all the
implications of what you've written here.
Brad