Marcel Taeumel uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-ct.1538.mcz
==================== Summary ====================
Name: Kernel-ct.1538 Author: ct Time: 5 December 2023, 8:41:07.361911 pm UUID: d08b63ac-7ec2-304f-bbb9-cb939ebe37fb Ancestors: Kernel-dtl.1537
Makes MessageSend and WeakMessageSend fully polymorphous.
=============== Diff against Kernel-dtl.1537 ===============
Item was added: + ----- Method: MessageSend>>asMessageSend (in category 'converting') ----- + asMessageSend + ^MessageSend receiver: self receiver selector: selector arguments: (Array withAll: self arguments) + !
Item was added: + ----- Method: WeakMessageSend>>asMessage (in category 'converting') ----- + asMessage + ^ Message selector: selector arguments: arguments.!
Item was added: + ----- Method: WeakMessageSend>>cull: (in category 'evaluating') ----- + cull: firstArg + "Send the message with these optional arguments and answer the return value" + + selector numArgs >= 1 ifTrue: [ ^self value: firstArg ]. + ^self value!
Item was added: + ----- Method: WeakMessageSend>>cull:cull: (in category 'evaluating') ----- + cull: firstArg cull: secondArg + "Send the message with these optional arguments and answer the return value" + + | numArgs | + (numArgs := selector numArgs) >= 2 ifTrue: [ ^self value: firstArg value: secondArg ]. + numArgs = 1 ifTrue: [ ^self value: firstArg ]. + ^self value!
Item was added: + ----- Method: WeakMessageSend>>cull:cull:cull: (in category 'evaluating') ----- + cull: firstArg cull: secondArg cull: thirdArg + "Send the message with these optional arguments and answer the return value" + + | numArgs | + (numArgs := selector numArgs) >= 2 ifTrue: [ + numArgs >= 3 ifTrue: [ ^self value: firstArg value: secondArg value: thirdArg ]. + ^self value: firstArg value: secondArg ]. + numArgs = 1 ifTrue: [ ^self value: firstArg ]. + ^self value!
Item was added: + ----- Method: WeakMessageSend>>cull:cull:cull:cull: (in category 'evaluating') ----- + cull: firstArg cull: secondArg cull: thirdArg cull: fourthArg + "Send the message with these optional arguments and answer the return value" + + | numArgs | + (numArgs := selector numArgs) >= 3 ifTrue: [ + numArgs >= 4 ifTrue: [ + ^self value: firstArg value: secondArg value: thirdArg value: fourthArg ]. + ^self value: firstArg value: secondArg value: thirdArg ]. + numArgs = 2 ifTrue: [ ^self value: firstArg value: secondArg ]. + numArgs = 1 ifTrue: [ ^self value: firstArg ]. + ^self value!
Item was added: + ----- Method: WeakMessageSend>>cull:cull:cull:cull:cull: (in category 'evaluating') ----- + cull: firstArg cull: secondArg cull: thirdArg cull: fourthArg cull: fifthArg + "Send the message with these optional arguments and answer the return value" + + ^ selector numArgs caseOf: { + [5] -> [self value: firstArg value: secondArg value: thirdArg value: fourthArg value: fifthArg]. + [4] -> [self value: firstArg value: secondArg value: thirdArg value: fourthArg]. + [3] -> [self value: firstArg value: secondArg value: thirdArg]. + [2] -> [self value: firstArg value: secondArg]. + [1] -> [self value: firstArg]. + [0] -> [self value] }!
Item was added: + ----- Method: WeakMessageSend>>numArgs (in category 'accessing') ----- + numArgs + ^ selector numArgs!
Item was added: + ----- Method: WeakMessageSend>>value: (in category 'evaluating') ----- + value: firstArg + "Send the message with these arguments and answer the return value" + + ^ self valueWithArguments: {firstArg}!
Item was added: + ----- Method: WeakMessageSend>>value:value: (in category 'evaluating') ----- + value: firstArg value: secondArg + "Send the message with these arguments and answer the return value" + + ^ self valueWithArguments: {firstArg. secondArg}!
Item was added: + ----- Method: WeakMessageSend>>value:value:value: (in category 'evaluating') ----- + value: firstArg value: secondArg value: thirdArg + "Send the message with these arguments and answer the return value" + + ^ self valueWithArguments: {firstArg. secondArg. thirdArg}!
Item was added: + ----- Method: WeakMessageSend>>value:value:value:value: (in category 'evaluating') ----- + value: firstArg value: secondArg value: thirdArg value: fourthArg + "Send the message with these arguments and answer the return value" + + ^ self valueWithArguments: {firstArg. secondArg. thirdArg. fourthArg}!
Item was added: + ----- Method: WeakMessageSend>>value:value:value:value:value: (in category 'evaluating') ----- + value: firstArg value: secondArg value: thirdArg value: fourthArg value: fifthArg + "Send the message with these arguments and answer the return value" + + ^ self valueWithArguments: {firstArg. secondArg. thirdArg. fourthArg. fifthArg}!
Item was added: + ----- Method: WeakMessageSend>>valueWithPossibleArgs: (in category 'evaluating') ----- + valueWithPossibleArgs: anArray + "Send selector to the receiver with arguments in anArray. Only use enough arguments for the arity of the selector; supply nils for missing ones." + + ^self + withEnsuredReceiverDo: [ :r | + r + perform: selector + withEnoughArguments: anArray ] + otherwise: [ ]!
packages@lists.squeakfoundation.org