[squeak-dev] The Trunk: EToys-tfel.253.mcz

Kjell Godo squeaklist at gmail.com
Mon Sep 26 15:41:29 UTC 2016


When is a MessageSend better than a BlockClosure?
I would like to know.  Because you can change it?
You can look inside.  What if the arguments were Blocks.
You could easily make a tree of MessageSends
(
( M message1:( M message2: obj2 )
      message1:( M message3: obj31
                              message3: obj32 )
) receiverDeep:{ r1. r2. r3 }"<---[ left right top down traverse ]"
) valueDeep

On Monday, September 26, 2016, Kjell Godo <squeaklist at gmail.com> wrote:

> M class>>doesNotUnderstand: aMessage ^aMessage asMessageSend !
>
> ( ( M som:eMe:ssa:ge: inputs ) receiver: obj )
>
> On Monday, September 26, 2016, Kjell Godo <squeaklist at gmail.com
> <javascript:_e(%7B%7D,'cvml','squeaklist at gmail.com');>> wrote:
>
>> M>>doesNotUnderstand: aMessage ^aMessage asMessageSend !
>>
>> ( M handUserSorterMorphForProjectNamed: nil )"<---[ easy way to make a
>> MessageSend ]"
>> ...
>>      sendTo: obj
>>
>> On Monday, September 26, 2016, <commits at source.squeak.org> wrote:
>>
>>> Tim Felgentreff uploaded a new version of EToys to project The Trunk:
>>> http://source.squeak.org/trunk/EToys-tfel.253.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: EToys-tfel.253
>>> Author: tfel
>>> Time: 26 September 2016, 11:40:48.856552 am
>>> UUID: a00694aa-7017-b444-a8d0-6671ec171efd
>>> Ancestors: EToys-tfel.252
>>>
>>> delete the project saving morph before saving
>>>
>>> =============== Diff against EToys-tfel.252 ===============
>>>
>>> Item was changed:
>>>   ----- Method: EToyProjectDetailsMorph>>doOK (in category 'utilities')
>>> -----
>>>   doOK
>>>         "User hit the ok button in the project-info dialog.  Store the
>>> updated project-info back in the project. Call the message-send residing in
>>> the receiver's actionBlock to carry out any subsequent desired task.  Note
>>> that this method sets the 'arguments' of the message-send in the
>>> actionBlock"
>>>
>>>         | args actionSelector  |
>>>         self validateTheProjectName ifFalse: [^false].
>>>         projectDetails := self copyOutDetails.
>>>
>>>         theProject acceptProjectDetails: projectDetails.  "Make sure
>>> project & world feel the changes"
>>> +
>>> +       self delete.
>>> -
>>>         actionBlock isMessageSend "new way -- hopefully all cases"
>>>                 ifTrue:  "please excuse this ugly, non-modular code..."
>>>                         [actionSelector := actionBlock selector.
>>>                         args := (actionSelector =
>>> #handUserSorterMorphForProjectNamed:)
>>>                                 ifTrue:
>>>                                         [{theProject name}]
>>>                                 ifFalse:
>>>                                         [actionSelector numArgs = 0
>>>                                                 ifTrue:
>>>                                                         [nil]
>>>                                                 ifFalse:
>>>                                                         [Array with:
>>> projectDetails]].
>>>                         actionBlock arguments: args.
>>>                         actionBlock value]
>>>
>>>                 ifFalse:  "Old way, with actionBlock actually a block of
>>> one argument.  This should no longer occur."
>>> +                       [actionBlock value: projectDetails].!
>>> -                       [actionBlock value: projectDetails].
>>> -
>>> -       self delete!
>>>
>>> Item was changed:
>>>   ----- Method: EToyProjectQueryMorph>>doOK (in category 'ok button
>>> hit') -----
>>>   doOK
>>>         "User hit the ok button in the project-query dialog."
>>>
>>>         | details |
>>>         details := self copyOutDetails.
>>>
>>> +       self delete.
>>>         actionBlock isMessageSend "new way -- hopefully all cases"
>>>                 ifTrue:
>>>                         [actionBlock arguments: {details. actionBlock
>>> arguments second}.
>>>                         actionBlock value]
>>>
>>>                 ifFalse:  "Old way, with actionBlock actually a block of
>>> one argument.  This should no longer occur."
>>> +                       [actionBlock value: details].!
>>> -                       [actionBlock value: details].
>>> -
>>> -       self delete!
>>>
>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160926/708cc078/attachment.htm


More information about the Squeak-dev mailing list