Re: Desperate Questions: [1]Absolute-Child-Number

Subject: Re: Desperate Questions: [1]Absolute-Child-Number
From: Paul Prescod <papresco@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 24 Jun 1997 15:22:54 -0400 (EDT)
> If you have an implementation of ipreced already, this is quite easy
> to do:
> 
>   (define (absolute-child-number snl)
>     (if (absolute-first-sibling? snl)
> 	1
> 	(+ 1 (absolute-child-number (ipreced snl)))))
> 
> Love that tail recursion!  

Is that tail recursion? The call to the function is kind of in the "tail
position" (I'm not sure of the definition) but it can't be implemented as 
a "goto" because the addition must still occur on the way back up.

 Paul Prescod


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread