The question is how much will we have to backport.
Because we do not have that horse power to do that for each little details.
I would only backport really important fixes.
Stef
On Dec 27, 2009, at 7:58 PM, Nicolas Cellier wrote:
> 2009/12/27 Lukas Renggli :
>>> Julian: we (stef and I) have som
2009/12/27 Lukas Renggli :
>> Julian: we (stef and I) have something we don't understand. The
>> implementation of ifEmpty: is like this in Pharo:
>>
>> Collection >> ifEmpty: aBlock
>> "Evaluate the block if I'm empty"
>>
>> self isEmpty ifTrue: [ ^aBlock value ]
>
> In Pharo 1.0rc1 it loo
> Julian: we (stef and I) have something we don't understand. The
> implementation of ifEmpty: is like this in Pharo:
>
> Collection >> ifEmpty: aBlock
> "Evaluate the block if I'm empty"
>
> self isEmpty ifTrue: [ ^aBlock value ]
In Pharo 1.0rc1 it looks like this:
Collection>>ifEmpty: a
On Sat, Dec 26, 2009 at 11:44 PM, Julian Fitzell wrote:
> Personally, I would rather see #ifEmpty: modified to return self in
> the false case like #ifNil: does. The only in-image sender I can find
> that even uses the return value seems to actually expect this
> behaviour anyway. :)
>
>
Julian:
>> Personally, I would rather see #ifEmpty: modified to return self in
>> the false case like #ifNil: does. The only in-image sender I can find
>> that even uses the return value seems to actually expect this
>> behaviour anyway. :)
+1
> what is the behavior in other dialects ? :)
> Do you have s
I forgot open a bug tracker entry because we should not lose the suggestion.
On Dec 26, 2009, at 11:44 PM, Julian Fitzell wrote:
> Personally, I would rather see #ifEmpty: modified to return self in
> the false case like #ifNil: does. The only in-image sender I can find
> that even uses the retur
On Dec 26, 2009, at 11:44 PM, Julian Fitzell wrote:
> Personally, I would rather see #ifEmpty: modified to return self in
> the false case like #ifNil: does. The only in-image sender I can find
> that even uses the return value seems to actually expect this
> behaviour anyway. :)
what is the beh
Hi,
that seems like a very good suggestion. Is more general usable also.
Regards,
Bart
On Sat, Dec 26, 2009 at 11:44 PM, Julian Fitzell wrote:
> Personally, I would rather see #ifEmpty: modified to return self in
> the false case like #ifNil: does. The only in-image sender I can find
> that e
Personally, I would rather see #ifEmpty: modified to return self in
the false case like #ifNil: does. The only in-image sender I can find
that even uses the return value seems to actually expect this
behaviour anyway. :)
Then you could simply write:
(aCollection select: [:ea | ...]) ifEmpty: [ ..
Dear all,
While developing some code, I made following extension of the Collection
protocol:
select: aBlock ifNoneTakeAsDefault: aDefaultValue
|result|
result := self select: aBlock.
(result isEmpty)
ifTrue: [^self class with: aDefaultValue]
ifFalse: [^result].
Maybe this co
10 matches
Mail list logo