guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, string_abstraction2, updated. release_


From: Michael Gran
Subject: [Guile-commits] GNU Guile branch, string_abstraction2, updated. release_1-9-0-113-gdfbffd2
Date: Sun, 19 Jul 2009 14:49:32 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=dfbffd238773eb397402dac8033d34b55407e579

The branch, string_abstraction2 has been updated
       via  dfbffd238773eb397402dac8033d34b55407e579 (commit)
       via  d5c8a708736acf73932eb3cd915e7c8c8887b3a1 (commit)
       via  72b7b987f37e6c3077acbe41f6c50686f31edd4e (commit)
      from  cf91d49a872249c62de6e2d26dc1421e5fbf3e51 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dfbffd238773eb397402dac8033d34b55407e579
Author: Michael Gran <address@hidden>
Date:   Sun Jul 19 07:48:11 2009 -0700

    New tests for srfi-14
    
    The old test suite for srfi-14 assumes that the standard char sets
    change as a result of changing locale.  That's isn't true any more.
    
        * test-suite/tests/srfi-14.test: new tests

commit d5c8a708736acf73932eb3cd915e7c8c8887b3a1
Author: Michael Gran <address@hidden>
Date:   Sun Jul 19 07:45:24 2009 -0700

    Modification to initialization of standard char sets
    
    Standard char sets that include punctuation should include
    the soft hyphen U+00AD, which is a formatting character (not
    punctuation).
    
    The standard char sets are computed up through the whole of the
    Basic Multilingual Plane.
    
        * libguile/srfi-14.c (scm_unicode_char_sets): renamed to
        scm_populate_standard_char_sets
        (scm_populate_standard_char_sets): renamed from scm_unicode_char_sets
        (CSET_PUNCT_PRED): punctuation now includes the soft hyphen
        (scm_init_srfi_14): now initialize standard chars sets up through
        U+FFFF

commit 72b7b987f37e6c3077acbe41f6c50686f31edd4e
Author: Michael Gran <address@hidden>
Date:   Sun Jul 19 07:30:24 2009 -0700

    Indexing error in char set leq operator
    
        * libguile/srfi-14.c (charsets_leq): Indexing error

-----------------------------------------------------------------------

Summary of changes:
 libguile/srfi-14.c            |  119 ++++++++++----------
 libguile/srfi-14.h            |    2 +-
 test-suite/tests/srfi-14.test |  244 +++++++++++++++++++++++++++++++----------
 3 files changed, 244 insertions(+), 121 deletions(-)

diff --git a/libguile/srfi-14.c b/libguile/srfi-14.c
index 1a8ca1e..ff22f68 100644
--- a/libguile/srfi-14.c
+++ b/libguile/srfi-14.c
@@ -291,7 +291,7 @@ charsets_leq (scm_t_char_set *a, scm_t_char_set *b)
               return 0;
             }
         }
-      if (alo < b->ranges[j].lo || ahi > b->ranges[i].hi)
+      if (alo < b->ranges[j].lo || ahi > b->ranges[j].hi)
         {
           return 0;
         }
