I'm trying to implement a new class in Squeak, and for some reason when I run a test I get a MessageNotUnderstood error, even though the message is defined. Class code:
Object subclass: #ClassAnalyzer
instanceVariableNames: 'theClasses'
classVariableNames: ''
poolDictionaries: ''
category: 'OOP3'!
!ClassAnalyzer methodsFor: 'initialize-release' stamp: 'NK 11/30/2009 22:50'!
initialize: setOfClasses
theClasses := setOfClasses.! !
!ClassAnalyzer methodsFor: 'initialize-release' stamp: 'NK 11/30/2009 22:49'!
newWith: input
[input isKindOf: Collection]
ifFalse: [^ClassAnalyzer new: input].
^ClassAnalyzer new: (input asSet).! !
And here's the test I ran:
| abcd z |
z:=1class.
abcd:= ClassAnalyzer newWith: z.
Any idea what I'm doing wrong? My current theory is that since when you invoke a constructor there's no object yet, so it should be a bit different (maybe there should be a predefined function of the same name in Object or protoObject), but if that's the deal, then how would one go about defining a none standard named constructor without changing Object?