[squeak-dev] Re: Re: Block argument syntax

Louis LaBrunda Lou at Keystone-Software.com
Fri Mar 1 16:09:39 UTC 2013


+1 on all points.

Lou

On Fri, 1 Mar 2013 16:57:47 +0100, 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. 
>
>- Bert -
>
>
>
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou at Keystone-Software.com http://www.Keystone-Software.com



More information about the Squeak-dev mailing list