@@ -1882,13 +1882,18 @@ SCM_DEFINE (scm_char_set_diff_plus_intersection_x, 
"char-set-diff+intersection!"
 #undef FUNC_NAME
 
 
-SCM_DEFINE (scm_unicode_char_sets, "unicode-char-sets", 0, 0, 0,
-           (void),
-           "Populates the standard characters sets with codepoints from the 
full\n"
-            "Unicode range, instead of just from Latin-1 characters.\n")
-#define FUNC_NAME s_scm_unicode_char_sets
+SCM_DEFINE (scm_populate_standard_char_sets, "populate-standard-char-sets", 1, 
0, 0,
+            (SCM max),
+            "Populates the standard character sets with Unicode codepoints 
from\n"
+            "U+0000 to address@hidden  Useful values of @var{max} are 
@code{#x7F}\n"
+            "for ASCII, @code{#xFF} for Latin-1, @code{#xFFFF} for the Basic\n"
+            "Multilingual Plane, and @code{#x10FFFF} for all of Unicode.\n")
+#define FUNC_NAME s_populate_standard_char_sets
 {
-  scm_srfi_14_compute_char_sets (0x10FFFF);
+  int cmax;
+  SCM_VALIDATE_INT_COPY (1, max, cmax);
+
+  scm_srfi_14_compute_char_sets (cmax);
   return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
@@ -1926,11 +1931,15 @@ define_charset (const char *name)
 }
 
 /* Membership predicates for the various char sets.  */
-#define CSET_SYMBOL_PRED(c)                                             \
-  (((c) != '\0') && ((c) < 128) && (strchr ("$+<=>^`|~", (c)) != NULL))
-
-#define CSET_PUNCT_PRED(c)       (uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_P) \
-                                  && (!CSET_SYMBOL_PRED (c)))
+#define CSET_SYMBOL_PRED(c)      (uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_S))
+
+/* Note the explicit equality to 0xAD, which is the soft hyphen.
+   After Unicode 4.0, the soft-hyphen, which is usually invisible, has
+   been considered a formatting control character and not actual
+   puctuation.  But, SRFI-14 still calls it out as punctuation.  We
+   conform to SRFI-14, but, SRFI-14 is wrong.  */
+#define CSET_PUNCT_PRED(c)       (c == 0xAD \
+                                  || uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_P))
 #define CSET_BLANK_PRED(c)       (uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_Zs))
 #define CSET_LOWER_PRED(c)       (uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_Ll))
 #define CSET_UPPER_PRED(c)       (uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_Lu))
@@ -1939,25 +1948,25 @@ define_charset (const char *name)
 #define CSET_DIGIT_PRED(c)       (uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_Nd))
 #define CSET_WHITESPACE_PRED(c)  (uc_is_property_white_space (c))
 #define CSET_CONTROL_PRED(c)     (uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_Cc))
-#define CSET_GRAPHIC_PRED(c)     (uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_L \
-                                                                    | 
UC_CATEGORY_MASK_M \
-                                                                    | 
UC_CATEGORY_MASK_N \
-                                                                    | 
UC_CATEGORY_MASK_P \
-                                                                    | 
UC_CATEGORY_MASK_S))
-#define CSET_PRINTING_PRED(c)    (uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_L \
-                                                                    | 
UC_CATEGORY_MASK_M \
-                                                                    | 
UC_CATEGORY_MASK_N \
-                                                                    | 
UC_CATEGORY_MASK_P \
-                                                                    | 
UC_CATEGORY_MASK_S \
-                                                                    | 
UC_CATEGORY_MASK_Z))
-#define CSET_FULL_PRED(c)       (uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_L \
-                                                                   | 
UC_CATEGORY_MASK_M \
-                                                                   | 
UC_CATEGORY_MASK_N \
-                                                                   | 
UC_CATEGORY_MASK_P \
-                                                                   | 
UC_CATEGORY_MASK_S \
-                                                                   | 
UC_CATEGORY_MASK_Z \
-                                                                   | 
UC_CATEGORY_MASK_Cc \
-                                                                   | 
UC_CATEGORY_MASK_Cf))
+#define CSET_GRAPHIC_PRED(c)     (CSET_PUNCT_PRED(c) \
+                                  || uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_L \
+                                                                       | 
UC_CATEGORY_MASK_M \
+                                                                       | 
UC_CATEGORY_MASK_N \
+                                                                       | 
UC_CATEGORY_MASK_S))
+#define CSET_PRINTING_PRED(c)    (CSET_PUNCT_PRED(c) \
+                                  || uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_L \
+                                                                       | 
UC_CATEGORY_MASK_M \
+                                                                       | 
UC_CATEGORY_MASK_N \
+                                                                       | 
UC_CATEGORY_MASK_S) \
+                                  || uc_is_property_white_space (c))
+#define CSET_FULL_PRED(c)       (CSET_PUNCT_PRED(c)                     \
+                                 || uc_is_general_category_withtable (c, 
UC_CATEGORY_MASK_L \
+                                                                      | 
UC_CATEGORY_MASK_M \
+                                                                      | 
UC_CATEGORY_MASK_N \
+                                                                      | 
UC_CATEGORY_MASK_S \
+                                                                      | 
UC_CATEGORY_MASK_Z \
+                                                                      | 
UC_CATEGORY_MASK_Cc \
+                                                                      | 
UC_CATEGORY_MASK_Cf))
 
 #define CSET_HEX_DIGIT_PRED(c)   (uc_is_xdigit (c))
 #define CSET_ASCII_PRED(c)       (((c) >= '\0') && ((c) <= 127))
