scsh-0.6/scheme/bcomp/var-util.scm

22 lines
500 B
Scheme
Raw Permalink Normal View History

1999-09-14 08:45:02 -04:00
; Copyright (c) 1993-1999 by Richard Kelsey and Jonathan Rees. See file COPYING.
(define (number-of-required-args formals)
(do ((l formals (cdr l))
(i 0 (+ i 1)))
((not (pair? l)) i)))
(define (n-ary? formals)
(cond ((null? formals) #f)
((pair? formals) (n-ary? (cdr formals)))
(else #t)))
(define (normalize-formals formals)
(cond ((null? formals)
'())
((pair? formals)
(cons (car formals)
(normalize-formals (cdr formals))))
(else
(list formals))))