This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]