(let ((params (cadr form))
(body `(#!begin ,@(cddr form))))
;; Check parameter list now
(let loop ((params params))
(if (pair? params)
(loop (cdr params))
(unless (or (null? params) (symbol? params))
(error 'eval (cadr form) "Illegal parameter list"))))
(lambda args
"An interpreted procedure"
(eval body
(let loop ((frame '())
(args args)
(params params))
(cond
((symbol? params)
(cons `((,params . ,args) ,@frame) env))
((null? params)
(cons frame env))
(else ; must be a pair, we tested above
(loop
`((,(car params) . ,(car args)) ,@frame)
(cdr args)
(cdr params)))))))))