Debug it mysteries
Andreas Raab
andreas.raab at gmx.de
Fri Apr 25 00:18:11 UTC 2003
> If I'm evaluating code in a workspace why isn't the
> object in which the code I'm evaluating an instance of
> some kind of workspace class (e.g.- TempWorkspace,
> perhaps)? As opposed to an instance of the class
> UndefinedObject?
Just an arbitrary choice. You can actually change it by adding a method
like:
Workspace>>doItReceiver
^self
> Why is the method called #DoIt rather than #debugIt if
> even though I've invoked it via the debug it menu
> item?
Because #DoIt is the generic name for all of the "temporary methods" - it
allows Squeak to do some housekeeping regardless of whether you invoked the
method by using "do it", or "print it", or "debug it".
> On the subject of names, why does the method DoIt not
> follow the SmallTalk convention of beginning methods
> with lower case letters?
A deliberately chosen violation in order to make the possibility of
conflicts smaller. If you "live by the rules" then your method will be
called #doIt (check it out - there *are* methods called #doIt) and so the
temporary method won't conflict with them.
> As well, if the canonical way of printing is
> Class>>method what does the next statement mean? []
> in TextMorphEditor(ParagraphEditor)>>debug:receiver:in:
The [] says "I am within a block" (a code section that has no method name);
in order to show you something the debugger tells you that it is "within a
block defined within #debug:receiver:in:".
> Is "[] in TextMorphEditor(ParagraphEditor)" a class?
> Or does "[]" represent a class (an generic block
> perhaps) located in some kind of TextMorphEditor
> class?
It's just a block. The "canonical" way to represent this might be something
like
"a Block defined in TextMorphEditor..."
but it's very verbose and "[]" gives you essentially the same information
(well, if you know how to interpret it ;-)
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|