From 9f937ebc6b1c7d784e64d71ca2c5b207b2b789f3 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 28 Feb 2016 01:03:09 -0800 Subject: [PATCH] Define and export the default parameter procedures. --- src/runtime/dynamic.scm | 22 +++++++++++++--------- src/runtime/runtime.pkg | 3 +++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/runtime/dynamic.scm b/src/runtime/dynamic.scm index 9e2d495da..c14f225c8 100644 --- a/src/runtime/dynamic.scm +++ b/src/runtime/dynamic.scm @@ -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) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index d729778b6..e428c7167 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -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 -- 2.25.1