[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proper tail recursion proposal, take 2

My original concern is resolved.  Not to be nitpicky, but I just plain
don't understand this sentence:

  A Scheme implementation is
  properly tail-recursive if it supports an unbounded number of active
  tail calls (a call is {\em active} if the called procedure may still

In this, are you saying that if F calls G normally and G calls H as a tail
call then F, G, and H are still active?  The parenthetical remark would seem
to describe G as inactive, since it can no longer return--H will return 
directly to F, and and G is effectively inactive.  But if I'm to believe there
is an unbounded number of active tail calls permitted, I presumably must model
G as still "active" even when removed from the "stack" or "chain" of calls.
To clarify, the wording that makes sense to me (but seems in conflict with
your chosen terms above) would be:

  A Scheme implementation is {\em properly tail recursive} if making a tail
  call does not increase the number of {\em active} functions (i.e., functions
  that are still waiting to return).

However, this is not a specific proposal for change.  In truth, I kinda liked
the old wording which talked about not using additional space, etc.  It seemed
somehow more precise. I guess I can infer that if it has enough space for
many that it must have enough space for 1, but...