Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Scheme > Re: How does Sc...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 4623 of 4716
Post > Topic >>

Re: How does Scheme know if a func is tail-recursive or not?

by William D Clinger <cesura17@[EMAIL PROTECTED] > Jul 21, 2008 at 09:30 PM

ssecorp wrote:
> Scheme requires tail-call-optimization.

Scheme actually requires implementations to be properly
tail recursive, which is stronger than most optimizations
that people generally refer to as tail call optimization [1].

> But how does Scheme know or react?

Implementations of Scheme must treat tail contexts
differently from non-tail contexts.  That is easy,
although it involves breaking with some old ways
of thinking about procedure calls.

> Because when I use tree-recursion DrScheme never complains.

Nor should it.  Tree recursion is legal in Scheme.

> According to :
>
http://www.biglist.com/lists/lists.mulberrytech.com/dssslist/archives/199907/msg00389.html
> it s aslo undecidable if unerstood it correctly.

You are conflating at least two distinct concepts.

Whether a program you write will run in a bounded
amount of space is undecidable.

Whether an arbitrary implementation is properly tail
recursive is also undecidable, but nobody cares
about arbitrarily stupid implementations.

With a well-designed implementation of Scheme,
it should be easy to see that the implementation
is properly tail recursive in the mandated sense.

Will

[1] William D Clinger.  Proper tail recursion and space
efficiency.  In the Proceedings of the 1998 ACM Conference
on Programming Language Design and Implementation,
June 1998, pages 174-185.  Online at
ftp://ftp.ccs.neu.edu/pub/people/will/tail.ps.gz
 




 2 Posts in Topic:
How does Scheme know if a func is tail-recursive or not?
ssecorp <circularfunc@  2008-07-21 19:55:32 
Re: How does Scheme know if a func is tail-recursive or not?
William D Clinger <ces  2008-07-21 21:30:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 15:33:51 CDT 2008.