From: Chris Hanson Date: Tue, 16 Jan 2018 04:05:18 +0000 (-0800) Subject: Put guarantee and friends into "boot" for cold-load access. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~360 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d84d971adf8826fb0ac2d5a9ab7bdb56c55708f8;p=mit-scheme.git Put guarantee and friends into "boot" for cold-load access. --- diff --git a/src/runtime/boot.scm b/src/runtime/boot.scm index 88cffd2d9..84e1cfa37 100644 --- a/src/runtime/boot.scm +++ b/src/runtime/boot.scm @@ -377,6 +377,25 @@ USA. unspecific)) unspecific) +(define (guarantee predicate object #!optional caller) + (if (predicate object) + object + (error:not-a predicate object caller))) + +(define (error:not-a predicate object #!optional caller) + (error:wrong-type-argument object (predicate-description predicate) caller)) + +(define (guarantee-list-of predicate object #!optional caller) + (if (not (list-of-type? object predicate)) + (error:not-a-list-of predicate object caller)) + object) + +(define (error:not-a-list-of predicate object #!optional caller) + (error:wrong-type-argument object + (string-append "list of " + (predicate-description predicate)) + caller)) + ;;;; Miscellany (define (object-constant? object) diff --git a/src/runtime/predicate-metadata.scm b/src/runtime/predicate-metadata.scm index d572b7586..b48851765 100644 --- a/src/runtime/predicate-metadata.scm +++ b/src/runtime/predicate-metadata.scm @@ -70,25 +70,6 @@ USA. (if (not tag) (error:not-a predicate? predicate caller)) tag)) - -(define (guarantee predicate object #!optional caller) - (if (predicate object) - object - (error:not-a predicate object caller))) - -(define (error:not-a predicate object #!optional caller) - (error:wrong-type-argument object (predicate-description predicate) caller)) - -(define (guarantee-list-of predicate object #!optional caller) - (if (not (list-of-type? object predicate)) - (error:not-a-list-of predicate object caller)) - object) - -(define (error:not-a-list-of predicate object #!optional caller) - (error:wrong-type-argument object - (string-append "list of " - (predicate-description predicate)) - caller)) (define (make-tag name predicate caller #!optional extra description) (guarantee tag-name? name caller) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index a1a646d53..57b52c920 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -157,8 +157,12 @@ USA. default-object? define-pp-describer define-unparser-method + error:not-a + error:not-a-list-of gc-space-status general-unparser-method + guarantee + guarantee-list-of interrupt-bit/after-gc interrupt-bit/gc interrupt-bit/global-1 @@ -1838,10 +1842,6 @@ USA. (files "predicate-metadata") (parent (runtime)) (export () - error:not-a - error:not-a-list-of - guarantee - guarantee-list-of predicate-description predicate-name set-predicate<=!)