Dropping “naked” local blocks?

Mark "Justin" Waks
1 min readNov 16, 2019

--

Early warning on this one (not even a PR yet, just an issue): Martin has proposed dropping support for “naked” local blocks in code — that is, code blocks that aren’t associated with a function call, that just introduce a new scope.

The rationale makes sense: these naked blocks only reliably do what you expect if they are preceded by a blank line, so they are brittle and tend to introduce bugs. And it’s not a huge change, since the locally function (which does the same thing) will still be around. So the change is basically to drop the fragile naked-block construct in favor of enforcing the more-reliable locally.

Still and all, this isn’t a terribly rare usage, so folks should be aware of it. If you have an opinion, chime in at the issue linked above.

--

--

Mark "Justin" Waks
Mark "Justin" Waks

Written by Mark "Justin" Waks

Lifelong programmer and software architect, specializing in online social tools and (nowadays) Scala. Architect of Querki (“leading the small data revolution”).

No responses yet