Subject: Re: Lambda functions From: Erik Naggum <email@example.com> Date: Sat, 22 Sep 2001 23:40:00 GMT Newsgroups: comp.lang.lisp Message-ID: <firstname.lastname@example.org> * Kent M Pitman > I don't see anything in the ISO ISLISP spec that suggests that a lambda > expression is a function. Unless you can find a specific passage that > contradicts my belief, I'm pretty sure an implementation is buggy if it > lets you funcall a list whose car is LAMBDA. * Anette Stegmann > That surprises me. I only know old LISP dialects from the time between > 195X and 197X. Has something changed in the meantime? Your reading of what Kent wrote lacks the precision he put into it. > In my understanding a lamda expression is a way to notate a function. > > I am used to code like the following, IIRC: > > > ((lambda (x) (+ x x))2) > 4 > > > (setq f (lambda (x)(+ x x))) > > (f 4) > 8 If you really need exmples, the following form is what Kent was talking about (funcall '(lambda (x) (+ x x)) 3) None of your examples are funcalling a _list_, but are instead funcalling the value of an evaluated expression. Incidentally, the latter of your two examples presupposes a Lisp where functions and variables share the same value space. That is appropriate over in comp.lang.scheme. It is thus either (funcall f 4) or (setf (fdefinition 'f) ...) in a real Lisp. /// -- Why did that stupid George W. Bush turn to Christian fundamentalism to fight Islamic fundamentalism? Why use terms like "crusade", which only invokes fear of a repetition of that disgraceful period of Christianity with its _sustained_ terrorist attacks on Islam? He is _such_ an idiot.