Changeset 37814 in project


Ignore:
Timestamp:
08/04/19 14:09:40 (4 months ago)
Author:
sjamaan
Message:

srfi-13: Use ##sys#check-fixnum instead of ##sys#check-exact on indices

In CHICKEN 4, ##sys#check-exact was what we now call ##sys#check-fixnum
but the SRFI-13 code hasn't been updated to match it.

Fixes #1631

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/srfi-13/trunk/srfi-13.scm

    r35498 r37814  
    332332;              start substring/shared)
    333333    (let ([n (optional maybe-end slen)])
    334       (##sys#check-exact n 'substring/shared)
    335334      (check-substring-spec 'substring/shared s start n)
    336335      (%substring/shared s start n) ) ) )
     
    651650;  (check-arg (lambda (val) (and (integer? val) (exact? val) (<= 0 val)))
    652651;            len string-tabulate)
    653   (##sys#check-exact len 'string-tabulate)
     652  (##sys#check-fixnum len 'string-tabulate)
    654653  (let ((s (make-string len)))
    655654    (do ((i (- len 1) (- i 1)))
     
    10231022                                         rest)
    10241023    (if (zero? bound) (set! bound 4194304))
    1025     (##sys#check-exact bound 'string-hash)
     1024    (##sys#check-fixnum bound 'string-hash)
    10261025    (let-string-start+end (start end) string-hash s rest
    10271026      (%string-hash s char->integer bound start end))))
     
    10331032                                         rest)
    10341033    (if (zero? bound) (set! bound 4194304))
    1035     (##sys#check-exact bound 'string-hash-ci)
     1034    (##sys#check-fixnum bound 'string-hash-ci)
    10361035    (let-string-start+end (start end) string-hash-ci s rest
    10371036      (%string-hash s (lambda (c) (char->integer (char-downcase c)))
     
    11691168
    11701169(define (string-pad-right s n . char+start+end)
    1171   (##sys#check-exact n 'string-pad-right)
     1170  (##sys#check-fixnum n 'string-pad-right)
    11721171  (let-optionals* char+start+end ((char #\space) rest) ; (char? char)) rest)
    11731172    (let-string-start+end (start end) string-pad-right s rest
     
    11801179
    11811180(define (string-pad s n . char+start+end)
    1182   (##sys#check-exact n 'string-pad)
     1181  (##sys#check-fixnum n 'string-pad)
    11831182  (let-optionals* char+start+end ((char #\space) rest) ; (char? char)) rest)
    11841183    (let-string-start+end (start end) string-pad s rest
     
    14061405  (let-string-start+end (fstart fend) string-copy! from maybe-fstart+fend
    14071406;    (check-arg integer? tstart string-copy!)
    1408     (##sys#check-exact tstart 'string-copy!)
    14091407    (check-substring-spec string-copy! to tstart (+ tstart (- fend fstart)))
    14101408    (%string-copy! to tstart from fstart fend)))
     
    17201718;                                            (exact? end)
    17211719;                                            (<= 0 end (string-length final)))))
    1722     (##sys#check-exact end 'string-concatenate-reverse)
     1720    (##sys#check-fixnum end 'string-concatenate-reverse)
    17231721    (let ((len (let lp ((sum 0) (lis string-list))
    17241722                 (if (pair? lis)
     
    17341732;                                            (exact? end)
    17351733;                                            (<= 0 end (string-length final)))))
    1736     (##sys#check-exact end 'string-concatenate-reverse/shared)
     1734    (##sys#check-fixnum end 'string-concatenate-reverse/shared)
    17371735    ;; Add up the lengths of all the strings in STRING-LIST; also get a
    17381736    ;; pointer NZLIST into STRING-LIST showing where the first non-zero-length
     
    18411839;  (check-arg (lambda (val) (and (integer? val) (exact? val)))
    18421840;            from xsubstring)
    1843   (##sys#check-exact from 'xsubstring)
     1841  (##sys#check-fixnum from 'xsubstring)
    18441842  (receive (to start end)
    18451843           (if (pair? maybe-to+start+end)
     
    18501848;                                                (<= from val)))
    18511849;                             to xsubstring)
    1852                    (##sys#check-exact to 'xsubstring)
     1850                   (##sys#check-fixnum to 'xsubstring)
    18531851                   (values to start end)))
    18541852;              (let ((slen (string-length (check-arg string? s xsubstring))))
     
    18931891;  (check-arg (lambda (val) (and (integer? val) (exact? val)))
    18941892;            sfrom string-xcopy!)
    1895   (##sys#check-exact sfrom 'string-xcopy!)
     1893  (##sys#check-fixnum sfrom 'string-xcopy!)
    18961894  (receive (sto start end)
    18971895           (if (pair? maybe-sto+start+end)
     
    19001898;                  (check-arg (lambda (val) (and (integer? val) (exact? val)))
    19011899;                             sto string-xcopy!)
    1902                    (##sys#check-exact sto 'string-xcopy!)
     1900                   (##sys#check-fixnum sto 'string-xcopy!)
    19031901                   (values sto start end)))
    19041902               (let ((slen (string-length s)))
Note: See TracChangeset for help on using the changeset viewer.