[squeak-dev] Block argument syntax
Eliot Miranda
eliot.miranda at gmail.com
Sat Mar 2 01:03:21 UTC 2013
On Fri, Mar 1, 2013 at 7:57 AM, Bert Freudenberg <bert at freudenbergs.de>wrote:
>
> On 2013-03-01, at 16:48, Chris Muller <asqueaker at gmail.com> wrote:
>
> >> I know this is true for a number of Smalltalk implementations. I found
> it
> >> very surprising also. Someone I worked with always formatted their code
> >> this way. He said it made it easier to double click and highlight the
> >> variable. I wasn't sure that was enough reason to do it but he did.
> >
> > So, score +1 for ": x" but ":x" is still left with a score of 0. What
> > is the advantage of writing ":x"?
>
> One char less. Better visual grouping of multiple arguments.
>
> (1) [:a :b|a+b]
> (2) [:a :b | a + b]
> (3) [ :a :b | a + b ]
> (4) [ : a : b | a + b ]
>
> In my eyes, (2) is the best compromise between conciseness and readability.
>
For me it's
(5) [:a :b| a+b]
;)
>
> - Bert -
>
>
>
>
--
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130301/77fe6f23/attachment.htm
More information about the Squeak-dev
mailing list
|