2Big2BeSmall
2Big2BeSmall

Reputation: 1378

How to Check if objectA has all message as objectB in smalltalk?

I am using smalltalk - i need to check if objectA has all the messages(methods) that objectB has .

i need to write my own code, how could it be done ?

Upvotes: 0

Views: 121

Answers (2)

Norbert Hartl
Norbert Hartl

Reputation: 10841

The solution might be

objectA class allSelectors includesAll: objectB class allSelectors

Upvotes: 2

MartinW
MartinW

Reputation: 5031

You could for example ask the class of an object which selectors it's instances understand:

objectA class allSelectors

Then you could ask different objects and compare the results.

Upvotes: 2

Related Questions