Implement string->immutable.
authorChris Hanson <org/chris-hanson/cph>
Sun, 7 Jan 2018 20:32:33 +0000 (15:32 -0500)
committerChris Hanson <org/chris-hanson/cph>
Sun, 7 Jan 2018 20:32:33 +0000 (15:32 -0500)
src/runtime/runtime.pkg
src/runtime/ustring.scm

index 34c08fc5601a864a9dae9f0e116d732e15a65b95..089bdb78f8d6f4185fbe2158bb4cb9e06325f22f 100644 (file)
@@ -1001,6 +1001,7 @@ USA.
          nfc-string?
          string
          string*
+         string->immutable
          string->list
          string->nfc
          string->nfd
index d799ca79e8ee8a0fd9bd5169d3c43196315a419f..d9fd1f21c009a21d379fd14a62a98980b468e754 100644 (file)
@@ -534,7 +534,7 @@ USA.
     ((2) (max-loop cp2-ref))
     (else (max-loop cp3-ref))))
 
-(define (%string->immutable string)
+(define (string->immutable string)
   (if (and (ustring? string) (%ustring-immutable? string))
       string
       (unpack-slice string
@@ -908,7 +908,7 @@ USA.
            nfc))
       (let ((nfc
             (if (eq? #t (string-nfc-qc string 'string->nfc))
-                (%string->immutable string)
+                (string->immutable string)
                 (%string->nfc string))))
        (ustring-in-nfc! nfc #t)
        nfc)))
@@ -986,7 +986,7 @@ USA.
 
 (define (string->nfd string)
   (if (string-in-nfd? string)
-      (let ((result (%string->immutable string)))
+      (let ((result (string->immutable string)))
        (ustring-in-nfd! result #t)
        result)
       (canonical-decomposition&ordering string