Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: The --> "operator"
On Wed, Jul 08, 2026 at 06:56:01 -0400, Greg Troxel wrote:
> I would like to see our style guide say explicitly that --> is not
> allowed.
Technically "-->" already runs afoul of style's requirement that
"unary operators don't require spaces, binary operators do."
While
while (index --> 0)
reads "nicely" and highlights the idiom, the "classical" spelling
while (index-- > 0)
is not too bad. And you have to know the idiom *either* way, but if
you don't know the "-->" pun, you are likely to be ioccc-level
confused when you encounter it in the wild. OTOH, the classical
spelling doesn't obscure the idiom if you know it and does not confuse
an unfamiliar reader, who can still easily see what's going on (even
if it doesn't register as an idiom for them).
I'm also pretty sure you can teach emacs to show "-- >" as " ⤵"
ligature or something fancy like that if you know the idiom and want
to further highligt it in the sources. :)
I love puns, (especially bad puns :), but ... "Consider the
furniture!"
PS: I forgot about the unsigned gotcha. Should we add that explained
to style (with the classical spelling of course :)?
-uwe
Home |
Main Index |
Thread Index |
Old Index