The Trunk: Collections-ul.401.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-ul.401.mcz

commits-2
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.401.mcz

==================== Summary ====================

Name: Collections-ul.401
Author: ul
Time: 2 November 2010, 6:27:15.942 pm
UUID: 0a1c53c0-73df-d84f-ab48-5d976d110df2
Ancestors: Collections-ul.400

- added Symbol >> #cull:, so unary symbols can be used instead of monadic blocks where #cull: is sent to them (e.g. #ifNotNil:)

=============== Diff against Collections-ul.400 ===============

Item was added:
+ ----- Method: Symbol>>cull: (in category 'evaluating') -----
+ cull: anObject
+
+ ^anObject perform: self!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Collections-ul.401.mcz

laza
commits-2 wrote
- added Symbol >> #cull:, so unary symbols can be used instead of monadic blocks where #cull: is sent to them (e.g. #ifNotNil:)
Sorry, I haven't followed any discussion on this. The intention is to be able to write stuff like this?

anInteger ifNotNil: #squared.
aCollection ifNotNil: #average.

instead of

anInteger ifNotNil: [:i | i squared].
aCollection ifNotNil: [:c | c average].

Alex
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Collections-ul.401.mcz

Levente Uzonyi-2
On Wed, 3 Nov 2010, laza wrote:

>
>
> commits-2 wrote:
>>
>> - added Symbol >> #cull:, so unary symbols can be used instead of monadic
>> blocks where #cull: is sent to them (e.g. #ifNotNil:)
>>
>
> Sorry, I haven't followed any discussion on this. The intention is to be
> able to write stuff like this?

#ifNotNil: was just an example, in the core image there's also #on:do: and
#onDNU:do: that can be written like this. It's compatible with VW and
Pharo 1.2 (and probably with other dialects too).

Here's a short thread about it:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2010-October/154307.html


Levente

>
> anInteger ifNotNil: #squared.
> aCollection ifNotNil: #average.
>
> instead of
>
> anInteger ifNotNil: [:i | i squared].
> aCollection ifNotNil: [:c | c average].
>
> Alex
>
> --
> View this message in context: http://forum.world.st/The-Trunk-Collections-ul-401-mcz-tp3024077p3025178.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Collections-ul.401.mcz

laza
Levente, thanks for digging this up!

Alex

2010/11/3 Levente Uzonyi <[hidden email]>:
> Here's a short thread about it:
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2010-October/154307.html