[squeak-dev] Formatting?

Chris Muller asqueaker at gmail.com
Thu Jun 2 22:55:47 UTC 2016


> There shouldn’t be a space before a cascading semicolon though.

That one might be easy to fix..

> I also noticed a bug where sometimes there is no space between multiple args to a block, e.g. in Behavior>>allSubclassesWithLevelDo:startingLevel:.
>
> And it still produces excessively tall code. This:
>
>         classAndLevelBlock
>                 value: self
>                 value: level.
>
> ... should be on one line. And if possible
>
>
>         0
>                 to: height - 1
>                 by: 16
>                 do:
>                         [:y | ...
>
> should be
>
>         0 to: height - 1 by: 16 do:
>                 [:y | ...
>
> The rule being something like “if only the last arg is complex, put the message on one line, and the last arg indented by one on the next”.

Right, and also, if the block only has "one statement" in it, should
go on one line, but IIRC "one statement" from POV of a BlockNode (or
whatever it was) could still be a complex multi-line argument
(parenthesis, etc.), so I gave up had it always just does this:

       envelopes do:
            [ : e | e duration: seconds ]

instead of all on one line.  The Command+[Delete] key helps clean that up.  :)

So its been a trade-off for me.  I find myself still having to do some
manual "clean up" formatting after pretty-printing but, overall, worth
it enough for me that I've been running a dirty Compiler package for
many years..


More information about the Squeak-dev mailing list