Literal object syntax

Tony Garnock-Jones tonyg at lshift.net
Wed Jul 19 08:59:46 UTC 2006


Tony Garnock-Jones wrote:
>   someMethod
>     | leave |
>     leave := thisContext.
>     leave return: 3.
>     ^ 4


Experimenting further, this works for blocks too, provided the blocks
haven't been inlined. Perhaps mention of thisContext inside a block
should disqualify it as a candidate for inlining?

1 + ([ thisContext return: 3 ] value)  "returns 4"

1 + ((1 == 1) ifTrue: [ thisContext return: 3 ])  "returns 3"


Cheers,
  Tony



More information about the Squeak-dev mailing list