[ANN] New Version of VI4 (block closures)
Stephen Pair
spair at acm.org
Sat Oct 26 04:04:45 UTC 2002
Avi Bryant wrote:
> 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.
Reading this code, I think that "cannot return" is the proper
behavior...are you saying that this needs to be changed such that this
code will output 2 'hello's?
- Stephen
More information about the Squeak-dev
mailing list
|