BC + call/cc

Anthony Hannan ajh18 at cornell.edu
Sun Oct 27 11:01:27 UTC 2002


Avi Bryant <avi at beta4.com> wrote:
> Still tring to implement #callCC in the block closure image.  I get a DNU
> #trimBottomTo: in Process2>>swapSender:.  Anthony, what am I doing wrong?
> How does #swapSender: ever work?
> I have to say, I think the BC work is great, but I much prefer working
> with the non-BC MethodContexts...

Hi Avi and all,

swapSender: only works on suspended processes.  In fact, all context
manipulations only work on suspended processes.  This is to allow
running process to be internalized by the VM.  It is pretty easy to
temporarily suspend a running process and manipulate it by using
forkAndWait, ie:

	proc _ thisContext process.
	[	proc suspend.
		"manipulate proc here"
		proc resume.
	] forkAndWait.

forkAndWait will cause the active process to wait until the forked block
finishes.  It still needs to be suspended, however, to convert it to
object form for manipulation.  Upon resume it resumes waiting for the
fork to complete.  Then the fork completes and the proc resumes running.

Attached is a Continuation changeset for VI4.  It works, accept if you
write to the Transcript it crashes the VM.  I will try to fix this
tomorrow.

Cheers,
Anthony
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Continuations-ajh.cs
Type: application/octet-stream
Size: 2957 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20021027/4f8955ab/Continuations-ajh.obj


More information about the Squeak-dev mailing list