Question

Ok, so it's like this:

receiver selectors

returns

#(#expression #expression: #mondrianLabel #accept: #name)

But

receiver expression

throws MessageNotUnderstood.

Any ides how to fix this and why this can be caused?

Était-ce utile?

La solution

You are probably sending the message expression to a class instead of an instance of that class.

If the result of evaluating receiver selectors is #(#expression #expression: #mondrianLabel #accept: #name) then receiver is most probably a class. The message #selectors is implemented on the class Behavior and returns the selectors of the instance methods of the class. In other words: instances of the class (or any of its subclasses) understand the messages listed.

Hence, if you evaluate receiver expression, then you will get a message not understood exception because the message #expression is defined on the instance of the class that is the value of your receiver variable.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top