>>>> Oliver Scholz writes:
> But, alas, unless I am much mistaken, proper tail recursion is simply
> impossible in a dynamically scoped environment.
http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/67f125f9137b5abd/4d988a8e68fa2725?q=tail+recursion&rnum=1#4d988a8e68fa2725
Common Lisp has dynamic variables (defvar ...) and many implementations
provide tail recursion optimization. Is Oliver wrong or do dynamic
variables some how complicate tail recursion optimization?
--fj
"funkyj" <······@gmail.com> writes:
>>>>> Oliver Scholz writes:
>
>> But, alas, unless I am much mistaken, proper tail recursion is simply
>> impossible in a dynamically scoped environment.
>
> http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/67f125f9137b5abd/4d988a8e68fa2725?q=tail+recursion&rnum=1#4d988a8e68fa2725
>
> Common Lisp has dynamic variables (defvar ...) and many implementations
> provide tail recursion optimization. Is Oliver wrong or do dynamic
> variables some how complicate tail recursion optimization?
Yes, Common Lisp has dynamic variable.
Common Lisp also has logical pathnames.
Please, redact three pages about the impact of logical pathnames on
the TCO of:
(defun fact (x &optional (f 1)) (if (< x 1) f (fact (1- x) (* x n))))
--
__Pascal Bourguignon__ http://www.informatimago.com/
Un chat errant
se soulage
dans le jardin d'hiver
Shiki
"funkyj" <······@gmail.com> writes:
> >>>> Oliver Scholz writes:
>
> > But, alas, unless I am much mistaken, proper tail recursion is simply
> > impossible in a dynamically scoped environment.
>
> http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/67f125f9137b5abd/4d988a8e68fa2725?q=tail+recursion&rnum=1#4d988a8e68fa2725
> Common Lisp has dynamic variables (defvar ...) and many implementations
> provide tail recursion optimization. Is Oliver wrong or do dynamic
> variables some how complicate tail recursion optimization?
Yes he is, but yes they do. There was a discussion on this in this group a few
days ago, which you might want to read.
<http://www.google.com/search?&q=dynamic%20scope%20tail%20call>
also looks promising
'as