From 89b2c291ad0329204183c47ccbbbc9512822ca31 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 28 Feb 2016 20:33:50 -0800 Subject: [PATCH] Define guarantee-boolean and parameter-converter. --- src/runtime/boole.scm | 2 ++ src/runtime/dynamic.scm | 9 +++++---- src/runtime/runtime.pkg | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/runtime/boole.scm b/src/runtime/boole.scm index 3e8cd50b3..921c6a212 100644 --- a/src/runtime/boole.scm +++ b/src/runtime/boole.scm @@ -39,6 +39,8 @@ USA. (or (eq? object #f) (eq? object #t))) +(define-guarantee boolean "boolean") + (define (boolean=? x y) (if x y (not y))) diff --git a/src/runtime/dynamic.scm b/src/runtime/dynamic.scm index c14f225c8..b6846347e 100644 --- a/src/runtime/dynamic.scm +++ b/src/runtime/dynamic.scm @@ -70,9 +70,7 @@ USA. (define (default-parameter-converter value) value) (define (default-parameter-getter value) value) - -(define (default-parameter-setter set-param value) - (set-param 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) @@ -106,4 +104,7 @@ USA. (lambda () (set! bindings (set! temp (set! bindings))) unspecific))) - (shallow-fluid-bind swap! thunk swap!)))) \ No newline at end of file + (shallow-fluid-bind swap! thunk swap!)))) + +(define (parameter-converter parameter) + (car (parameter-metadata parameter))) \ No newline at end of file diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index ff2e2b08a..5bd42903f 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -129,6 +129,7 @@ USA. boolean? false for-all? + guarantee-boolean not there-exists? true)) @@ -4611,6 +4612,7 @@ USA. default-parameter-converter default-parameter-getter default-parameter-setter + parameter-converter parameter? make-general-parameter make-settable-parameter -- 2.25.1