<div dir="ltr">Ah right, and also, the Scheme stack being an extensible array allocated contiguously - does the Gambit code have logics that clean it up as you go along, or is all that done by the JS GC too?<div><br></div>

<div>By extensible, do you mean variable-size through use of JS' .push() / .pop() , or something else?<br><div><br></div><div>Best regards, Mikael</div><div><br></div><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

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.<br>



<br>
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.<br>


</blockquote><div><br></div></div></div><div>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?</div><div><br></div><div>

E.g.</div><div>
<br></div><div>var frame1 = [value, value ...... ];</div><div><br></div><div>var frame2 [value, ........ frame1, ...];</div><div><br></div><div>?</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<span><font color="#888888"><br>
Marc<br>
<br>
</font></span></blockquote></div><br></div></div>
</blockquote></div><br></div></div></div>