[ANN] New Version of VI4 (block closures)

Stephen Pair squeak-dev at lists.squeakfoundation.org
Sat Oct 26 04:04:45 UTC 2002


Anthony,

I'm doing the same thing as Avi in Swiki.net (instead of
"continuations", I call them "network dialogs").  While it may be
possible to work around the limitation of only copying a suspended
process, it would be preferable to be able to copy a running process.  I
have a method called ContextPart>>cloneForBranch (which just makes a
copy of the context stack) and a method Process>>cloneForBranch (which
just copies the stack and makes a process around it).  I also have a
ContextPart>>activeCloneForBranch which calls #cloneForBranch, and does
a little stack fixup that's needed when you happen to be cloning the
active stack.

As it turns out, every use of this code in Swiki.net is cloning the
active stack.  That's because the code is there to deal with people
using the web browser's back button while still be able to write code
like:

  1. do something
  2. get some user input
  3. do some more stuff
  4. get some more user input 
  5. do yet more stuff

At step 2 I copy the active stack so that if the user uses the browser's
back button, we just forget the process that has proceeded on to step 4,
and create and schedule a new process on the stack that was saved at
step 2 (note: I also clone the Kats transaction that the process is
using so that I can throw away any changes to objects that were made in
step 3).

You really only need to be able to copy the stack (FiniteStack) and
create a process on it.  Reading your VI4 paper, can the stack
externalization mechanism be made available as a primitive to
externalize the active stack?

- Stephen

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org 
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
> Behalf Of Anthony Hannan
> Sent: Friday, October 25, 2002 1:25 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: RE: [ANN] New Version of VI4 (block closures)
> 
> 
> Hello fellow Squeakers,
> 
> I put up a new version of VI4 at 
> http://minnow.cc.gatech.edu/squeak/VI4,
> which allows 
> Processes to be copied safely (send #copy to a suspended 
> process).  This is needed for continuations.  However, I 
> haven't added a continuation protocol since I'm not sure what 
> it should look like.  John, thanks for building the Mac VM; 
> can you please build another one using the latest changes?  
> You can upload it directly to the VI4 swiki page (the swiki 
> upload username and password is 'squeak' and 'viewpoints').  
> I would greatly appreciate it if others could build and 
> upload VMs for other platforms, particularly Linux.
> 
> Cheers,
> Anthony
> 
> P.S.  Thanks for the kudos from many of you.  It was a lot of 
> work but I believe it is worth it.
> 
> 




More information about the Squeak-dev mailing list