Cascading ?

Klaus D. Witzel klaus.witzel at cobss.com
Thu Aug 17 10:54:56 UTC 2006


Instead of #ifNotNilDo: you can use #in: but there are no examples in the  
image for using #in: for cascading.

/Klaus

On Thu, 17 Aug 2006 12:34:26 +0200, Klaus wrote:
> On Thu, 17 Aug 2006 12:07:54 +0200, Damien Cassou wrote:
>> Klaus D. Witzel wrote:
>>> On Thu, 17 Aug 2006 11:12:36 +0200, Damien Cassou wrote:
>>>
>>>> test:=OrderedCollection with: 'first'.
>>>> test
>>>>    add: 'second';
>>>>    size negated
>>>>
>>>  (test add: 'second'; size) negated is what you can do with the result  
>>> of your cascaded messages.
>>
>> Maybe my example was not clear enough:
>
> No it was crystal clear.
>
>> test:= MyObjectModel
>> test
>>     getAllChanges;
>>     storageStrategy storeNow;
>>     readyToContinue
>
>   test
>       getAllChanges;
>       ifNotNil: [test storageStrategy storeNow];
>       readyToContinue
>
> does not compile (lack of support from parser/compiler) but
>
> | test |
> test := nil.
>   test
>       yourself;
>       ifNotNilDo: [:ignored | test yourself isNil];
>       yourself
>
> does.
>
>> I think it is clear that #storeNow is sent to the result of 'test  
>> storageStrategy'. And #readyToContinue should still be sent to 'test'
>
> See above, it is.
>
>> so   brackets are not possible in this example.
>
> Brackets are but parentheses aren't, in your 2nd example.
>
> /Klaus
>
>
>





More information about the Squeak-dev mailing list