quchen / prettyprinter

A modern, extensible and well-documented prettyprinter.
BSD 2-Clause "Simplified" License
293 stars 34 forks source link

`surround` is poorly named #223

Open Ptival opened 2 years ago

Ptival commented 2 years ago

Surrounding means to put stuff all around.

From that, I'd infer that surround a [b, c, d] means either a b c d a, or a b a c a d a, but definitely not b a c a d, where b and d are not "surrounded by as.

The standard library use words like intersperse or intercalate, which imply much better the idea of putting things "in between" other things, rather than all around.