Subject: Re: Returning Functions
From: Erik Naggum <clerik@naggum.no>
Date: 1997/10/02
Newsgroups: comp.lang.lisp
Message-ID: <3084810271646576@naggum.no>


* Aaron Leung
| Lisp is somewhat less simple/consistent than Scheme in the respect that
| functions are evaluated differently than other types of values and that
| they exist in different namespaces.  When you want to treat functions
| like values in Lisp, you have to prepend it with the #' (pronounced
| "sharp-quote").  The sharp-quote is an abbreviation of a special form
| called FUNCTION.  #'(lambda (x) (* x x)) is the same as (function (lambda
| (x) (* x x))), and the Scheme equivalent is just (lambda (x) (* x x)).

`lambda' is a macro in ANSI Common Lisp that returns itself as a function
object.  its definition is suggested in the specification.

    (defmacro lambda (&whole form &rest bvl-decls-and-body)
      (declare (ignore bvl-decls-and-body))
      `#',form)

discommending unquoted `lambda' forms may be the only point on which I
disagree with Paul Graham, but I think omitting the #' on `lambda' forms
makes perfect sense.  so did, apparently, a sufficient number of members of
the ANSI Common Lisp committee.

#\Erik
-- 
if you think this year is "97", _you_ are not "year 2000 compliant".

see http://www.naggum.no/emacs/ for Emacs-20-related material.