Hi Folks,
Roughly speaking, are Contexts the equivalent of the Lisp environments?
Furthermore in squeak...
I was in a workspace and did a do-it on the contents...was the Context the contents of the workspace?
If I highlight some text in a workspace, like 'JsonObject new' and do-it, is the context the highlighted region?
thx in advance.
t
On 2024-01-11 21:34, gettimothy via Squeak-dev wrote:
Hi Folks,
Roughly speaking, are Contexts the equivalent of the Lisp environments?
Furthermore in squeak...
I was in a workspace and did a do-it on the contents...was the Context the contents of the workspace?
If I highlight some text in a workspace, like 'JsonObject new' and do-it, is the context the highlighted region?
Like almost everything in Smalltalk, a Context is an object. Unlike many things in Squeak, the class comment for Context (written by Eliot) provides a very good explanation of "what is a Context?".
The term "context" might mean different things in different contexts (sorry) but in Smalltalk it relates specifically to the "context" in which a message send (or block evaluation) happens.
The class comment for Context provides a better explanation, so check that out first :-)
Dave
Thank you.
---- On Fri, 12 Jan 2024 21:51:04 -0500 lewis@mail.msen.com wrote ---
On 2024-01-11 21:34, gettimothy via Squeak-dev wrote:
Hi Folks,
Roughly speaking, are Contexts the equivalent of the Lisp environments?
Furthermore in squeak...
I was in a workspace and did a do-it on the contents...was the Context the contents of the workspace?
If I highlight some text in a workspace, like 'JsonObject new' and do-it, is the context the highlighted region?
Like almost everything in Smalltalk, a Context is an object. Unlike many things in Squeak, the class comment for Context (written by Eliot) provides a very good explanation of "what is a Context?".
The term "context" might mean different things in different contexts (sorry) but in Smalltalk it relates specifically to the "context" in which a message send (or block evaluation) happens.
The class comment for Context provides a better explanation, so check that out first :-)
Dave
On Thu, Jan 11, 2024 at 13:35 gettimothy via Squeak-dev < squeak-dev@lists.squeakfoundation.org> wrote:
Hi Folks,
Roughly speaking, are Contexts the equivalent of the Lisp environments?
No - contexts are created on the fly every time a method gets executed, to hold the state necessary for that execution. For example, it holds the instruction pointer that starts on top of the method, and then gets incremented for every instruction in that method.
A context also provides space for temporary validity and intermediate results. E.g. in the expression “3 + 4 + 5” the intermediate result “7” needs to be stored somewhere before the “+ 5” can be executed. That result is stored in the context.
(I’m glossing over many details but that’s basically what contexts are)
Thank you.
---- On Sat, 13 Jan 2024 03:44:03 -0500 Vanessa Freudenberg vanessa@codefrau.net wrote ---
On Thu, Jan 11, 2024 at 13:35 gettimothy via Squeak-dev mailto:squeak-dev@lists.squeakfoundation.org wrote:
Hi Folks,
Roughly speaking, are Contexts the equivalent of the Lisp environments?
No - contexts are created on the fly every time a method gets executed, to hold the state necessary for that execution. For example, it holds the instruction pointer that starts on top of the method, and then gets incremented for every instruction in that method.
A context also provides space for temporary validity and intermediate results. E.g. in the expression “3 + 4 + 5” the intermediate result “7” needs to be stored somewhere before the “+ 5” can be executed. That result is stored in the context.
(I’m glossing over many details but that’s basically what contexts are)
squeak-dev@lists.squeakfoundation.org