From ...
From: Erik Naggum
Subject: Re: how to validate input?
Date: 2000/04/26
Message-ID: <3165721740371421@naggum.no>#1/1
X-Deja-AN: 615812913
References: <87wvlv75lf.fsf@inka.de> <3165639388940721@naggum.no> <3165662049043666@naggum.no> <8e4j47$87o$1@news.gte.com>
mail-copies-to: never
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: newsmaster@eunet.no
X-Trace: oslo-nntp.eunet.no 956735801 29310 195.0.192.66 (26 Apr 2000 07:56:41 GMT)
Organization: Naggum Software; vox: +47 8800 8879; fax: +47 8800 8601; http://www.naggum.no
User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5
Mime-Version: 1.0
NNTP-Posting-Date: 26 Apr 2000 07:56:41 GMT
Newsgroups: comp.lang.lisp
* ds26@goldshoe.gte.com (Dorai Sitaram)
| But tail-call optimization doesn't suffer from this arrogance. Quite to
| the contrary, it is more efficient use of the popular stack-based call
| frame in current, popular hardware.
I have looked around at implementations, and what I have found is that
the old call-frame is basically unwound to the exact same point where a
return from the function would occur, then a jump to the new function
takes place instead of a call, and a new call frame is set up, just as if
it were a normal function call. the savings is realized in that the
depth of the stack is not increased, but other than that, nothing, and
there is much loss to go with this gain: information about the caller
no longer exists.
| Again, I don't see how tail-call optimization can be tarred with the same
| brush as first-class continuations in this regard. TCO is precisely a
| willingness to deal with implementation issues. In fact, I've known
| semanticists to express dismay that TCO deals with "grubby"
| implementation choices.
the point I'm trying to get across is that _requiring_ proper tail
recursion is different from _optimizing_ for tail calls as an option.
the requirement is very much a semantic issue. I'm all for optimizing
tail calls when _I_ want to, and can make an informed choice. I'm
against a requirement. please understand the difference.
#:Erik