Scheme objects are mapped to JS objects. So a pair is an instance of the “class” Gambit_Pair, and a vector is an instance of the class Gambit_Vector. Scheme closures are JS closures. A Scheme continuation is a chain of frames (each frame is a JS array). So everything is garbage collectible by the JS GC.
There is a bit of fanciness in how the continuations are created. The Scheme stack is an extensible array and stack frames are allocated in this array contiguously. When a continuation is captured the stack is emptied and each frame becomes an independent JS array.
Aha. And then, when one stack frame (JS array) refers to another stack frame (JS array), then this is done by the means of an actual object reference?E.g.var frame1 = [value, value ...... ];var frame2 [value, ........ frame1, ...];?
Marc