[gambit-list] "Number of arguments exceeds implementation limit" error

Anton van Straaten anton at appsolutions.com
Sun Sep 3 16:00:27 EDT 2006


Bill Richter wrote:
> But maybe you can give me a Scheme tip
> to fix this problem of mine without recompiling.  

Instead of using "apply append", which is trying to call append with 
more arguments than (your version of?) Gambit can handle, do the 
appending recursively, one list at a time.  You can use a fold function 
to do this, which you can get from SRFI-1, but it's also easy to define 
your own, e.g.:

(define (fold-right proc nil lst)
   (if (null? lst) nil
       (proc (car lst) (fold-right proc nil (cdr lst)))))

Now you can write your program like this:

(fold-right append '()
   (filter-map (lambda (or-chain) <rest of the code...>)))

> BTW I've been posting a lot of Mike Mepham's Sudoku newsgroup
> http://www.sudoku.org.uk/cgi-bin/discus/discus.cgi?pg=topics Mostly
> I've been trying to teach these Sudoku hotshots the meaning of words
> like logic & axiom.  I'm not having much more success than I had a few
> years ago on comp.lang.scheme trying to teach the CS profs how one
> constructs mathematical function between two sets.

Oh, the humanity.  Perhaps someone should refer the sudoku people to: 
http://www.ccs.neu.edu/home/will/Ephemera/richterFAQ.html

Anton



More information about the Gambit-list mailing list