Of what use is 'lambda'???

Erik Max Francis max at alcyone.com
Tue Sep 26 17:31:48 CEST 2000


Jonadab the Unsightly One wrote:

> I thought void was added later as a concession to people who don't
> like throwing away values?  Didn't C originally return a value from
> every function?

In traditional C, yes.  void has been around for over a decade, however;
it was introduced to simply formalize what people were doing anyway: 
Declaring a function as returning int (often implicitly by leaving off
the return type), not having a return statement in it, and ignoring the
return value when calling it.  In some abstract sense, it is still
functional (it is returning some arbitrary value which is not being
used), but in all practicality it is a procedure (no return value),
which is used as such.  The introduction of void in ANSI simply
formalized that behavior.  In fact the above description demonstrates
that, when used in that manner, C was not functional; the return value
was not only unused, but was not solely dependent on the inputs to the
function (it was uninitialized data and so therefore arbitrary).

It was in fact a good idea to formalize that, because an unsuspecting
client using a return value from a function which was being used
procedurally would result in undefined behavior (using an uninitialized
value).

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Love is the wisdom of the fool and the folly of the wise.
\__/ Samuel Johnson
    Alcyone Systems' CatCam / http://www.catcam.com/
 What do your pets do all day while you're at work?  Find out.



More information about the Python-list mailing list