Path: utzoo!attcan!uunet!husc6!purdue!bouma From: bouma@cs.purdue.EDU (William J. Bouma) Newsgroups: comp.lang.lisp Subject: Re: Functions vs. Procedures in Lisp Summary: why all this CRAP about functions? Message-ID: <4369@medusa.cs.purdue.edu> Date: 18 Jun 88 00:56:03 GMT References: <34296@linus.UUCP> <1350017@otter.hple.hp.com> Organization: Department of Computer Science, Purdue University Lines: 43 In article <1350017@otter.hple.hp.com> psa@otter.hple.hp.com (Patrick Arnold) writes: >John Gately is quite right to point out that function has sevral meanings >depending on the context of the conversation. I'm afraid it's one of my >"religious beliefs" that functions are expressions which denote values and >that calling a function with the same actual parameters will always produce >the same result and will have no insidious effects on other parts of the >system (i.e. side effects). This is the mathematical concept of a function. >I am quite happy with the other use provided the meaning is agreed at the >outset. > ... > >I hope this explanation gives you some hints as to why I don't think LISP >has functions in the true sense (although you can write inefficient Lisp >programs that are functional). Whether a language has functions or not seems to me a very different thing from whether a language is FUNCTIONAL (ie. everything is a function). I believe one can write functionally in LISP and have the result be as efficient as the non-functional equivalent. For one thing some compilers will optimize out tail recursion into an iterative loop. For the other part it depends on what you are programming and what algorithms you use. I don't know what version of LISP you are talking about, but I don't remember any language since BASIC that FORCED me to write a FUNCTION (or whatever the crap ypu want to call it) that had side effects. THUS LISP DOES have functions in the mathematical sence. Isn't + a FUNCTION? How about (lambda (x) x)? Aren't these TRUE enough functions for you??? Personally I am sick of this whole discussion. What is the point? Who cares if what one person calls a FUNCTION, another calls a "Procedure with returned value"? Yes, in the context of a specific conversation it would be important for the parties to have equivalent definitions, but in general NO. Who cares what mathematics' definition of function is? Mathematics is NOT programming! Any mathematicians reading this USE MACSYMA. ASSIDE: I cast my vote FOR Common Lisp. I have never had much problem writting programs in it whether I used dynamic binding or not. There is one little thing that annoys me about it, but it is hardly enough to get all excited and write 100+ line article about. Well, maybe tomorrow... ------------------------------------------------------------------------------- bouma@medusa.cs.purdue.edu | Just spending my days, ...!purdue!bouma | Soaking up those cathode rays.