Changeset 35787 in project


Ignore:
Timestamp:
07/07/18 03:07:37 (3 months ago)
Author:
kon
Message:

rmv dup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/string-utils/trunk/unicode-utils.scm

    r35184 r35787  
    55;;
    66;; - Implies Unicode support that is not present.
     7
     8(declare
     9  (bound-to-procedure
     10    ##sys#string-append
     11    ##sys#char->utf8-string
     12    ##sys#unicode-surrogate?
     13    ##sys#surrogates->codepoint))
    714
    815(module unicode-utils
     
    2330  (only type-checks check-natural-fixnum check-char))
    2431
    25 (declare
    26   (bound-to-procedure
    27     ##sys#string-append
    28     ##sys#char->utf8-string
    29     ##sys#unicode-surrogate?
    30     ##sys#surrogates->codepoint))
    31 
    3232;; Simple UTF 8
    3333
     34;nul is not accepted!
    3435(: ascii-codepoint? (* -> boolean : char))
    3536;
     
    3839    (char? ch)
    3940    (let ((x (char->integer ch)))
    40       (and (fx<= 0 x) (fx<= x #x7f)) ) ) )
     41      ;[1 7f] = (1 80)
     42      (and (fx< 0 x) (fx< x #x80)) ) ) )
    4143
    4244(: unicode-char->string (char --> string))
     
    5759      (*unicode-string chs) ) ) )
    5860
    59 (: generic-make-string (fixnum char --> string))
    60 ;
    61 (define (generic-make-string len ch)
    62   (if (ascii-codepoint? ch)
    63     (make-string len ch)
    64     (unicode-make-string len ch) ) )
    65 
    6661(: unicode-make-string (fixnum #!optional char --> string))
    6762;
     
    7065    (check-natural-fixnum 'unicode-make-string len)
    7166    (check-char 'unicode-make-string fill)) )
     67
     68(define generic-make-string unicode-make-string)
    7269
    7370(: unicode-surrogate? (* -> boolean : fixnum))
Note: See TracChangeset for help on using the changeset viewer.