From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!panix!news.stealth.net!news.stealth.net!uio.no!nntp.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: Why no call with current continuation? Date: 03 Oct 2002 14:01:40 +0000 Organization: Naggum Software, Oslo, Norway Lines: 34 Message-ID: <3242642500692368@naggum.no> References: <3D98D523.CE0C2B95@melbpc.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: maud.ifi.uio.no 1033653701 6089 129.240.65.5 (3 Oct 2002 14:01:41 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 3 Oct 2002 14:01:41 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:42836 * Dorai Sitaram | *print-length* being a special variable, right? Then, the call to foo is | not in a tail-call position. This is not as obvious as you think, either. The unwinding that would take place upon a return may well include special variable unbinding and unwind-protect execution so a call to a function inside both may well be able to inherit the call frame of the caller. The smart way to ensure that special variables are unbound and unwind-protect forms are always run is to arrange for the function to return to a system function that does the necessary clean-up. When you do this, neither special bindings nor unwind-protect forms would stand between you and tail-call merging. | [1] That said, I do know of a rather academic paper from the early 1980s | that treats getting something like special variables to not interfere | with tail-calls, but it may not be of interest here. Perhaps it is already widely implemented. | To clarify: I too doubt that TCE will become part of CL. It is already part of the implementations under suitable optimization. Unlike the Scheme world, Common Lisp vendors are allowed to be smarter than the specification. | IOW: while both TCE and call/cc are unlikely, call/cc is unlikelier. Perhaps you should try to study reality a little? Or is that unlikely? -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.