Recursion inside #doesNotUnderstand: method. Why?
Hi. Does anybody know why #doesNotUnderstand: is implemented with recursion at the end? doesNotUnderstand: aMessage | exception resumeValue | (exception := MessageNotUnderstood new) message: aMessage; receiver: self. resumeValue := exception signal. * ^exception reachedDefaultHandler* * ifTrue: [aMessage sentTo: self]* ifFalse: [resumeValue]. Best regards, Denis
Maybe in past it was used to create methods in debugger on the fly. But now it is not. I just check it. I removed recursion logic and methods creation continue working in debugger. Maybe we should remove this strange behaviour 2016-02-25 17:56 GMT+01:00 Denis Kudriashov <dionisiydk@gmail.com>:
Hi.
Does anybody know why #doesNotUnderstand: is implemented with recursion at the end?
doesNotUnderstand: aMessage | exception resumeValue | (exception := MessageNotUnderstood new) message: aMessage; receiver: self. resumeValue := exception signal. * ^exception reachedDefaultHandler* * ifTrue: [aMessage sentTo: self]* ifFalse: [resumeValue].
Best regards, Denis
I donât think so: Put a halt here: â¦ifTrue: [self halt. aMessage sentTo: self]⦠1. Open a playground 2. Do: Object new toto You should have a debugger that pops. Donât close it. 3. Go in Nautilus, implement toto on Object 4. Click on proceed in the debugger. You should have a Halt instead. And if you click on proceed again, it should execute the toto method. So it is used, and I frequently use it. Cheers, Vincent De : Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] De la part de Denis Kudriashov Envoyé : jeudi 25 février 2016 18:06 à : Discusses Development of Pharo Objet : Re: [Pharo-dev] Recursion inside #doesNotUnderstand: method. Why? Maybe in past it was used to create methods in debugger on the fly. But now it is not. I just check it. I removed recursion logic and methods creation continue working in debugger. Maybe we should remove this strange behaviour 2016-02-25 17:56 GMT+01:00 Denis Kudriashov <dionisiydk@gmail.com<mailto:dionisiydk@gmail.com>>: Hi. Does anybody know why #doesNotUnderstand: is implemented with recursion at the end? doesNotUnderstand: aMessage | exception resumeValue | (exception := MessageNotUnderstood new) message: aMessage; receiver: self. resumeValue := exception signal. ^exception reachedDefaultHandler ifTrue: [aMessage sentTo: self] ifFalse: [resumeValue]. Best regards, Denis !!!************************************************************************************* "Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis. This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.!!!"
Hi, Because when you are receiving a DNU, you have the possibility to implement the method before resuming the exception. If you choose to implement the method, the message is sent again to the newly created method and the execution restarts. Vincent De : Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] De la part de Denis Kudriashov Envoyé : jeudi 25 février 2016 17:56 à : Discusses Development of Pharo Objet : [Pharo-dev] Recursion inside #doesNotUnderstand: method. Why? Hi. Does anybody know why #doesNotUnderstand: is implemented with recursion at the end? doesNotUnderstand: aMessage | exception resumeValue | (exception := MessageNotUnderstood new) message: aMessage; receiver: self. resumeValue := exception signal. ^exception reachedDefaultHandler ifTrue: [aMessage sentTo: self] ifFalse: [resumeValue]. Best regards, Denis !!!************************************************************************************* "Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis. This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.!!!"
Just a guess, maybe to allow method adding from debugger and then ability to continue execution? Cheers, Alex On Thu, Feb 25, 2016 at 5:56 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hi.
Does anybody know why #doesNotUnderstand: is implemented with recursion at the end?
doesNotUnderstand: aMessage | exception resumeValue | (exception := MessageNotUnderstood new) message: aMessage; receiver: self. resumeValue := exception signal. * ^exception reachedDefaultHandler* * ifTrue: [aMessage sentTo: self]* ifFalse: [resumeValue].
Best regards, Denis
Am 25.02.2016 6:30 nachm. schrieb "Aliaksei Syrel" <alex.syrel@gmail.com>:
Just a guess, maybe to allow method adding from debugger and then ability
to continue execution?
Cheers, Alex
On Thu, Feb 25, 2016 at 5:56 PM, Denis Kudriashov <dionisiydk@gmail.com>
wrote:
Hi.
Does anybody know why #doesNotUnderstand: is implemented with recursion
at the end?
doesNotUnderstand: aMessage | exception resumeValue | (exception := MessageNotUnderstood new) message: aMessage; receiver: self. resumeValue := exception signal. ^exception reachedDefaultHandler ifTrue: [aMessage sentTo: self] ifFalse: [resumeValue].
There is a difference between sentTo: and sendTo:
Best regards, Denis
Hi Denis, On Thu, Feb 25, 2016 at 8:56 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hi.
Does anybody know why #doesNotUnderstand: is implemented with recursion at the end?
doesNotUnderstand: aMessage | exception resumeValue | (exception := MessageNotUnderstood new) message: aMessage; receiver: self. resumeValue := exception signal. * ^exception reachedDefaultHandler* * ifTrue: [aMessage sentTo: self]* ifFalse: [resumeValue].
It's so that when a doesNotUnderstand: occurs and one implements the method in the debugger one can proceed. The sentTo: at the end will now invoke the newly defined method and one can continue programming. Best regards,
Denis
_,,,^..^,,,_ best, Eliot
2016-02-25 18:24 GMT+01:00 Eliot Miranda <eliot.miranda@gmail.com>:
It's so that when a doesNotUnderstand: occurs and one implements the method in the debugger one can proceed. The sentTo: at the end will now invoke the newly defined method and one can continue programming.
But as I said I make experiment. And in Pharo this recursion is not needed to implement unknown messages in Debugger. But for case of Vincent it is needed
On Feb 26, 2016, at 9:12 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-02-25 18:24 GMT+01:00 Eliot Miranda <eliot.miranda@gmail.com>:
It's so that when a doesNotUnderstand: occurs and one implements the method in the debugger one can proceed. The sentTo: at the end will now invoke the newly defined method and one can continue programming.
But as I said I make experiment. And in Pharo this recursion is not needed to implement unknown messages in Debugger. But for case of Vincent it is needed
Which implies that the debugger is doing something unnecessary. Instead of creating an activation of the newly defined message it could simply proceed? _,,,^..^,,,_ (phone)
participants (5)
-
Aliaksei Syrel -
Blondeau Vincent -
Denis Kudriashov -
Eliot Miranda -
Nicolai Hess