1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-23 12:00:21 +02:00

(language tree-il analyze) works better with RTL programs

* module/system/vm/program.scm (program-arguments-alists): Export this
  interface.  Fall back to grovelling through procedure-minimum-arity if
  the program has no arities, as might be the case for continuations.

* module/language/tree-il/analyze.scm (validate-arity): Use
  program-arguments-alists instead of the program-arities interface, to
  cover both stack VM and RTL programs.
This commit is contained in:
Andy Wingo 2013-10-18 18:41:59 +02:00
parent b0ca878cae
commit 8bd261baaa
2 changed files with 18 additions and 10 deletions

View file

@ -950,13 +950,15 @@ given `tree-il' element."
(or (and (or (null? x) (pair? x))
(length x))
0))
(cond ((program? proc)
(cond ((or (program? proc) (rtl-program? proc))
(values (procedure-name proc)
(map (lambda (a)
(list (arity:nreq a) (arity:nopt a) (arity:rest? a)
(map car (arity:kw a))
(arity:allow-other-keys? a)))
(program-arities proc))))
(list (length (or (assq-ref a 'required) '()))
(length (or (assq-ref a 'optional) '()))
(and (assq-ref a 'rest) #t)
(map car (or (assq-ref a 'keyword) '()))
(assq-ref a 'allow-other-keys?)))
(program-arguments-alists proc))))
((procedure? proc)
(if (struct? proc)
;; An applicable struct.