From: Chris Hanson Date: Tue, 9 Sep 2003 03:46:09 +0000 (+0000) Subject: Implement equality predicate for character sets. X-Git-Tag: 20090517-FFI~1816 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b0d81eb83c9e4191bdab9d0982fdabe959220942;p=mit-scheme.git Implement equality predicate for character sets. --- diff --git a/v7/src/runtime/chrset.scm b/v7/src/runtime/chrset.scm index 9a9bba79b..5efd09c0d 100644 --- a/v7/src/runtime/chrset.scm +++ b/v7/src/runtime/chrset.scm @@ -1,8 +1,9 @@ #| -*-Scheme-*- -$Id: chrset.scm,v 14.19 2003/03/08 02:06:31 cph Exp $ +$Id: chrset.scm,v 14.20 2003/09/09 03:45:52 cph Exp $ -Copyright (c) 1988-2001 Massachusetts Institute of Technology +Copyright 1988,1995,1997,1998,2000,2001 Massachusetts Institute of Technology +Copyright 2003 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -84,6 +85,11 @@ USA. ((fix:= code char-set-table-length)) (vector-8b-set! table code (if (predicate (integer->char code)) 1 0))) (make-char-set table))) + +(define (char-set=? c1 c2) + (guarantee-char-set c1 'CHAR-SET=?) + (guarantee-char-set c2 'CHAR-SET=?) + (string=? (char-set-table c1) (char-set-table c2))) (define (char-set-members char-set) (guarantee-char-set char-set 'CHAR-SET-MEMBERS) diff --git a/v7/src/runtime/equals.scm b/v7/src/runtime/equals.scm index 5a45a47f0..6b3b2b1dc 100644 --- a/v7/src/runtime/equals.scm +++ b/v7/src/runtime/equals.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: equals.scm,v 14.11 2003/02/14 18:28:32 cph Exp $ +$Id: equals.scm,v 14.12 2003/09/09 03:46:00 cph Exp $ -Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology +Copyright 1987,1991,1993,1994,2001,2003 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -72,6 +72,9 @@ USA. ((pathname? x) (and (pathname? y) (pathname=? x y))) + ((char-set? x) + (and (char-set? y) + (char-set=? x y))) (else #f)) (and (number? x) (number? y) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index d7ab4898b..800898051 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.455 2003/09/05 20:51:01 cph Exp $ +$Id: runtime.pkg,v 14.456 2003/09/09 03:46:09 cph Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology @@ -969,6 +969,7 @@ USA. char-set:standard char-set:upper-case char-set:whitespace + char-set=? char-set? char-standard? char-upper-case?