[ANN] New Version of VI4 (block closures)

Avi Bryant avi at beta4.com
Sat Oct 26 01:08:32 UTC 2002


On Fri, 25 Oct 2002, Anthony Hannan wrote:

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

But not a running one?  Ok, I can probably work around that.

> This is needed for continuations.  However, I haven't added a
> continuation protocol since I'm not sure what it should look like.

The protocol is pretty easy to describe - basically, what I want
is this method:

BlockContext>>callCC
  ^ self value: [:v | ^ v]

Except that, of course, that naiive implementation will break pretty
quickly.  Eg, this code:

|continuation|

continuation := [:cc | cc] callCC.
Transcript cr; show: 'hello'.
continuation ifNotNil: [continuation value: nil].

ought to show:

hello
hello

but instead it will show the first "hello" and then throw a "cannot
return" error.

If you can provide me #callCC so that the above snippet actually works,
that would be wonderful.  If you don't have time, I'll look at doing it
myself - I *think* everything I need should be there now.

Cheers,
Avi




More information about the Squeak-dev mailing list