Context of Execution
Brian Rice
water at tunes.org
Mon Jul 24 07:53:07 PDT 2006
On Jul 22, 2006, at 1:42 PM, Jack Waugh wrote:
> Does the language definition require that every invocation of a
> method or block
> happen with a new context? Must the context inherit from the
> calling context?
Huh? What do you mean by a "context"? A stack frame, perhaps? The
compiler determines whether it can execute a lexical (literal) block
in a method as a piece of bytecode or whether a separate Method
object must be created and then run in a separate stack frame. src/
mobius/vm/interp/compiler.slate has the details. Since Slate is
lexically-scoped, then of course it's implicit that contexts inherit
from the lexically-enclosing scopes.
> Where is the source code to the macro, "`>>"?
src/lib/macro.slate which has the documentation for it. (Grepping
"@.*>>" will find it for you).
> Doesnt' "`>>" pass an arbitrary
> object (its left argument) as the context?
It takes an expression which `>> when expanded is evaluated and
possibly stored for a bunch of following statements to act on in the
left-most argument position.
> Does that break programmers'
> expectations about what the context does for its callers?
What expectations are those?
> Does it cut off
> access to the lobby, for example, for the code in the block that is
> the right
> argument of "`>>", and for code called by that code?
No, the lobby or other scope can be accessed if using parentheses to
change the precedence ordering of evaluation.
Incidentally, `>> [] is merely notation to not require Smalltalk-80's
";" special cascade operator.
--
-Brian
http://tunes.org/~water/brice.vcf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : /archives/slate/attachments/20060724/ea273024/PGP.pgp
More information about the Slate
mailing list