[squeak-dev] Coding style

Chris Muller asqueaker at gmail.com
Wed Mar 10 21:30:40 UTC 2010


> aCollection
>        do: [ :each |
>                stream
>                        nextPut: $(;
>                        print: each;
>                        nextPut: $) ]
>        separatedBy: [
>                stream
>                        nextPut: $,;
>                        space ]
>
> You can notice the rectangular shape in both examples.

Just for discussion, this is how the pretty-printer proposed in the
inbox formats this:

	aCollection
		do:
			[ : each |
			stream
				 nextPut: $( ;
				 print: each ;
				 nextPut: $) ]
		separatedBy:
			[ stream
				 nextPut: $, ;
				 space ]

So it seems the main difference is that Levente prefers blocks to
start on the same rather than next line.  That could probably be made
a preference..


More information about the Squeak-dev mailing list