#class Apex(nil) { #dcl(#class) sysdic. ## ------------------------------------------------------- ## ------------------------------------------------------- #method(#class) dump { } #method dump { } ## ------------------------------------------------------- ## ------------------------------------------------------- #method(#class) yourself { ^self. } #method yourself { ^self. } ## ------------------------------------------------------- ## ------------------------------------------------------- #method(#class) basicNew { self primitiveFailed. } #method(#class) basicNew: anInteger { self primitiveFailed. } #method(#class) new { | x | x := self basicNew. x initialize. "TODO: assess if it's good to call 'initialize' from new." ^x. } #method(#class) new: anInteger { | x | x := self basicNew: anInteger. x initialize. "TODO: assess if it's good to call 'initialize' from new." ^x. } #method initialize { "a subclass may override this method." ^self. } ## ------------------------------------------------------- ## ------------------------------------------------------- #method shallowCopy { self primitiveFailed. } ## ------------------------------------------------------- ## ------------------------------------------------------- #method class { } #method(#class) class { ^Class } ## ------------------------------------------------------- ## ------------------------------------------------------- #method basicSize { self primitiveFailed. } #method(#class) basicSize { self primitiveFailed. } #method basicAt: anInteger { self error: 'out of range'. } #method basicAt: anInteger put: anObject { self error: 'out of range'. } #method(#class) basicAt: anInteger { self error: 'out of range'. } #method(#class) basicAt: anInteger put: anObject { self error: 'out of range'. } ## ------------------------------------------------------- ## ------------------------------------------------------- #method == anObject { "check if the receiver is identical to anObject. this doesn't compare the contents" } #method ~~ anObject { ^(self == anObject) not. } #method(#class) == anObject { "check if the receiver is identical to anObject. this doesn't compare the contents" } #method(#class) ~~ anObject { ^(self == anObject) not. } ## TODO: add = and ~= for equality check. #method isNil { "^self == nil." ^false } #method notNil { "^(self == nil) not" "^self ~= nil." ^true. } #method(#class) isNil { "^self == nil." ^false } #method(#class) notNil { "^(self == nil) not" "^self ~= nil." ^true. } ## ------------------------------------------------------- ## ------------------------------------------------------- " #method(#class) respondsTo: selectorSymbol { TODO: find selectorSymbol in the class method dictionary... } #method respondsTo: selectorSymbol { TODO: find selectorSymbol in the method dictionary... } " ## ------------------------------------------------------- ## ------------------------------------------------------- #method(#class) primitiveFailed { ## TODO: implement this ## PrimitiveFailureError signal. self dump. 'primitive failed' dump. } #method primitiveFailed { self class primitiveFailed. } #method(#class) doesNotUnderstand: messageSymbol { ## TODO: implement this ## UnrecognizedMessage signal. self class dump. 'does not understand' dump. } #method doesNotUnderstand: messageSymbol { self class doesNotUnderstand: messageSymbol } #method(#class) error: msgText { ## TODO: implement this ## Error signal: msgText. msgText dump. } #method error: aString { self class error: aString. } }