Process local variable and debugging
Lex Spoon
lex at cc.gatech.edu
Mon Feb 11 05:20:48 UTC 2002
>
> > Anyway, here's a quick hack: Have "Processor activeProcess" return the
> > process being debugged, if it is invoked from within the debugger. I
> > don't know how, but, isn't that a reasonable thing to do? Mentally,
> > when you do "step" in the debugger, you are resuming the process for
> > just one step, even if it's not implemented that way.
> Hey, you're supposed to have finished that paragraph with "..and here's
> some code I prepared earlier" !
Well... it's a simple idea, but I can't think of a way to implement it
without already having some sort of dynamic variables implemented. :)
I was hoping that the debugger already got some say in how primitives
are handled, but it doesn't appear to be so.
> Use
> [:dict| blah-blah] newProcesssWith:
> instead of
> [foody-doo] newProcess
A way to accomplish exactly this is with exceptions: signal an
exception, and have the handler resume execution, passing in the value
of the variable. That is:
[ blah blah ] on: FakedUpDynamicVariable do: [ :ex | ex resume:
someValue ]
Then the "blah blah" code can do this to read the variable:
(FakeUpDynamicVariable signal)
This was used a while in Squeak to look up the current world if you have
nested worlds; check out the commented part of
SystemDictionary>>isMorphic .
-Lex
More information about the Squeak-dev
mailing list
|