How dare you!? ;-)
2010/12/9 Stéphane Rollandin <
[hidden email]>:
> Hello,
>
>
> I just wanted to share the following method, which comes in handy when one
> wants a receiver to be considered always as a collection, possibly by
> lifting it as a singleton (reminds you of something, Chris ?)
>
> Object>>orMoreDo: aBlock
> ^ aBlock value: self
>
> Collection>>orMoreDo: aBlock
> ^ self do: aBlock
>
>
> example:
>
> 4 orMoreDo: [:x | Transcript show: x + 1]
> (4 to: 7) orMoreDo: [:x | Transcript show: x + 1]
>
>
> I don't know if this is generally useful; it has proven useful to me at
> least...
>
>
> Stef
>
>