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

@ -39,7 +39,8 @@
(chicken process-context)
(chicken format)
util-list
testing)
testing
util-proc)
;; Consumes given number of arguments from the list and returns the
;; remainder of the list and a list of arguments consumed.
@ -74,8 +75,7 @@
(when (not specp)
(error 'parse-command-line "Unknown argument" arg))
(let* ((proc (caddr specp))
(info (procedure-information proc))
(nargs (- (length info) 1))
(nargs (procedure-num-args proc))
(aargsl (consume-args (cdr args) nargs))
(args (car aargsl))
(aargs (cadr aargsl)))