@@ -1965,7 +1974,7 @@ define_charset (const char *name)
 /* Some char sets are explicitly defined by the SRFI as a union of other char
    sets so we try to follow this closely.  */
 
-#define CSET_LETTER_AND_DIGIT_PRED(c)          \
+#define CSET_LETTER_AND_DIGIT_PRED(c)           \
   (CSET_LETTER_PRED (c) || CSET_DIGIT_PRED (c))
 
 /* False and true predicates.  */
@@ -1973,39 +1982,29 @@ define_charset (const char *name)
 #define CSET_FALSE_PRED(c)   (0)
 
 
-/* Compute the contents of all the standard character sets.  Computation may
-   need to be re-done at `setlocale'-time because some char sets (e.g.,
-   `char-set:letter') need to reflect the character set supported by Guile.
-
-   For instance, at startup time, the "C" locale is used, thus Guile supports
-   only ASCII; therefore, `char-set:letter' only contains English letters.
-   The user can change this by invoking `setlocale' and specifying a locale
-   with an 8-bit charset, thereby augmenting some of the SRFI-14 standard
-   character sets.
-
-   This works because some of the predicates used below to construct
-   character sets (e.g., `isalpha(3)') are locale-dependent (so
-   charset-dependent, though generally not language-dependent).  For details,
-   please see the `guile-devel' mailing list archive of September 2006.  */
+/* Compute the contents of all the standard character sets.  This
+ routine only computes as far as MAX.  For most cases, having the
+ entire Unicode char sets is wasteful and expensive.  MAX would be
+ 0xFF for Latin-1 or 0xFFFF for the Basic Multilingual Plane.*/
 void
 scm_srfi_14_compute_char_sets (scm_t_wchar max)
 {
-#define UPDATE_CSET(c, cset, pred)             \
-  do                                           \
-    {                                          \
-      if (pred (c))                            \
-       SCM_CHARSET_SET ((cset), (c));          \
-      else                                     \
-       SCM_CHARSET_UNSET ((cset), (c));        \
-    }                                          \
+#define UPDATE_CSET(c, cset, pred)              \
+  do                                            \
+    {                                           \
+      if (pred (c))                             \
+        SCM_CHARSET_SET ((cset), (c));          \
+      else                                      \
+        SCM_CHARSET_UNSET ((cset), (c));        \
+    }                                           \
   while (0)
 
   register int ch;
 
-  /* This is wrong of course.  It only iterates over the Basic
-     Multilingual Plane of 64k codepoints.  But, rebuilding these over
-     all of Unicode for each locale change is very expensive.  */
-  for (ch = 0; ch < max; ch++)
+  /* This is wrong, of course.  It only iterates over the first MAX
+     codepoints.  But, rebuilding these over all of Unicode for each
+     locale change is very expensive.  */
+  for (ch = 0; ch <= max; ch++)
     {
       UPDATE_CSET (ch, scm_char_set_upper_case, CSET_UPPER_PRED);
       UPDATE_CSET (ch, scm_char_set_lower_case, CSET_LOWER_PRED);
@@ -2013,7 +2012,7 @@ scm_srfi_14_compute_char_sets (scm_t_wchar max)
       UPDATE_CSET (ch, scm_char_set_letter, CSET_LETTER_PRED);
       UPDATE_CSET (ch, scm_char_set_digit, CSET_DIGIT_PRED);
       UPDATE_CSET (ch, scm_char_set_letter_and_digit,
-                  CSET_LETTER_AND_DIGIT_PRED);
+                   CSET_LETTER_AND_DIGIT_PRED);
       UPDATE_CSET (ch, scm_char_set_graphic, CSET_GRAPHIC_PRED);
       UPDATE_CSET (ch, scm_char_set_printing, CSET_PRINTING_PRED);
       UPDATE_CSET (ch, scm_char_set_whitespace, CSET_WHITESPACE_PRED);
@@ -2088,7 +2087,7 @@ scm_init_srfi_14 (void)
   scm_char_set_empty = define_charset ("char-set:empty");
   scm_char_set_full = define_charset ("char-set:full");
 
-  scm_srfi_14_compute_char_sets (255);
+  scm_srfi_14_compute_char_sets (0xFFFF);
 #include "libguile/srfi-14.x"
 }
 
