What would Squeak be like without non-local returns

Ralph Johnson johnson at cs.uiuc.edu
Thu Nov 8 05:55:16 UTC 2007


On 11/7/07, Andreas Raab <andreas.raab at gmx.de> wrote:
> Ralph Johnson wrote:
> > Consider the code
> >
> > object eventual: [...  ^3]
> > ...
> > ^4
> >
> > Depending on the missing code, it could return either 3 or 4.  If not,
> > something is very strange, and the language is no longer Smalltalk.
>
> Not at all. Eventual/future sends introduce a new unit of concurrency
> and the only thing we're arguing is whether that second unit of
> concurrency will be executed before the first one. In E/Croquet this is
> not possible, but it is really no different from, e.g.,
>
> Object>>foo
>    [^3] forkAt: Processor activePriority-1.
>    ^4
>
> When you run this, it will return 4 (every time) and fall over the
> non-local return later (every time).

But that wasn't what I said.  Your code is different from mine.  Note the ...

For example,

Object >>foo
  [^3] fork.
  self halt.
  ^ 4

returns 3.



More information about the Squeak-dev mailing list