[BUG]UndefinedObject(Object)>>error:

Arjen van Elteren a.vanelteren at chello.nl
Tue Oct 14 08:17:46 UTC 2003


Hi,

I've been following this thread with much interest. I would like Squeak to
be compliant on these issues and I do not need the compiler to hold my
hand on this. The example Peter has given can be easily expanded to the
instance side (in which case the scoping does work, and squeak does not
complain!).

Object
	subclass: #FooBase
	instanceVariableNames: 'Bar Morph'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Scope-Examples'
.
(Smalltalk at: #FooBase)
	subclass: #FooSub
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Scope-Examples'
.
Object
	subclass: #Bar
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Scope-Examples'
.
(Smalltalk at: #FooBase)  compile:
'returnBar

^Bar'
.
(Smalltalk at: #FooBase) new returnBar == nil
	ifFalse: [nil error: 'FooBase: should be nil']
.
(Smalltalk at: #FooSub) compile:
'returnBar

^Bar'
.
(Smalltalk at: #FooSub) new returnBar == nil
	ifFalse: [nil error: 'FooSub: should be nil']
.

Arjen

PS I was suprised that you could shadow globals in class vars in smalltalk
(Peter showed me this a couple of weeks ago) but it is a very powerful
function! Now I can use a class as it's own namespace (and define my own
ordered collection if I want, and this is portable (unlike VW namespaces
or squeak environments or STX namespaces). The discussion that I cannot
directly see which OrderedCollection is moot.
One can find some examples in Visualworks where it is not obvious from a
method which Text class is used (one has XML.Text and Core.Text).










More information about the Squeak-dev mailing list