diff --git a/libguile/srfi-14.h b/libguile/srfi-14.h
index 4b21404..5a67a02 100644
--- a/libguile/srfi-14.h
+++ b/libguile/srfi-14.h
@@ -101,7 +101,7 @@ SCM_API SCM scm_char_set_intersection_x (SCM cs1, SCM rest);
 SCM_API SCM scm_char_set_difference_x (SCM cs1, SCM rest);
 SCM_API SCM scm_char_set_xor_x (SCM cs1, SCM rest);
 SCM_API SCM scm_char_set_diff_plus_intersection_x (SCM cs1, SCM cs2, SCM rest);
-SCM_API SCM scm_unicode_char_sets (void);
+SCM_API SCM scm_populate_standard_char_sets (SCM max);
 #if SCM_CHARSET_DEBUG
 SCM_API SCM scm_debug_char_set (SCM cs);
 #endif
diff --git a/test-suite/tests/srfi-14.test b/test-suite/tests/srfi-14.test
index 853a15a..5b7ebe8 100644
--- a/test-suite/tests/srfi-14.test
+++ b/test-suite/tests/srfi-14.test
@@ -1,4 +1,5 @@
-;;;; srfi-14.test --- Test suite for Guile's SRFI-14 functions.
+;;;; srfi-14.test          -*- mode:scheme; coding: iso-8859-1 -*-
+;;;; --- Test suite for Guile's SRFI-14 functions.
 ;;;; Martin Grabmueller, 2001-07-16
 ;;;;
 ;;;; Copyright (C) 2001, 2006 Free Software Foundation, Inc.
