|
|
6.10 BlockContext
- Defined in namespace Smalltalk
- Category: Language-Implementation
- My instances represent executing Smalltalk blocks, which are portions of
executeable code that have access to the environment that they were declared
in, take parameters, and result from BlockClosure objects created to be
executed by methods outside the current class. Block contexts are
created by messages sent to compute a closure's value. They contain a stack
and also provide some methods that can be used in inspection or debugging.
6.10.1 BlockContext: accessing
- caller
- Answer the context that called the receiver
- home
- Answer the MethodContext to which the receiver refers, or nil if it has been optimized away
- isBlock
- Answer whether the receiver is a block context
- isEnvironment
- To create a valid execution environment for the interpreter even before it starts, GST creates a fake context whose selector is nil and which can be used as a marker for the current execution environment. Answer whether the receiver is that kind of context (always false, since those contexts are always MethodContexts).
- nthOuterContext: n
- Answer the n-th outer block/method context for the receiver
- outerContext
- Answer the outer block/method context for the receiver
6.10.2 BlockContext: printing
- printOn: aStream
- Print a representation for the receiver on aStream
|