[gambit-list] "Number of arguments exceeds implementation

Bill Richter richter at math.northwestern.edu
Wed Sep 6 11:30:26 EDT 2006


   >(define (filter-map/tail fn tail lis . morelis) [...] )
   >
   >Christian, your code isn't tail-recursive, right?

   No it's not - it can't be if the order of the output should be the
   same as the input (and mutation isn't used).

Thanks, Christian.  That's a very helpful way to put it: functions
like map can't be tail-recursive if they preserve the order unless we
use mutation.  (Unless you throw in some `reverse's) I had noted that
mutation was used in various tail-recursive map-like functions, but I
had only dimly noted the rule.

I have my Sudoku code working now.  It takes too long, but 
1) quite likely that's because of beginner tail-recursion problems
2) The real problem was some "infinite loops" that I fixed.



More information about the Gambit-list mailing list