Changeset 13521 in project


Ignore:
Timestamp:
03/06/09 03:36:20 (11 years ago)
Author:
Jim Ursetto
Message:

sxml-transforms: lambda-lift index-cset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/sxml-transforms/SSAX/lib/util.scm

    r11784 r13521  
    258258;           '((#\< . "&lt;") (#\> . "&gt;") (#\& . "&amp;") (#\" . "&quot;")))
    259259
     260; Check to see if str contains one of the characters in charset,
     261; from the position i onward. If so, return that character's index.
     262; otherwise, return #f
     263(define (index-cset str i charset)
     264  (let loop ((i i))
     265    (and (< i (string-length str))
     266         (if (memv (string-ref str i) charset) i
     267             (loop (inc i))))))
     268
    260269(define (make-char-quotator char-encoding)
    261270  (let ((bad-chars (map car char-encoding)))
    262 
    263     ; Check to see if str contains one of the characters in charset,
    264     ; from the position i onward. If so, return that character's index.
    265     ; otherwise, return #f
    266     (define (index-cset str i charset)
    267       (let loop ((i i))
    268         (and (< i (string-length str))
    269              (if (memv (string-ref str i) charset) i
    270                  (loop (inc i))))))
    271271
    272272    ; The body of the function
Note: See TracChangeset for help on using the changeset viewer.