From ec736f402dd4b5a654cd2a60461c7e45232968fa Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 25 Feb 2003 20:37:28 +0000 Subject: [PATCH] Add GUARANTEE-LIMITED-INDEX-FIXNUM. --- v7/src/runtime/fixart.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/v7/src/runtime/fixart.scm b/v7/src/runtime/fixart.scm index 8b4b0706f..0b19cb136 100644 --- a/v7/src/runtime/fixart.scm +++ b/v7/src/runtime/fixart.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: fixart.scm,v 1.11 2003/02/25 20:35:26 cph Exp $ +$Id: fixart.scm,v 1.12 2003/02/25 20:37:28 cph Exp $ Copyright 1994,1996,1999,2000,2001,2003 Massachusetts Institute of Technology @@ -112,6 +112,10 @@ USA. (if (not (index-fixnum? object)) (error:wrong-type-argument object "index integer" caller))) +(define (guarantee-limited-index-fixnum object limit caller) + (if (not (and (index-fixnum? object) (fix:< object limit))) + (error:wrong-type-argument object "limitied index integer" caller))) + (define-integrable (fix:<= x y) (not (fix:> x y))) -- 2.25.1