<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
It doesn't tail call because it evaluates x first, right?<br>
<br>
Robby Findler wrote:<br>
<blockquote type="cite"
cite="mid200307201347.h6KDlFxT039600@pimout5-ext.prodigy.net">
<pre wrap=""> For list-related administrative tasks:
<a class="moz-txt-link-freetext" href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
begin0 doesn't tail call any thing.
(begin0 E1 E2) = (let ([x E1]) (begin E2 x))
Robby
At Sun, 20 Jul 2003 15:36:34 +0200 (MEST), Stefan Ottosson wrote:
</pre>
<blockquote type="cite">
<pre wrap=""> For list-related administrative tasks:
<a class="moz-txt-link-freetext" href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
Hi,
I'm probably being naive, but shouldn't the following code be tail
recursive? It seems it isnt, unless you remove 'pop from the second
last line.
(define (faki n)
(define (iter n res)
(if (= n 0)
(continuation-mark-set->list
(current-continuation-marks) 'key)
(with-continuation-mark 'key (gensym 'env)
(begin0 (iter (- n 1) (* n res)) 'pop))))
(iter n 1))
(faki 3) returns (env32208 env32207 env32206) as written above. If I
erase 'pop then (faki 3) returns just (env32211).
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>