This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Unnamed functions, functors or, more formally, function literals
- From: dewar at gnat dot com (Robert Dewar)
- To: dewar at gnat dot com, sd70030 at lanet dot lv
- Cc: gcc at gcc dot gnu dot org, kewarken at qnx dot com, pkoning at equallogic dot com
- Date: Mon, 18 Mar 2002 09:37:58 -0500 (EST)
- Subject: Re: Unnamed functions, functors or, more formally, function literals
<<This is not a sintactical sugar, this reduces an overhead required
from a programmer wanting to define a small anonymous function, and
it, nevertheless, fits well into C, it even accurately follows from
a current C standard (see my reply to Bo Thornsen).
>>
By the way sntactic sugar is all about "reducing overhead required
from a programmer wanting [to do something or other]"
so your comment here is a bit strange. Indeed your further comment that
this is always translatable to standard C confirms that we are talking
about syntactic sugar here :-)
Nested functions as implemented in GNU-C are of course much more than
SS, since they provide a fundamental expressive capability not present
in standard C.
By the way, regarding syntactic sugar, to me a much stronger argument is
that they make the code more readable rather than that they provide a
convenience for the writer.
For me, most of the time, it is actively desirable to name the function
involved, so that's why I prefer (from the reader's point of view) to
see nested named functions used for this purpose.