Hi all! Take a look at this: When would a context use #send:to:with: and when just directly send it? self send: #cannotReturn: to: self with: {value}. self cannotReturn: value. self send: #cannotReturn:to: to: self with: {value. self}. self cannotReturn: value to: self. There are other examples. See: Context >> #jump:if: Context >> #return:from: Best, Marcel |
Hi Marcel,
#cannotReturn: is put onto the stack of the process being executed/simulated. #send:to:with: is part of the simulation protocol. Analogously, #resume:through: will appear on the executed process stack whereas #return:from: is used by the simulator as stated in the comment. :-) I think these methods are already arranged in two different protocols, which are "controlling" for the execution perspective and "instruction decoding" for the simulation perspective.
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Montag, 19. April 2021 11:32:53 An: squeak-dev Betreff: [squeak-dev] Idioms | How to send messages in Context?
Hi all!
Take a look at this:
When would a context use #send:to:with: and when just directly send it?
self send: #cannotReturn: to: self with: {value}.
self cannotReturn: value.
self send: #cannotReturn:to: to: self with: {value. self}.
self cannotReturn: value to: self.
There are other examples. See:
Context >> #jump:if:
Context >> #return:from:
Best,
Marcel
Carpe Squeak!
|
Hi Christoph, makes sense. Thank you! Best, Marcel
|
>> >> #cannotReturn: is put onto the stack of the process being executed/simulated. #send:to:with: is part of the simulation protocol. Analogously, #resume:through: will appear on the executed process stack whereas #return:from: is used by the simulator as stated in the comment. :-) I It might be worth considering the names of these methods in order to make that very clear. Perhaps something like #simSend:to:with: ? tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Klingon Code Warrior:- 4) "This machine is a piece of GAGH! I need dual G5 processors if I am to do battle with this code!" |
> It might be worth considering the names of these methods in order to make that very clear. Perhaps something like #simSend:to:with: ? Yeah, I already thought about something like this. But this would be a greater refactoring, I guess. Another not-so-serious argument is that I have started using the "sim" prefix for extension methods on Context from SimulationStudio. :-)
Best,
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von tim Rowledge <[hidden email]>
Gesendet: Montag, 19. April 2021 18:50:29 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] Idioms | How to send messages in Context? >> >> #cannotReturn: is put onto the stack of the process being executed/simulated. #send:to:with: is part of the simulation protocol. Analogously, #resume:through: will appear on the executed process stack whereas #return:from: is used by the simulator as stated in the comment. :-) I It might be worth considering the names of these methods in order to make that very clear. Perhaps something like #simSend:to:with: ? tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Klingon Code Warrior:- 4) "This machine is a piece of GAGH! I need dual G5 processors if I am to do battle with this code!"
Carpe Squeak!
|
In reply to this post by timrowledge
Hi Tim. > It might be worth considering the names of these methods in > order to make that very clear. Perhaps something like #simSend:to:with: ? Yes, "send" is very close to "perform" and #when:send:to: and #on:send:to:. :-D Yet, we are in Context. So there is already a notion of "simulation" attached to many messages in there. Looking at the protocols "controlling" and "system simulation", I don't think that adding a "sim" prefix to "controlling" messages would do any good. Best, Marcel
|
Free forum by Nabble | Edit this page |