Eliminate large swath of unused exports from (runtime unicode) package.
authorChris Hanson <org/chris-hanson/cph>
Fri, 27 Jan 2017 01:23:49 +0000 (17:23 -0800)
committerChris Hanson <org/chris-hanson/cph>
Fri, 27 Jan 2017 01:23:49 +0000 (17:23 -0800)
src/runtime/parser-buffer.scm
src/runtime/runtime.pkg
src/runtime/string.scm
src/runtime/unicode.scm
src/runtime/url.scm
src/xml/rdf-struct.scm
src/xml/xml-struct.scm

index def81b7029162c17495e6b750b56c0abf7d4f4c8..d7d7d0c2c5be4b0fe4beb0ad21bac6e73a3b1a3e 100644 (file)
@@ -56,7 +56,7 @@ USA.
       (let ((string (string->wide-string string start end)))
        (make-parser-buffer string 0 (wide-string-length string) 0 0 #f #t 0))
       (begin
-       (guarantee-wide-string string 'STRING->PARSER-BUFFER)
+       (guarantee wide-string? string 'STRING->PARSER-BUFFER)
        (let* ((end
                (if (or (default-object? end) (not end))
                    (wide-string-length string)
@@ -82,7 +82,7 @@ USA.
               (zero? (wide-string-length prefix))))
       (make-parser-buffer (make-wide-string min-length) 0 0 0 0 port #f 0)
       (begin
-       (guarantee-wide-string prefix 'textual-input-port->parser-buffer)
+       (guarantee wide-string? prefix 'textual-input-port->parser-buffer)
        (let ((n (wide-string-length prefix)))
          (make-parser-buffer (%grow-buffer prefix n (max min-length n))
                              0 n 0 0 port #f 0)))))
@@ -135,7 +135,7 @@ USA.
   (set-parser-buffer-line! buffer (parser-buffer-pointer-line p)))
 
 (define (get-parser-buffer-tail buffer p)
-  (call-with-parser-buffer-tail buffer p wide-string->utf8-string))
+  (call-with-parser-buffer-tail buffer p string->utf8-string))
 
 (define (call-with-parser-buffer-tail buffer p procedure)
   ;; P must be a buffer pointer previously returned by
index 033c1845c280f47f8cb4e2e456a3925aa5e51c9b..6d43d5ee599157bd92d4fa27ab209fe86aa2571d 100644 (file)
@@ -5725,106 +5725,14 @@ USA.
   (files "unicode")
   (parent (runtime))
   (export ()
-         ;; BEGIN deprecated bindings
-         error:not-utf16-be-string
-         error:not-utf16-high-surrogate
-         error:not-utf16-le-string
-         error:not-utf16-low-surrogate
-         error:not-utf16-string
-         error:not-utf32-be-string
-         error:not-utf32-le-string
-         error:not-utf32-string
-         error:not-utf8-string
-         error:not-wide-string
-         guarantee-utf16-be-string
-         guarantee-utf16-high-surrogate
-         guarantee-utf16-le-string
-         guarantee-utf16-low-surrogate
-         guarantee-utf16-string
-         guarantee-utf32-be-string
-         guarantee-utf32-le-string
-         guarantee-utf32-string
-         guarantee-utf8-string
-         guarantee-wide-string
-         ;; END deprecated bindings
-         (wide-string->utf16-be-string string->utf16-be-string)
-         (wide-string->utf16-le-string string->utf16-le-string)
-         (wide-string->utf16-string string->utf16-string)
-         (wide-string->utf32-be-string string->utf32-be-string)
-         (wide-string->utf32-le-string string->utf32-le-string)
-         (wide-string->utf32-string string->utf32-string)
-         (wide-string->utf8-string string->utf8-string)
-         <wide-string>
-         call-with-utf16-be-input-string
-         call-with-utf16-be-output-string
-         call-with-utf16-input-string
-         call-with-utf16-le-input-string
-         call-with-utf16-le-output-string
-         call-with-utf16-output-string
-         call-with-utf32-be-input-string
-         call-with-utf32-be-output-string
-         call-with-utf32-input-string
-         call-with-utf32-le-input-string
-         call-with-utf32-le-output-string
-         call-with-utf32-output-string
          call-with-utf8-input-string
          call-with-utf8-output-string
-         combine-utf16-surrogates
          for-all-chars-in-string?
-         for-any-char-in-string?
-         guarantee-wide-string-index
-         guarantee-wide-substring
          make-wide-string
-         open-utf16-be-input-string
-         open-utf16-be-output-string
-         open-utf16-input-string
-         open-utf16-le-input-string
-         open-utf16-le-output-string
-         open-utf16-output-string
-         open-utf32-be-input-string
-         open-utf32-be-output-string
-         open-utf32-input-string
-         open-utf32-le-input-string
-         open-utf32-le-output-string
-         open-utf32-output-string
          open-utf8-input-string
          open-utf8-output-string
-         split-into-utf16-surrogates
-         string->utf16-be-string
-         string->utf16-le-string
-         string->utf16-string
-         string->utf32-be-string
-         string->utf32-le-string
-         string->utf32-string
-         string->utf8-string
          string->utf8-string
          string->wide-string
-         utf16-be-string->wide-string
-         utf16-be-string-length
-         utf16-be-string-valid?
-         utf16-be-string?
-         utf16-high-surrogate?
-         utf16-le-string->wide-string
-         utf16-le-string-length
-         utf16-le-string-valid?
-         utf16-le-string?
-         utf16-low-surrogate?
-         utf16-string->wide-string
-         utf16-string-length
-         utf16-string-valid?
-         utf16-string?
-         utf32-be-string->wide-string
-         utf32-be-string-length
-         utf32-be-string-valid?
-         utf32-be-string?
-         utf32-le-string->wide-string
-         utf32-le-string-length
-         utf32-le-string-valid?
-         utf32-le-string?
-         utf32-string->wide-string
-         utf32-string-length
-         utf32-string-valid?
-         utf32-string?
          utf8-string->string
          utf8-string->wide-string
          utf8-string-length
@@ -5837,11 +5745,7 @@ USA.
          wide-string-ref
          wide-string-set!
          wide-string?
-         wide-substring)
-  (export (runtime generic-i/o-port)
-         wide-string-contents)
-  (export (runtime input-port)
-         wide-string-contents))
+         wide-substring))
 
 (define-package (runtime uri)
   (files "url")
index 5d4b0e16ee2e6cf97f57a8d660ee4b822621eaa4..4d08ef16cd758c900f27a2d3d75623533c87ce5b 100644 (file)
@@ -279,9 +279,9 @@ USA.
 (define (->utf8-string object)
   (cond ((string? object) (string->utf8-string object))
        ((symbol? object) (symbol-name object))
-       ((wide-string? object) (wide-string->utf8-string object))
+       ((wide-string? object) (string->utf8-string object))
        ((unicode-char? object)
-        (wide-string->utf8-string (wide-string object)))
+        (string->utf8-string (wide-string object)))
        (else (%->string object 'UTF8-STRING))))
 
 (define (%->string object caller)
index ee9e63cc65b897ab8ba3a02328531a8c92bdf47b..f89480a46ff0448723d94415c3e6bc17cd17f9fd 100644 (file)
@@ -183,14 +183,14 @@ USA.
   (%make-wide-string (list->vector chars)))
 
 (define (wide-string-length string)
-  (guarantee-wide-string string 'WIDE-STRING-LENGTH)
+  (guarantee wide-string? string 'WIDE-STRING-LENGTH)
   (%wide-string-length string))
 
 (define-integrable (%wide-string-length string)
   (vector-length (wide-string-contents string)))
 
 (define (wide-string-ref string index)
-  (guarantee-wide-string string 'WIDE-STRING-REF)
+  (guarantee wide-string? string 'WIDE-STRING-REF)
   (guarantee-wide-string-index index string 'WIDE-STRING-REF)
   (%wide-string-ref string index))
 
@@ -198,7 +198,7 @@ USA.
   (vector-ref (wide-string-contents string) index))
 
 (define (wide-string-set! string index char)
-  (guarantee-wide-string string 'WIDE-STRING-SET!)
+  (guarantee wide-string? string 'WIDE-STRING-SET!)
   (guarantee-wide-string-index index string 'WIDE-STRING-SET!)
   (guarantee-unicode-char char 'WIDE-STRING-SET!)
   (%wide-string-set! string index char))
@@ -240,7 +240,7 @@ USA.
       (guarantee-wide-substring/fail string start end caller)))
 
 (define (guarantee-wide-substring/fail string start end caller)
-  (guarantee-wide-string string caller)
+  (guarantee wide-string? string caller)
   (guarantee-limited-index end (%wide-string-length string) caller)
   (guarantee-limited-index start end caller))
 
@@ -543,8 +543,8 @@ USA.
   (fix:or (fix:lsh b1 8) b0))
 
 (define (combine-utf16-surrogates h l)
-  (guarantee-utf16-high-surrogate h 'combine-utf16-surrogates)
-  (guarantee-utf16-low-surrogate l 'combine-utf16-surrogates)
+  (guarantee utf16-high-surrogate? h 'combine-utf16-surrogates)
+  (guarantee utf16-low-surrogate? l 'combine-utf16-surrogates)
   (fix:+ (fix:+ (fix:lsh (fix:and h #x3FF) 10)
                (fix:and l #x3FF))
         #x10000))
index 4430bc40a3010f19c50917d96a8885ae44d41cf1..3295d4ad9c48eddb9ba884fc0d09f82c76fd14fa 100644 (file)
@@ -46,8 +46,8 @@ USA.
     (if scheme (guarantee-uri-scheme scheme 'MAKE-URI))
     (if authority (guarantee-uri-authority authority 'MAKE-URI))
     (guarantee-uri-path path 'MAKE-URI)
-    (if query (guarantee-utf8-string query 'MAKE-URI))
-    (if fragment (guarantee-utf8-string fragment 'MAKE-URI))
+    (if query (guarantee utf8-string? query 'MAKE-URI))
+    (if fragment (guarantee utf8-string? fragment 'MAKE-URI))
     (if (and authority (pair? path) (path-relative? path))
        (error:bad-range-argument path 'MAKE-URI))
     (let* ((path (remove-dot-segments path))
@@ -184,9 +184,9 @@ USA.
            '()))))
 
 (define (uri-prefix prefix)
-  (guarantee-utf8-string prefix 'URI-PREFIX)
+  (guarantee utf8-string? prefix 'URI-PREFIX)
   (lambda (suffix)
-    (guarantee-utf8-string suffix 'URI-PREFIX)
+    (guarantee utf8-string? suffix 'URI-PREFIX)
     (string->absolute-uri (string-append prefix suffix))))
 \f
 (define (remove-dot-segments path)
@@ -318,7 +318,7 @@ USA.
          ((symbol? object)
           (do-string (symbol-name object)))
          ((wide-string? object)
-          (let ((string (wide-string->utf8-string object)))
+          (let ((string (string->utf8-string object)))
             (or (hash-table/get interned-uris string #f)
                 (do-parse object))))
          (else
index 159e30630395c27f66593f1c47c9de009aaf6f77..f44fb9bc520491c28382d55e02aa4ee52cf7667e 100644 (file)
@@ -202,7 +202,7 @@ USA.
 (define-guarantee rdf-literal "RDF literal")
 
 (define (make-rdf-literal text type)
-  (guarantee-utf8-string text 'MAKE-RDF-LITERAL)
+  (guarantee utf8-string? text 'MAKE-RDF-LITERAL)
   (let ((type
         (if (or (not type)
                 (language? type))
@@ -322,7 +322,7 @@ USA.
 
 (define (make-rdf-qname prefix local)
   (guarantee-rdf-prefix prefix 'MAKE-RDF-QNAME)
-  (guarantee-utf8-string local 'MAKE-RDF-QNAME)
+  (guarantee utf8-string? local 'MAKE-RDF-QNAME)
   (if (not (*match-utf8-string match:name local))
       (error:bad-range-argument local 'MAKE-RDF-QNAME))
   (symbol prefix local))
index 0513c1695e040dfe5674da85c4457816f63df97d..b5d88ceea4a946703f7486ea1160d443ac7e6f2b 100644 (file)
@@ -182,7 +182,7 @@ USA.
           (lambda (port)
             (write-char object port))))
        ((wide-string? object)
-        (wide-string->utf8-string object))
+        (string->utf8-string object))
        ((string? object)
         (cond ((not (utf8-string-valid? object))
                 (error:wrong-type-datum object "valid UTF-8 XML char data"))