1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-16 00:29:50 +02:00

gpgscm: Generalize 'for-each-p'.

* tests/gpgscm/tests.scm (for-each-p): Generalize to N lists like
for-each.
(for-each-p'): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-12-08 15:39:05 +01:00
parent 3b5b94ceab
commit a2bedc8ac6

View File

@ -77,17 +77,18 @@
(flush-stdio))) (flush-stdio)))
(set! *progress-nesting* (- *progress-nesting* 1))) (set! *progress-nesting* (- *progress-nesting* 1)))
(define (for-each-p msg proc lst) (define (for-each-p msg proc lst . lsts)
(for-each-p' msg proc (lambda (x) x) lst)) (apply for-each-p' `(,msg ,proc ,(lambda (x . xs) x) ,lst ,@lsts)))
(define (for-each-p' msg proc fmt lst) (define (for-each-p' msg proc fmt lst . lsts)
(call-with-progress (call-with-progress
msg msg
(lambda (progress) (lambda (progress)
(for-each (lambda (a) (apply for-each
(progress (fmt a)) `(,(lambda args
(proc a)) (progress (apply fmt args))
lst)))) (apply proc args))
,lst ,@lsts)))))
;; Process management. ;; Process management.
(define CLOSED_FD -1) (define CLOSED_FD -1)