What would Squeak be like without non-local returns

Igor Stasenko siguctua at gmail.com
Thu Nov 8 06:14:27 UTC 2007


On 08/11/2007, Ralph Johnson <johnson at cs.uiuc.edu> wrote:
> 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.
>
This is all about same: what to do with two(or more) return values,
where we expecting one.

-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list