@@ -210,9 +211,15 @@
 
 (with-test-prefix "char-set-map"
 
-  (pass-if "upper case char set"
-     (char-set= (char-set-map char-upcase char-set:lower-case)
-               char-set:upper-case)))
+  (pass-if "upper case char set 1"
+     (char-set= (char-set-map char-upcase 
+                              (string->char-set "abcdefghijklmnopqrstuvwxyz"))
+                (string->char-set "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))
+
+  (pass-if "upper case char set 2"
+     (char-set= (char-set-map char-upcase 
+                              (string->char-set 
"àáâãäåæçèéêëìíîïñòóôõöøùúûüýþ"))
+                (string->char-set "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝÞ"))))
 
 (with-test-prefix "string->char-set"
 
@@ -226,37 +233,94 @@
 
 (with-test-prefix "standard char sets (ASCII)"
 
+  (pass-if "char-set:lower-case"
+     (char-set<= (string->char-set "abcdefghijklmnopqrstuvwxyz")
+                 char-set:lower-case))
+
+  (pass-if "char-set:upper-case"
+     (char-set<= (string->char-set "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+                 char-set:upper-case))
+
+  (pass-if "char-set:title-case"
+     (char-set<= (string->char-set "")
+                 char-set:title-case))
+
   (pass-if "char-set:letter"
-     (char-set= (string->char-set
-                (string-append "abcdefghijklmnopqrstuvwxyz"
-                               "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
-               char-set:letter))
+     (char-set<= (char-set-union
+                  char-set:lower-case
+                  char-set:upper-case)
+                 char-set:letter))
 
-  (pass-if "char-set:punctuation"
-     (char-set= (string->char-set "!\"#%&'()*,-./:;address@hidden")
-               char-set:punctuation))
+  (pass-if "char-set:digit"
+     (char-set<= (string->char-set "0123456789")
+                 char-set:digit))
 
-  (pass-if "char-set:symbol"
-     (char-set= (string->char-set "$+<=>^`|~")
-               char-set:symbol))
+  (pass-if "char-set:hex-digit"
+     (char-set<= (string->char-set "0123456789abcdefABCDEF")
+                 char-set:hex-digit))
 
   (pass-if "char-set:letter+digit"
-     (char-set= char-set:letter+digit
-                (char-set-union char-set:letter char-set:digit)))
+     (char-set<= (char-set-union
+                  char-set:letter
+                  char-set:digit)
+                 char-set:letter+digit))
 
-  (pass-if "char-set:graphic"
-     (char-set= char-set:graphic
-                (char-set-union char-set:letter char-set:digit
-                                char-set:punctuation char-set:symbol)))
+  (pass-if "char-set:punctuation"
+     (char-set<= (string->char-set "!\"#%&'()*,-./:;address@hidden")
+                 char-set:punctuation))
 
-  (pass-if "char-set:printing"
-      (char-set= char-set:printing
-                 (char-set-union char-set:whitespace char-set:graphic))))
+  (pass-if "char-set:symbol"
+     (char-set<= (string->char-set "$+<=>^`|~")
+                 char-set:symbol))
 
+  (pass-if "char-set:graphic"
+     (char-set<= (char-set-union
+                  (string->char-set "abcdefghijklmnopqrstuvwxyz")
+                  (string->char-set "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+                  (string->char-set "0123456789")
+                  (string->char-set "!\"#%&'()*,-./:;address@hidden")
+                  (string->char-set "$+<=>^`|~"))
+                 char-set:graphic))
+
+  (pass-if "char-set:whitespace"
+     (char-set<= (string->char-set 
+                  (string
+                   (integer->char #x09)
+                   (integer->char #x0a)
+                   (integer->char #x0b)
+                   (integer->char #x0c)
+                   (integer->char #x0d)
+                   (integer->char #x20)))
+                 char-set:whitespace))
+                                  
+  (pass-if "char-set:printing"
+     (char-set<= (char-set-union
+                  (string->char-set "abcdefghijklmnopqrstuvwxyz")
+                  (string->char-set "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+                  (string->char-set "0123456789")
+                  (string->char-set "!\"#%&'()*,-./:;address@hidden")
+                  (string->char-set "$+<=>^`|~")
+                  (string->char-set (string
+                                     (integer->char #x09)
+                                     (integer->char #x0a)
+                                     (integer->char #x0b)
+                                     (integer->char #x0c)
+                                     (integer->char #x0d)
+                                     (integer->char #x20))))
+                 char-set:printing))
+
+  (pass-if "char-set:iso-control"
+     (char-set<= (string->char-set 
+                  (apply string 
+                         (map integer->char (append 
+                                             ;; U+0000 to U+001F
+                                             (iota #x20)
+                                             (list #x7f)))))
+                 char-set:iso-control)))
 
 
 ;;;
-;;; 8-bit charsets.
+;;; Non-ASCII codepoints
 ;;;
 ;;; Here, we only test ISO-8859-1 (Latin-1), notably because behavior of
 ;;; SRFI-14 for implementations supporting this charset is well-defined.
@@ -284,57 +348,117 @@
 
 (with-test-prefix "Latin-1 (8-bit charset)"
 
-  ;; Note: the membership tests below are not exhaustive.
-
-  (pass-if "char-set:letter (membership)"
+  (pass-if "char-set:lower-case"
      (if (not %latin1)
         (throw 'unresolved)
-        (let ((letters (char-set->list char-set:letter)))
-          (every? (lambda (8-bit-char)
-                    (memq 8-bit-char letters))
-                  (append '(#\a #\b #\c)             ;; ASCII
-                          (string->list "çéèâùÉÀÈÊ") ;; French
-                          (string->list "øñÑíßåæðþ"))))))
-
-  (pass-if "char-set:letter (size)"
+         (char-set<= (string->char-set
+                      (string-append "abcdefghijklmnopqrstuvwxyz"
+                                     "µßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ")
+                      char-set:lower-case))))
+
+  (pass-if "char-set:upper-case"
      (if (not %latin1)
-        (throw 'unresolved)
-        (= (char-set-size char-set:letter) 117)))
+         (throw 'unresolved)
+         (char-set<= (string->char-set
+                      (string-append "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                                     "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ")
+                      char-set:lower-case))))
 
-  (pass-if "char-set:lower-case (size)"
+  (pass-if "char-set:title-case"
      (if (not %latin1)
         (throw 'unresolved)
-        (= (char-set-size char-set:lower-case) (+ 26 33))))
+         (char-set<= (string->char-set "")
+                     char-set:title-case)))
 
-  (pass-if "char-set:upper-case (size)"
+  (pass-if "char-set:letter"
+     (if (not %latin1)
+        (throw 'unresolved)
+         (char-set<= (char-set-union
+                      char-set:lower-case
+                      char-set:upper-case
+                      (string->char-set "ªº"))
+                     char-set:letter)))
+  
+  (pass-if "char-set:digit"
      (if (not %latin1)
         (throw 'unresolved)
-        (= (char-set-size char-set:upper-case) (+ 26 30))))
+         (char-set<= (string->char-set "0123456789")
+                     char-set:digit)))
 
-  (pass-if "char-set:punctuation (membership)"
+  (pass-if "char-set:hex-digit"
      (if (not %latin1)
         (throw 'unresolved)
-        (let ((punctuation (char-set->list char-set:punctuation)))
-          (every? (lambda (8-bit-char)
-                    (memq 8-bit-char punctuation))
-                  (append '(#\! #\. #\?)            ;; ASCII
-                          (string->list "¡¿")       ;; Castellano
-                          (string->list "«»"))))))  ;; French
+         (char-set<= (string->char-set "0123456789abcdefABCDEF")
+                     char-set:hex-digit)))
 
   (pass-if "char-set:letter+digit"
-     (char-set= char-set:letter+digit
-                (char-set-union char-set:letter char-set:digit)))
+     (if (not %latin1)
+        (throw 'unresolved)
+         (char-set<= (char-set-union
+                      char-set:letter
+                      char-set:digit)
+                     char-set:letter+digit)))
 
-  (pass-if "char-set:graphic"
-     (char-set= char-set:graphic
-                (char-set-union char-set:letter char-set:digit
-                                char-set:punctuation char-set:symbol)))
+  (pass-if "char-set:punctuation"
+     (if (not %latin1)
+        (throw 'unresolved)
+         (char-set<= (string->char-set 
+                      (string-append "!\"#%&'()*,-./:;address@hidden"
+                                     "¡«­·»¿"))
+                     char-set:punctuation)))
 
+  (pass-if "char-set:symbol"
+     (if (not %latin1)
+        (throw 'unresolved)
+         (char-set<= (string->char-set 
+                      (string-append "$+<=>^`|~"
+                                     "¢£¤¥¦§¨©¬®¯°±´¶¸×÷"))
+                     char-set:symbol)))
+
+  ;; Note that SRFI-14 itself is inconsistent here.  Characters that
+  ;; are non-digit numbers (such as category No) are clearly 'graphic'
+  ;; but don't occur in the letter, digit, punct, or symbol charsets.
+  (pass-if "char-set:graphic"
+     (if (not %latin1)
+        (throw 'unresolved)
+         (char-set<= (char-set-union
+                      char-set:letter
+                      char-set:digit
+                      char-set:punctuation
+                      char-set:symbol)
+                     char-set:graphic)))
+
+  (pass-if "char-set:whitespace"
+     (if (not %latin1)
+        (throw 'unresolved)
+         (char-set<= (string->char-set 
+                      (string
+                       (integer->char #x09)
+                       (integer->char #x0a)
+                       (integer->char #x0b)
+                       (integer->char #x0c)
+                       (integer->char #x0d)
+                       (integer->char #x20)
+                       (integer->char #xa0)))
+                     char-set:whitespace)))
+                                  
   (pass-if "char-set:printing"
-     (char-set= char-set:printing
-                (char-set-union char-set:whitespace char-set:graphic))))
+     (if (not %latin1)
+        (throw 'unresolved)
+         (char-set<= (char-set-union char-set:graphic char-set:whitespace)
+                     char-set:printing)))
+
+  (pass-if "char-set:iso-control"
+     (if (not %latin1)
+        (throw 'unresolved)
+         (char-set<= (string->char-set 
+                      (apply string 
+                             (map integer->char (append 
+                                                 ;; U+0000 to U+001F
+                                                 (iota #x20)
+                                                 (list #x7f)
+                                                 ;; U+007F to U+009F
+                                                 (map (lambda (x) (+ #x80 x))
+                                                      (iota #x20))))))
+                     char-set:iso-control))))
 
-;; Local Variables:
-;; mode: scheme
-;; coding: latin-1
-;; End:


hooks/post-receive
-- 
GNU Guile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]