Revert eta-expansion change.
authorJoe Marshall <jmarshall@alum.mit.edu>
Sat, 5 Sep 2009 22:58:51 +0000 (15:58 -0700)
committerJoe Marshall <jmarshall@alum.mit.edu>
Sat, 5 Sep 2009 22:58:51 +0000 (15:58 -0700)
src/runtime/sysmac.scm

index f4df40ecb0e0f32e59a192acc27a27e19d2f09f2..3550d67ef9ad325d705c199cc453e0fc0c146ce5 100644 (file)
@@ -34,9 +34,18 @@ USA.
      environment
      (let ((primitive-definition
            (lambda (variable-name primitive-args)
-             `(DEFINE-INTEGRABLE ,variable-name 
-                ,(apply make-primitive-procedure primitive-args))
-             )))
+             (let ((primitive
+                    (apply make-primitive-procedure primitive-args)))
+               (let ((arity (procedure-arity primitive)))
+                 (if (eqv? (procedure-arity-min arity)
+                           (procedure-arity-max arity))
+                     (let ((names
+                            (map (lambda (n) (symbol 'a n))
+                                 (iota (procedure-arity-min arity) 1))))
+                       `(DEFINE-INTEGRABLE (,variable-name ,@names)
+                          (,primitive ,@names)))
+                     `(DEFINE-INTEGRABLE ,variable-name
+                        ,primitive)))))))
        `(BEGIN ,@(map (lambda (name)
                        (cond ((not (pair? name))
                               (primitive-definition name (list name)))