[Top][All Lists]

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

Re: [Help-smalltalk] Community sprint

From: Mike Anderson
Subject: Re: [Help-smalltalk] Community sprint
Date: Sat, 30 Sep 2006 12:01:38 +0000
User-agent: Mozilla Thunderbird 1.0.5 (X11/20050711)

David Given wrote:
> Mike Anderson wrote:
> [...]
>>I was warming to the first one. It looks like you're sending a block as
>>a message, which is odd, but not too odd. To think of a method body as a
>>block is very natural. Unfortunately, I've realized that it gives you no
>>opportunity to name the parameters. I suppose you could have:
> I may be missing something, but given that blocks *do* have named parameters,
> and that you can figure out how many parameters a message has from looking at
> the name, is there anything wrong with:
> String addMethod: #join: doing: [ :aCollectionOfStrings |
>       ...code here...
> ].
> and:
> String addMethod: #replace:with: doing: [ :source :dest |
>       ...code here...
> ].
> Admittedly, this doesn't give you the traditional "replace: source with: dest"
> syntax, but it does avoid having to invent anything too alien.

You're quite right, but I think that that declaration is no more
readable than a C function signature, whereas the traditional Smalltalk
signature is much more readable. Also, with the entire method definition
in square brackets, it looks the same as the contents of a method
browser in any other Smalltalk, examples in books, etc.



reply via email to

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