Change default initializers from (lambda () #f) to #f.
authorJoe Marshall <eval.apply@gmail.com>
Fri, 1 Jul 2011 16:34:58 +0000 (09:34 -0700)
committerJoe Marshall <eval.apply@gmail.com>
Fri, 1 Jul 2011 16:34:58 +0000 (09:34 -0700)
src/runtime/defstr.scm
src/runtime/record.scm

index 49115a295be45ae94e3d2d4d6149d93300010365..652e811e4582a26d93ee9567c743b5b3dcd36509 100644 (file)
@@ -25,7 +25,7 @@ USA.
 |#
 
 ;;;; Structure Definition Macro
-;;; package: (runtime defstruct)
+;;; package: (runtime syntax defstruct)
 
 (declare (usual-integrations))
 \f
@@ -822,7 +822,10 @@ differences:
          (field-names (map slot/name slots))
          (inits
           (map (lambda (slot)
-                 `(LAMBDA () ,(close (slot/default slot) context)))
+                 (let ((default (slot/default slot)))
+                   (if (false-marker? default)
+                       #f
+                       `(LAMBDA () ,(close default context)))))
                slots)))
       `((DEFINE ,type-name
          ,(if (structure/record-type? structure)
index 0a1e58265085ef7fbffee9dd4dbb16bc1a08e21a..1a1a6cdb6daf782f2099044d7edd132241791a87 100644 (file)
@@ -75,7 +75,7 @@ USA.
                   #f
                   "record-type"
                   '#(DISPATCH-TAG NAME FIELD-NAMES DEFAULT-INITS EXTENSION)
-                  (vector-cons 5 (lambda () #f))
+                  (vector-cons 5 #f)
                   #f)))
     (set! record-type-type-tag (make-dispatch-tag type))
     (%record-set! type 0 record-type-type-tag)
@@ -155,7 +155,7 @@ USA.
                     #f
                     (->type-name type-name)
                     names
-                    (vector-cons n (lambda () #f))
+                    (vector-cons n #f)
                     #f))
           (tag (make-dispatch-tag record-type)))
       (%record-set! record-type 1 tag)