Use argument names procedure.

This commit is contained in:
Dominik Pantůček 2023-04-10 20:19:09 +02:00
parent c2c19c2d6a
commit edb6f14a9d
2 changed files with 6 additions and 2 deletions

View file

@ -84,8 +84,7 @@
;; String representation of procedure arguments. ;; String representation of procedure arguments.
(define (procedure->argstring proc) (define (procedure->argstring proc)
(let* ((info (procedure-information proc)) (let* ((args (procedure-arg-names proc))
(args (cdr info))
(argss (sprintf "~A" args))) (argss (sprintf "~A" args)))
(substring (substring
(substring argss 0 (- (string-length argss) 1)) (substring argss 0 (- (string-length argss) 1))

View file

@ -33,6 +33,7 @@
procedure-arity>? procedure-arity>?
procedure-num-args procedure-num-args
procedure-arg-names
) )
(import scheme (import scheme
@ -79,4 +80,8 @@
(let-values (((args rest?) (procedure-arity-info proc))) (let-values (((args rest?) (procedure-arity-info proc)))
args)) args))
;; Returns the formal argument names for given procedure
(define (procedure-arg-names proc)
(cdr (procedure-information proc)))
) )