help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Re: Object>>#do: ???


From: Stephen Compall
Subject: [Help-smalltalk] Re: Object>>#do: ???
Date: Wed, 06 Jun 2007 12:23:29 -0500

On Wed, 2007-06-06 at 16:54 +0200, Paolo Bonzini wrote:
> You did realize that this is also subsuming
> 
>      do: aBlock [ aBlock value: self ]
> 
> didn't you? :-P

Indeed, it is the ultimate reduction of the principle initially
presented by Object>>#do:.

Though one might moreover expect

| arrayResult |
arrayResult := aMessage sendTo: {self}.
(arrayResult isArray and: [arrayResult size = 1])
    ifTrue: [arrayResult first]
    ifFalse: [arrayResult]

-- 
;;; Stephen Compall ** http://scompall.nocandysw.com/blog **
Failure to imagine vast possibilities usually stems from a lack of
imagination, not a lack of possibility.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]