From d84d971adf8826fb0ac2d5a9ab7bdb56c55708f8 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 15 Jan 2018 20:05:18 -0800 Subject: [PATCH] Put guarantee and friends into "boot" for cold-load access. --- src/runtime/boot.scm | 19 +++++++++++++++++++ src/runtime/predicate-metadata.scm | 19 ------------------- src/runtime/runtime.pkg | 8 ++++---- 3 files changed, 23 insertions(+), 23 deletions(-) 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<=!) -- 2.25.1