Use number of procedure arguments function from util-proc in command-line.

This commit is contained in:
Dominik Pantůček 2023-04-10 20:16:21 +02:00
parent 147afa3ab4
commit c2c19c2d6a
4 changed files with 16 additions and 9 deletions

View file

@ -54,7 +54,8 @@
(import scheme
(chicken base)
testing
util-tag)
util-tag
util-proc)
;; Tag used for identifying list dictionaries from this module
(define TAG-LDICT (make-tag LDICT))
@ -162,9 +163,8 @@
;; accepts more than one argument. If it accepts a third argument,
;; index gets passed as well.
(define (ldict-map proc ld)
(let* ((lpi (length (procedure-information proc)))
(both? (> lpi 2))
(index? (> lpi 3)))
(let ((both? ((procedure-arity>=? 2) proc))
(index? ((procedure-arity>=? 3) proc)))
(let loop ((pairs (ldict-pairs ld))
(res '())
(i 0))