scm: Add list->char-set.
* module/srfi/srfi-14.mes (list->char-set): New function. * tests/srfi-14.test ("list->char-set!"): Test it.
This commit is contained in:
parent
408696f380
commit
3cbadcda86
|
@ -37,6 +37,9 @@
|
|||
|
||||
(define char-set:whitespace (char-set #\tab #\return #\vtab #\newline #\space))
|
||||
|
||||
(define (list->char-set lst)
|
||||
(apply char-set lst))
|
||||
|
||||
(define (string->char-set x . base)
|
||||
(apply char-set (append (string->list x) (if (null? base) '() (cdar base)))))
|
||||
|
||||
|
|
|
@ -42,6 +42,9 @@ exit $?
|
|||
(pass-if "char-set-contains?"
|
||||
(char-set-contains? char-set:whitespace #\space))
|
||||
|
||||
(pass-if "list->char-set!"
|
||||
(char-set= (char-set #\a #\b #\c) (list->char-set '(#\a #\b #\c))))
|
||||
|
||||
(pass-if "string->char-set!"
|
||||
(char-set= (char-set #\a #\b #\c #\d) (string->char-set! "d" (string->char-set "abc"))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue