Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 3 Forum
Date: Thu Sep 27 2001 7:38 pm
Author: Danish, Matt R. <mrd@cmu.edu>
Subject: Re: recursive

thanks, matt. i never knew "tail recursion" was special. but let me clarify my little example

All iteration can be represented as "tail recursion", that's why it's notable (especially in a functional language)

it doesn't seem like "recursion" to me because it isn't really calling itself... well, it kind of is, but its calling an implementation of itself in another instance of the same class.

That's why I changed the syntax in my previous example: It's really calling the same method, but with a different argument. If you forget about the whole "." notation, this becomes apparent. Consider the instance as the "0th parameter". Hope that helps.

Post response

Go to the previous messageGo to the following message
Current Thread Detail:
recursive      Cipriani, Jason A.      Thu Sep 27 2001 9:55 am       
Re: recursive      White, David      Thu Sep 27 2001 12:08 pm       
Re: recursive      Yuen, John      Thu Sep 27 2001 12:15 pm       
Re: recursive      Danish, Matt R.      Thu Sep 27 2001 12:42 pm       
Re: recursive      Cipriani, Jason A.      Thu Sep 27 2001 4:16 pm       
Re: recursive      Danish, Matt R.      Thu Sep 27 2001 7:38 pm       
Re: recursive      Lee, Peter      Fri Sep 28 2001 9:44 am       
Re: recursive      Danish, Matt R.      Fri Sep 28 2001 11:35 am       
Re: recursive      Lee, Peter      Fri Sep 28 2001 12:43 pm       

Back to previous screen