I'm reading "Smalltalk Best Practice Patterns". On page 49 there is this example code.
Object>>= anObject ^self == anObject
I've never seen == in Smalltalk before. It doesn't seem to be a method in Object within Squeak. What's going on here?
--- Mark Volkmann
Mark,
== tests for object identity. Look for implementors of ==, you find it in ProtoObject:
== anObject "Primitive. Answer whether the receiver and the argument are the same object (have the same object pointer). Do not redefine the message == in any other class! Essential. No Lookup. Do not override in any subclass. See Object documentation whatIsAPrimitive."
<primitive: 110> self primitiveFailed
Cheers
Matthias
On Fri, Oct 31, 2008 at 3:05 AM, Mark Volkmann mark@ociweb.com wrote:
I'm reading "Smalltalk Best Practice Patterns". On page 49 there is this example code.
Object>>= anObject ^self == anObject
I've never seen == in Smalltalk before. It doesn't seem to be a method in Object within Squeak. What's going on here?
Mark Volkmann
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
beginners@lists.squeakfoundation.org