Build-out validation

This commit is contained in:
Justin Ethier 2019-09-10 17:11:38 -04:00
parent da4ffd84a3
commit dba849ae62

View file

@ -24,15 +24,23 @@
(error "Too many arguments" exp))))) (error "Too many arguments" exp)))))
(define (check-define exp) (define (check-define exp)
'todo) (let ((args (length exp)))
(cond
((< args 2)
(error "Not enough arguments" exp)))))
(define (check-set exp) (define (check-set exp)
'todo) (let ((args (length exp)))
(cond
((< args 2)
(error "Not enough arguments" exp)))))
(define (check-lambda exp) (define (check-lambda exp)
;(difference (reduce union (map search (lambda->exp exp)) '()) (let ((num-args (length exp)))
; (lambda-formals->list exp)) (cond
'todo) ((< num-args 2)
(error "Not enough arguments" exp))))
(lambda-formals-type exp)) ;; Validates type information
;; TODO: could check primitives, etc ;; TODO: could check primitives, etc