Kilon
Kilon

Reputation: 2002

How to find a chain of MessageNotUnderstood messages

Following up from my previous example here

How to find which was the wrong message in a Message Not Understood message?

Let's say that the code now is this

Transcript explode implode andBecomeNuclear.

Pharo will send 3 MNUs in this case: 1) explode 2) implode 3) andBecomeNuclear

Overriding doesNotUnderstand: does not help here because I want the full chain of messages. That means I want it to give me not just one message but all 3 messages together till it finds the period that ends the pharo command.

How I do that ?

Upvotes: 2

Views: 69

Answers (1)

Uko
Uko

Reputation: 13396

First of all Pharo will not send 3 messages. Following priority order it will send explode and then stop with DNU, or send implode to returned object. What you can do is define DNU in a way that stores messages in a queue and return self. I don't know how to retrieve all chain in the end of a statement. The easiest way would be to define some message like chain that will return the whole queue.

Upvotes: 4

Related Questions