(cond ((or (key? key) (button? key))
(put! key))
((char-set? key)
- (for-each put! (char-set-members key)))
+ (char-set-for-each put! (char-set-intersection key char-set:ascii)))
((prefixed-key? key)
(let ((prefix (except-last-pair key)))
(comtab-put! (if (null? prefix)
end))
(define (char-set->ascii-string char-set)
- (list->string (char-set-members char-set)))
+ (char-set->string (char-set-intersection char-set char-set:ascii)))
(define (undo-record-point! #!optional buffer)
(let ((group (buffer-group (if (default-object? buffer)
(cond ((char? char)
(vector-set! entries (char->integer char) entry))
((char-set? char)
- (for-each (lambda (char)
- (vector-set! entries (char->integer char) entry))
- (char-set-members char)))
+ (char-set-for-each
+ (lambda (char)
+ (vector-set! entries (char->integer char) entry))
+ (char-set-intersection char char-set:ascii)))
(else
(error:wrong-type-argument char "character" 'set-char-syntax!)))))
(cond ((char? key)
(vector-set! table (char->integer key) handler))
((char-set? key)
- (for-each (lambda (char)
- (let ((i (char->integer char)))
- (if (eq? (vector-ref table i) else-action)
- (vector-set! table i handler))))
- (char-set-members key)))
+ (char-set-for-each
+ (lambda (char)
+ (let ((i (char->integer char)))
+ (if (eq? (vector-ref table i) else-action)
+ (vector-set! table i handler))))
+ (char-set-intersection key char-set:ascii)))
(else
(error:wrong-type-argument key "char or char-set")))))
(lambda (port emit fifo)
(append! (cdr ranges) (list char))
ranges))
- (let ((chars (char-set-members char-set)))
+ (let ((chars
+ (char-set->list (char-set-intersection char-set char-set:ascii))))
(if (pair? chars)
(if (pair? (cdr chars))
(let ((builder (string-builder)))
parts))))))))
(define (case-fold-char-set c)
- (let loop ((chars (char-set-members c)) (chars* '()))
- (if (pair? chars)
- (loop (cdr chars)
- (if (char-alphabetic? (car chars))
- (cons* (char-upcase (car chars))
- (char-downcase (car chars))
- chars*)
- chars*))
- (apply char-set chars*))))
+ (let ((char-set (char-set-intersection c char-set:ascii)))
+ (char-set-union char-set
+ (char-upcase char-set)
+ (char-downcase char-set))))
(define (rexp-n*m n m . rexps)
(guarantee exact-nonnegative-integer? n 'rexp-n*m)