What would Squeak be like without non-local returns
Andreas Raab
andreas.raab at gmx.de
Wed Nov 7 16:53:30 UTC 2007
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).
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|