Of what use is 'lambda'???
kragen at dnaco.net
Tue Sep 26 20:41:08 CEST 2000
In article <39D0C164.53FB928F at alcyone.com>,
Erik Max Francis <max at alcyone.com> wrote:
>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).
Typical C compilers returned the value of the last expression evaluated.
The deeper reason why C is not a functional language is that even
correct functions that use no uninitialized data can return values not
solely dependent on the inputs to the function, and in fact, they
almost always do depend on things like static data and data pointed to
by inputs to the function.
C implementations that provide garbage collection could be used to
program functionally, but due to the freedom C allows, it is unlikely
that it would be a particularly fast functional language.
<kragen at pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Perilous to all of us are the devices of an art deeper than we ourselves
-- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]
More information about the Python-list