On 6 January 2014 11:11, Nicolai Hess <[email protected]> wrote: > 2014/1/6 Clément Bera <[email protected]> >> >> Hello, >> >> here I have a class >> >> A>>== >> ^ true >> >> Now: >> a := A new. >> b := A new. >> a == b "Answers false" >> a perform: #== with: b "Answers true" >> >> Do I have to remove the usage of the byte code for #== in the compiler to >> be able to override == ? >> >> > > > No, a==b should be used for "are the same Objects" (pointing to the same > object) and not "are equal". > Look for example at the commentn for ProtoObject>>==
Given the kinds of things Clément does, I suspect he knows full well the difference between #== and #=. My understanding is that the compiler inlines #== sends like it does with #timesRepeat: and ifTrue:ifFalse:. So yes, you'd need to fiddle with the compiler for any #== overrides to actually run. (I'm keen for Marcus to show us how exactly to do that in Opal!) frank > Nicolai
