Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!ll-xn!mit-eddie!uw-beaver!ssc-vax!dickey From: dickey@ssc-vax.UUCP (Frederick J Dickey) Newsgroups: comp.lang.misc Subject: Re: H.O.Functions + Polymorphism Message-ID: <1332@ssc-vax.UUCP> Date: Thu, 9-Jul-87 10:08:53 EDT Article-I.D.: ssc-vax.1332 Posted: Thu Jul 9 10:08:53 1987 Date-Received: Sun, 12-Jul-87 10:07:16 EDT References: <...> <2637@crcge1.UUCP><1345@ogcvax.UUCP> Organization: Boeing Aerospace Corp., Seattle WA Lines: 27 In article <1345@ogcvax.UUCP>, pase@ogcvax.UUCP (Douglas M. Pase) writes: > In article gudeman@arizona.edu (David Gudeman) writes: > > > >Any language with functions can have higher order functions, and any > >language with the concept of `arguments' can have lazy evaluation of > >them. So how can these features be called advantages of functional > >programming? > > I do not yet see the advantages to lazy evaluation except in a few cases > which are academically interesting but of little practical use (all of which > involve an exact representation of an infinite sequence, such as the digits of > an irrational number). However, lazy evaluation is not supportable in > imperative languages as it is an 'evaluate on demand' strategy for function > parameter evaluation. All imperative languages evaluate the arguments to > functions before the function is invoked. I have not studied this particular > feature (lazy evaluation) in any great depth so my understanding may well be > partial. Years ago I was interested in programming language semantics, in particular, "fixed-point" semantics (I was a theory guy). My recollection is that "lazy evaluation"-type parameter passing strategies are much easier to describe formally than the way parameter passing is usually done in imperative languages. This was, to me at least, a counterintuitive result, since the "normal" way of passing parameters seems a lot simpler. I am inclined to regard this clash between theory and practice as a "hint" from theory that there is something wrong with the conventional view of parameter passing. of handling parameter passing seems a lot simpler.