[racket] A primitive more fundamental than a continuation?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sun Dec 2 12:43:00 EST 2012

On Dec 2, 2012, at 1:42 AM, Galler wrote:

> Racket also provides operations for inspecting continuations, for example
> (continuation-marks k) returns the set of marks associated with k. (see Ref.
> s9.5).


Those are somewhat orthogonal to the opaqueness of continuations but
yes, I wrote "Imagine we lied." 


> Is the answer  'Racket can't provide mutable continuations b/c continuations
> are implemented like procedures'

You are confusing mutation with synthesizing new kinds of continuations. 
I carefully wrote 

 set-frame : Continuation Nat Any -> Continuation

This is functional but yes, one could also imagine an imperative version. 
No matter what it would demand a change in the set of operations on 
continuations (and possibly their representation). 


> And, to be clear, I don't have a single reason for why it should provide
> mutable continuations.

As mentioned, I know only one such use. 

> On Dec 2, 2012, at 5:18 AM, Jan Burse wrote:
> 
>> Galler schrieb:
>>> 'Racket could implement mutable continuations, but has not'
>> 
>> I was just thinking whether mutable continuations can
>> be used for some JIT-ing.

Sure this would affect compilation strategies but no worse 
than using eval. 

-- Matthias



Posted on the users mailing list.