mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-22 07:09:18 +02:00
Adding char-set-fold and char-set-for-each.
This commit is contained in:
parent
80879d2683
commit
d7e65edc96
3 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
(export
|
||||
Char-Set char-set? char-set-contains?
|
||||
char-set ucs-range->char-set char-set-copy char-set-size
|
||||
char-set-fold char-set-for-each
|
||||
list->char-set char-set->list string->char-set char-set->string
|
||||
char-set-adjoin! char-set-adjoin char-set-union char-set-union!
|
||||
char-set-intersection char-set-intersection!
|
||||
|
|
|
@ -10,6 +10,12 @@
|
|||
|
||||
(define char-set-size iset-size)
|
||||
|
||||
(define (char-set-fold kons knil cset)
|
||||
(iset-fold (lambda (i acc) (kons (integer->char i) acc)) knil cset))
|
||||
|
||||
(define (char-set-for-each proc cset)
|
||||
(iset-for-each (lambda (i) (proc (integer->char i))) cset))
|
||||
|
||||
(define (list->char-set ls)
|
||||
(list->iset (map char->integer ls)))
|
||||
(define (char-set->list cset)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
(include "extras.scm")
|
||||
(export
|
||||
char-set ucs-range->char-set char-set-copy char-set-size
|
||||
char-set-fold char-set-for-each
|
||||
list->char-set char-set->list string->char-set char-set->string
|
||||
char-set-adjoin! char-set-adjoin char-set-union char-set-union!
|
||||
char-set-intersection char-set-intersection!
|
||||
|
|
Loading…
Add table
Reference in a new issue