On Sa, 2020-04-25 at 09:11 -0400, Noel Chiappa wrote:
From: Rob Pike
Convenient though the shorthand may be, it always
bothered me as
inconsistent and misleading.
As someone who made very extensive use of procedure pointers (most notably in
upcalls, which never caught on, alas), I couldn't agree more.
Two very different things are happenging, but with the shorthand notation,
they share an identical representation. And for what? To save three characters?
The subject can be looked at from another angle. Consider
the call f(42). This might be read as first naming f (and
thus constructing a pointer to f) and then calling the
function which the pointer is pointing to. So at least
it should be possible to write the call as (*f)(42), which
indeed is equivalent to f(42). So it can be argued that
this notational shorthand should be allowed with all
function pointers.
Hellwig