Use MAKE-LAMBDA-LIST rather than ad-hoc code.
authorJoe Marshall <eval.apply@gmail.com>
Mon, 6 Feb 2012 19:55:19 +0000 (11:55 -0800)
committerJoe Marshall <eval.apply@gmail.com>
Mon, 6 Feb 2012 19:55:19 +0000 (11:55 -0800)
src/sf/tables.scm

index 6f9c5cb3b80d6258c81ce661e32b30954a0b5ef9..2196ced4e1316a83ece27ad1e32ca45b06c9201d 100644 (file)
@@ -87,14 +87,11 @@ USA.
   (define (procedure->pretty procedure)
     (if (procedure/scode procedure)
        (unsyntax (procedure/scode procedure))
-       (let ((arg-list (append (procedure/required procedure)
-                               (if (null? (procedure/optional procedure))
-                                   '()
-                                   (cons lambda-tag:optional
-                                         (procedure/optional procedure)))
-                               (if (not (procedure/rest procedure))
-                                   '()
-                                   (procedure/rest procedure)))))
+       (let ((arg-list (make-lambda-list
+                        (procedure/required procedure)
+                        (procedure/optional procedure)
+                        (procedure/rest procedure)
+                        '())))
          (if (procedure/name procedure)
              `(named-lambda (,(procedure/name procedure) ,@arg-list)
                 ...)