Define and export the default parameter procedures.
authorChris Hanson <org/chris-hanson/cph>
Sun, 28 Feb 2016 09:03:09 +0000 (01:03 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sun, 28 Feb 2016 09:03:09 +0000 (01:03 -0800)
src/runtime/dynamic.scm
src/runtime/runtime.pkg

index 9e2d495dacefba11875607ce1e4e99b580bba879..c14f225c8cd0dce7846f890b88ca21099f83b55e 100644 (file)
@@ -60,15 +60,19 @@ USA.
   (make-parameter-internal initial-value converter #t))
 
 (define (make-parameter-internal initial-value converter settable?)
-  (let ((noop (lambda (x) x)))
-    (make-general-parameter initial-value
-                           (if (default-object? converter)
-                               noop
-                               converter)
-                           noop
-                           (and settable?
-                                (lambda (set-param value)
-                                  (set-param value))))))
+  (make-general-parameter initial-value
+                         (if (default-object? converter)
+                             default-parameter-converter
+                             converter)
+                         default-parameter-getter
+                         (and settable?
+                              default-parameter-setter)))
+
+(define (default-parameter-converter value) value)
+(define (default-parameter-getter value) value)
+
+(define (default-parameter-setter set-param value)
+  (set-param value))
 
 (define (make-general-parameter initial-value converter getter setter)
   (guarantee-procedure converter 'make-general-parameter)
index d729778b685bb1abb086390dcb80d58f646767e8..e428c71678df873183210c55e27608fafb2cdc9d 100644 (file)
@@ -4615,6 +4615,9 @@ USA.
   (parent (runtime))
   (export ()
          (make-parameter make-settable-parameter)
+         default-parameter-converter
+         default-parameter-getter
+         default-parameter-setter
          parameter?
          make-general-parameter
          make-settable-parameter