From b5336a0952f7dd142af952217732b10a2d1de07e Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sun, 5 Mar 2017 12:06:53 -0700 Subject: [PATCH] Match up 9.2 and current definitions of GUARANTEE. Fix the 9.2 host adapter to agree with expected behavior (returning the object), after changing the new definition so that it is easier to continue from (error...) with a substitute. --- src/runtime/host-adapter.scm | 3 ++- src/runtime/predicate-metadata.scm | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/runtime/host-adapter.scm b/src/runtime/host-adapter.scm index bc8da4741..c8c7dab47 100644 --- a/src/runtime/host-adapter.scm +++ b/src/runtime/host-adapter.scm @@ -41,7 +41,8 @@ USA. (define random-bytevector random-byte-vector) env) (eval ' (define (guarantee predicate object #!optional caller) - (if (not (predicate object)) + (if (predicate object) + object (error "Not a:" predicate object))) env) (eval ' (define (microcode-type name) diff --git a/src/runtime/predicate-metadata.scm b/src/runtime/predicate-metadata.scm index f0f6b3c13..ed3567b9a 100644 --- a/src/runtime/predicate-metadata.scm +++ b/src/runtime/predicate-metadata.scm @@ -87,9 +87,9 @@ USA. tag)) (define (guarantee predicate object #!optional caller) - (if (not (predicate object)) - (error:not-a predicate object caller)) - object) + (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)) -- 2.25.1