From ... Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!193.190.198.17!newsfeeds.belnet.be!news.belnet.be!news2.kpn.net!news.kpn.net!nslave.kpnqwest.net!nloc.kpnqwest.net!nmaster.kpnqwest.net!nreader3.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: function and lambda, again Mail-Copies-To: never From: Erik Naggum Message-ID: <3224278790110217@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 43 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Mar 2002 00:59:42 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader3.kpnqwest.net 1015289982 193.71.199.50 (Tue, 05 Mar 2002 01:59:42 MET) NNTP-Posting-Date: Tue, 05 Mar 2002 01:59:42 MET Xref: archiver1.google.com comp.lang.lisp:27792 This is a fairly useless suggestion, probably annoying, but there might also be some obcure, but very valuable history lesson hidden underneath this, so if you permit me the useless, annoying suggestion as a means to an end... (lambda (argument-list) body) (function function-name) Recall that a function-name is a symbol or a list. If lambda is an undesirable choice of name, function could assume both roles, as it is disambiguated by its required one argument and lambda needs a body. In the degenerate case of a lambda with no body, its arguments, if any, are unused and could need a declaration to that effect. The empty argument-list is disambiguated from the function nil by the inability (or at least extremely poor taste) to name a function nil. In other words, here is the proposal: Replace lambda with function, and arrive at something like this: (function (x) (mumble-frotz x)) Now, I am not allowed to set up a macro for cl:function, but I can create my own package and do the following there: (defmacro function (first &rest rest) (if rest `(cl:lambda ,first ,rest) `(cl:function first))) This macro could, if necesary, walk through the body and discovery free variables and make it possible to distinguish function and closure (a subclass of function), which would then have its own "constructor". I am actually more curious how "lambda" became the name of this operator and if something else has been proposed and rejected, and if, why. /// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.