deprecate SCM_CHAR_CODE_LIMIT and char-code-limit
authorAndy Wingo <wingo@pobox.com>
Thu, 10 Jan 2013 15:01:06 +0000 (16:01 +0100)
committerAndy Wingo <wingo@pobox.com>
Thu, 10 Jan 2013 15:01:06 +0000 (16:01 +0100)
* libguile/__scm.h:
* libguile/deprecated.h (SCM_CHAR_CODE_LIMIT): Move declaration here
  from __scm.h.

* libguile/feature.c:
* module/ice-9/deprecated.scm (char-code-limit): Move definition here.

* test-suite/tests/regexp.test: Update to not use char-code-limit.

doc/guile-api.alist
libguile/__scm.h
libguile/deprecated.h
libguile/feature.c
module/ice-9/deprecated.scm
test-suite/tests/regexp.test

index 5f73cae..5830c91 100644 (file)
 (char-ci=? (groups Scheme) (scan-data "#<primitive-procedure char-ci=?>"))
 (char-ci>=? (groups Scheme) (scan-data "#<primitive-procedure char-ci>=?>"))
 (char-ci>? (groups Scheme) (scan-data "#<primitive-procedure char-ci>?>"))
-(char-code-limit (groups Scheme) (scan-data ""))
 (char-downcase (groups Scheme) (scan-data "#<primitive-procedure char-downcase>"))
 (char-is-both? (groups Scheme) (scan-data "#<primitive-procedure char-is-both?>"))
 (char-lower-case? (groups Scheme) (scan-data "#<primitive-procedure char-lower-case?>"))
index 1c20bd7..47ed12b 100644 (file)
@@ -4,7 +4,7 @@
 #define SCM___SCM_H
 
 /* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2006,
- *   2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ *   2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
 # define SCM_LONG_BIT (SCM_CHAR_BIT * sizeof (long) / sizeof (char))
 #endif
 
-#ifdef UCHAR_MAX
-# define SCM_CHAR_CODE_LIMIT (UCHAR_MAX + 1L)
-#else
-# define SCM_CHAR_CODE_LIMIT 256L
-#endif
-
 #define SCM_I_UTYPE_MAX(type)      ((type)-1)
 #define SCM_I_TYPE_MAX(type,umax)  ((type)((umax)/2))
 #define SCM_I_TYPE_MIN(type,umax)  (-((type)((umax)/2))-1)
index ae0891f..de85c6f 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef SCM_DEPRECATED_H
 #define SCM_DEPRECATED_H
 
-/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -839,6 +839,14 @@ SCM_DEPRECATED SCM scm_struct_vtable_tag (SCM handle);
 
 \f
 
+#ifdef UCHAR_MAX
+# define SCM_CHAR_CODE_LIMIT (UCHAR_MAX + 1L)
+#else
+# define SCM_CHAR_CODE_LIMIT 256L
+#endif
+
+\f
+
 void scm_i_init_deprecated (void);
 
 #endif
index f3bddc7..4646975 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- *   2006, 2007, 2009, 2011 Free Software Foundation, Inc.
+ *   2006, 2007, 2009, 2011, 2013 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -123,8 +123,6 @@ scm_init_feature()
   scm_add_feature ("threads");
 #endif
 
-  scm_c_define ("char-code-limit", scm_from_int (SCM_CHAR_CODE_LIMIT));
-
 #include "libguile/feature.x"
 }
 
index 9d80cfe..3d40193 100644 (file)
@@ -70,7 +70,8 @@
             read-hash-procedures
             process-define-module
             fluid-let-syntax
-            set-system-module!))
+            set-system-module!
+            char-code-limit))
 
 
 ;;;; Deprecated definitions.
@@ -896,3 +897,7 @@ it.")
         (issue-deprecation-warning
          "`module-eval-closure' is deprecated.  Use module-variable or module-define! instead.")
         (standard-eval-closure m)))
+
+;; Legacy definition.  We can't make it identifier-syntax yet though,
+;; because compiled code might rely on it.
+(define char-code-limit 256)
index d549df2..b5c59f0 100644 (file)
@@ -2,7 +2,7 @@
 ;;;; Jim Blandy <jimb@red-bean.com> --- September 1999
 ;;;;
 ;;;;   Copyright (C) 1999, 2004, 2006, 2007, 2008, 2009, 2010,
-;;;;      2012 Free Software Foundation, Inc.
+;;;;      2012, 2013 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
 
   (let ((lst `((regexp/basic    ,regexp/basic)
               (regexp/extended ,regexp/extended)))
-       ;; string of all characters, except #\nul which doesn't work because
-       ;; it's the usual end-of-string for the underlying C regexec()
-       (allchars (list->string (map integer->char
-                                    (cdr (iota char-code-limit))))))
+       ;; String of all latin-1 characters, except #\nul which doesn't
+       ;; work because it's the usual end-of-string for the underlying
+       ;; C regexec().
+       (allchars (list->string (map integer->char (cdr (iota 256))))))
     (for-each
      (lambda (elem)
        (let ((name (car  elem))
 
         (with-test-prefix name
 
-          ;; try on each individual character, except #\nul
+          ;; Try on each individual latin-1 character, except #\nul.
           (do ((i 1 (1+ i)))
-              ((>= i char-code-limit))
+              ((>= i 256))
              (let* ((c (integer->char i))
                     (s (string c)))
                (pass-if (list "char" i (format #f "~s ~s" c s))
                     (and (= 0 (match:start m))
                          (= 1 (match:end m))))))))
 
-          ;; try on pattern "aX" where X is each character, except #\nul
-          ;; this exposes things like "?" which are special only when they
-          ;; follow a pattern to repeat or whatever ("a" in this case)
+          ;; Try on pattern "aX" where X is each latin-1 character,
+          ;; except #\nul.  This exposes things like "?" which are
+          ;; special only when they follow a pattern to repeat or
+          ;; whatever ("a" in this case).
           (do ((i 1 (1+ i)))
-              ((>= i char-code-limit))
+              ((>= i 256))
              (let* ((c (integer->char i))
                     (s (string #\a c))
                     (q (with-unicode (regexp-quote s))))