+1
It is of course a delicate subject matter, but I also like spaces inside
blocks, inside temporary declarations and after a return, this gives the code
more space to breath (hmm ;-), so not
inject: thisValue into: binaryBlock
"Accumulate a running value associated with evaluating the argument,
binaryBlock, with the current value of the argument, thisValue, and the
receiver as block arguments. For instance, to sum the numeric elements
of a collection, aCollection inject: 0 into: [:subTotal :next |
subTotal +
next]."
|nextValue|
nextValue := thisValue.
self do: [:each | nextValue := binaryBlock value: nextValue value:
each].
^nextValue
but
inject: thisValue into: binaryBlock
"Accumulate a running value associated with evaluating the argument,
binaryBlock, with the current value of the argument, thisValue, and the
receiver as block arguments. For instance, to sum the numeric elements
of a collection, aCollection inject: 0 into: [:subTotal :next |
subTotal +
next]."
| nextValue |
nextValue := thisValue.
self do: [ :each | nextValue := binaryBlock value: nextValue value:
each ].
^ nextValue
I always think of this a the Seaside style, but I am not sure if that is a
correct attribution.
Sven
On 12 Aug 2011, at 12:04, Stéphane Ducasse wrote:
> I know that you all have your own hyper cool view on formatting.
>
>
> ===========================================
> Now I would really like that we agree on the minimum
>
>
> put a space after a variable and before :=
>
> stamp: anObject
> "stores an author alias and a timestamp"
>
> stamp := anObject
>
> instead of
>
> stamp: anObject
> "stores an author alias and a timestamp"
>
> stamp:= anObject
>
>
> ===========================================
> Put a space before method argument
>
> stamp: anObject
> "stores an author alias and a timestamp"
>
> stamp := anObject
>
> instead of
>
> stamp:anObject
> "stores an author alias and a timestamp"
>
> stamp := anObject
>
>
> ===========================================
> Put a space after ifNil: ifTrue: ....
>
>
>