I also wondered, what if another kind of behavior comes along one day? Then ...classOrTrait... might be the wrong choice (or name, depending on the implementation) again.
After more thought, I would rather like to scrap this patch and change MCMockPackageInfo>>classes in the other patch to use #hasBindingOf:. It looks up its own "well known" symbols anyway, that's why I think it can even forgo the behavior type check. And if the other patch is not accepted, this one will not be required anyway.
To fullfill my commit message, there should rather be a hasBehavior:/behaviorNamed:/behaviors triple, shouldn't it?
2017-02-13 15:57 GMT+01:00 Bert Freudenberg bert@freudenbergs.de:
On Mon, Feb 13, 2017 at 1:08 PM, Jakob Reschke jakob.reschke@student.hpi.de wrote:
classNamed: OTOH does not check the type and will also return a Trait.
That's because it predates traits and has not been updated.
Actually, it seems to have been updated in SystemDictionary to be "^ self classOrTraitNamed: className", and then was copied over to Environment later.
squeak-dev@lists.squeakfoundation.org