From: Matt Birkholz Date: Sun, 5 Mar 2017 19:06:53 +0000 (-0700) Subject: Match up 9.2 and current definitions of GUARANTEE. X-Git-Tag: mit-scheme-pucked-9.2.12~196^2~1 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b5336a0952f7dd142af952217732b10a2d1de07e;p=mit-scheme.git 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. --- 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))