From ... From: Erik Naggum Subject: Re: Lisp with XML concrete syntax Date: 2000/11/28 Message-ID: <3184424063976812@naggum.net>#1/1 X-Deja-AN: 698772341 References: <3A2282F2.F853D9EB@removeme.gst.com> <8vu7ap$4j2$1@c3po.schlund.de> mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 975435422 3445 195.0.192.66 (28 Nov 2000 18:17:02 GMT) Organization: Naggum Software; vox: +47 800 35477; gsm: +47 93 256 360; fax: +47 93 270 868; http://naggum.no; http://naggum.net User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 Mime-Version: 1.0 NNTP-Posting-Date: 28 Nov 2000 18:17:02 GMT Newsgroups: comp.lang.lisp * Hannah Schroeter | And why not | | (defun factorial (x &optional (ac 1)) | (if (<= x 1) | ac | (factorial (1- x) (* ac x)))) There are many good reasons not to do tail-call merging for calls to global, user-defined functions. The function is conceptually distinct from the name, and while few people do it, you could copy the function over to a different symbol, and do something else with the old symbol. You _should_ expect to see it call the function in the old symbol, as that is the defined semantics of Common Lisp function calls. It also helps debugging and numerous other common tasks not to confuse symbol with function named by symbol. Local functions have no such restrictions, of course, being part of the function itself rather than depend on the symbol for its meaning. I consider the above code fragment tantamount to using dynamic binding simply out of tradition. The optional argument is another sign of old design and should be considered abuse of a language feature today. #:Erik -- Solution to U.S. Presidential Election Crisis 2000: Let Texas secede from the Union and elect George W. Bush their very first President. All parties, states would rejoice.