scalapuzzlers/scalapuzzlers.github.com — pull request #59 by som-snytt (2012-11-08 09:15:04+00:00)
Title: Updated #27 for more LOL, less loll.

This is not a definitive version, except for the title.

There are some style differences, like one-liners, reduced use of
braces, and an implicit class to enhance StringBuilder.

In a LOL vein, padTo is renamed pad2, and it is compared to the
padTo out of the box. (It must be renamed for the extension method.)

It seems to me that's worth addressing. The tradition of puzzlers
is broadly educational.

Does this puzzler result in a pithy Effective Scala meme? I feel
it ought to. Maybe something functional like: "Be results-oriented."
Because not attending to a result type is the error. I added the
suggestion to add type info to express expectation or intention,
to extract compiler help.

I don't think the Eclipse IDE has a mode yet where it shows all the
inferred types, the way it will show implicits.

The other thing that always comes up on the ML is, Can I already do
this with existing API.

Footnote, I originally assumed that r foreach sb.append(c) looked like
r foreach sb.append(c).apply, which is wrong. I could imagine adding
-Xprint:typer output so that people are aware that it's normal to
consult it.