A new version of Kernel was added to project The Inbox: http://source.squeak.org/inbox/Kernel-mt.1489.mcz
==================== Summary ====================
Name: Kernel-mt.1489 Author: mt Time: 11 August 2022, 2:28:56.498306 pm UUID: 1413f35f-167c-7d45-af5c-198546d08830 Ancestors: Kernel-eem.1488
Propose #>>> message to set up message sends.
Examples: (5 >>> #negated) value. (5 >>> #raisedTo: >>> 2) value.
(This is just a brain fart. Feel free to discuss it. Maybe I am on to something here. Maybe not.)
=============== Diff against Kernel-eem.1488 ===============
Item was added: + ----- Method: MessageSend>>>>> (in category 'evaluating') ----- + >>> arg + + arguments := arguments copyWith: arg.!
Item was added: + ----- Method: Object>>>>> (in category 'evaluating') ----- + >>> aSelector + " + (5 >>> #negated) value. + (5 >>> #raisedTo: >>> 2) value. + " + + ^ MessageSend receiver: self selector: aSelector!
Hi Marcel,
Just speaking about the constructor, I've long wished to be able to create MessageSend's with brevity like that. I actually wish the traditional Smalltalk API would have been *outward-looking*, by having #>> answer a MessageSend, instead inward-looking and answering a CompiledMethod. What do *users* of Smalltalk want to ever do with CompiledMethods? Nothing.
But, I actually don't think it's too late. There's no need to give up availability of #>>> (which I think *is* used by some frameworks -- I could be wrong) from the namespace. Instead, I think we should simply overload #>> on Object and not worry about it. If any code actually *needs* to create a MessageSend to a Behavior (probably a rare thing), they could still use the wordy constructor we're all still using to this day.
Okay, so there's Integer, too. That's fine. We're just talking about syntax-sugar here. We'll have to continue to create our MessageSend's to Integer's the long way, which is what we're still doing, so, no big deal! :)
See Kernel-cmm.1489. I held off on that sugar to "*append"* arguments because it might be counterintuitive by the fact the #selector of a MessageSend is just set once and specifies a fixed number of arguments from the get go. So, it might be better for usage of the arguments API to match #selector's.
Best, Chris
On Thu, Aug 11, 2022 at 7:29 AM commits@source.squeak.org wrote:
A new version of Kernel was added to project The Inbox: http://source.squeak.org/inbox/Kernel-mt.1489.mcz
==================== Summary ====================
Name: Kernel-mt.1489 Author: mt Time: 11 August 2022, 2:28:56.498306 pm UUID: 1413f35f-167c-7d45-af5c-198546d08830 Ancestors: Kernel-eem.1488
Propose #>>> message to set up message sends.
Examples: (5 >>> #negated) value. (5 >>> #raisedTo: >>> 2) value.
(This is just a brain fart. Feel free to discuss it. Maybe I am on to something here. Maybe not.)
=============== Diff against Kernel-eem.1488 ===============
Item was added:
- ----- Method: MessageSend>>>>> (in category 'evaluating') -----
argarguments := arguments copyWith: arg.!
Item was added:
- ----- Method: Object>>>>> (in category 'evaluating') -----
aSelector"
(5 >>> #negated) value.
(5 >>> #raisedTo: >>> 2) value.
"
^ MessageSend receiver: self selector: aSelector!
I held off on that sugar to "*append"* arguments because it might be counterintuitive by the fact the #selector of a MessageSend is just set once and specifies a fixed number of arguments from the get go. So, it might be better for usage of the arguments API to match #selector's.
See Kernel-cmm.1490 for an "all or none" take on that. I also prefer it reversed to, as with Stream, indicate *input.*
(Date today >> #addDays: << 3) value. " 15 August 2022" (Date today >> #between:and: << {Date yesterday. Date tomorrow}) value. "true"
Fun! :)
Propose #>>> message to set up message sends.
Examples: (5 >>> #negated) value. (5 >>> #raisedTo: >>> 2) value.
(This is just a brain fart. Feel free to discuss it. Maybe I am on to something here. Maybe not.)
You may be interested in this: http://www.zogotounga.net/comp/squeak/functionaltalk.htm
Stef
squeak-dev@lists.squeakfoundation.org