Compiler And Evaluate Block Bug?
Bert Freudenberg
bert at isgnw.CS.Uni-Magdeburg.De
Tue Dec 7 18:52:03 UTC 1999
On Tue, 7 Dec 1999, R. A. Harmon wrote:
> Hi folks:
>
> (Compiler evaluate: '[ :xxx | ^xxx].'
> ) value: 2
>
> signals a block cannot return error exception*.
>
>
> Compiler evaluate: '[ :xxx | ^xxx] value: 2.'
>
> properly returns 2.
>
> Is this a bug, an side affect that BlockContext is "a work in progress", or
> am I just misunderstanding something?
If you omit the ^ it works just fine.
I'm not sure if this is to be considered a bug. Compiler>>evaluate:
compiles that code into a temporary method, executes this method, and
returns the result. At the time you send #value to the resulting block the
method context doesn't exist anymore, so you can't return from it either.
-Bert-
More information about the Squeak-dev
mailing list
|