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

srfi-101 reference implementation missing ra:for-each

The reference implementation srfi-101.sls is missing ra:for-each,
even though it is exported.  Was it only tested on implementations
that don't catch missing definitions?

Also, ra:list-update is defined but not used or exported.

Here is an implementation or ra:for-each that seems to work
in Kawa (not uses case-lambda):

  (define (ra-for-each f . lss)
    (cond ((and (pair? lss) (null? (cdr lss)))
           (let ((ls (car lss)))
             (let recr ((ls ls))
               (if (kons? ls)
                   (begin (tree-for-each f (kons-tree ls))
                          (recr (kons-rest ls)))))))
           ;;(check-nary-loop-args 'ra-map (lambda (x) x) f lss)
           (let recr ((lss lss))
             (if (not (ra-null? (car lss)))
                 ;; IMPROVE ME: make one pass over lss.
                   (tree-for-each/n f (map kons-tree lss))
                   (recr (map kons-rest lss))))))))

	--Per Bothner
per@xxxxxxxxxxx   http://per.bothner.com/