Commit 6ab17ffa authored by Niels Möller's avatar Niels Möller
Browse files

* src/scm/make-char-classes.scm (char-set-assoc): A real function

now, as I'm not sure that the usual assoc handles char-sets.
(char-set-empty?): Use char-set:empty (new in scsh-0.5.2).
(char-set=?): Removed function, scsh-0.5.2 provides a similar
function named char-set=.

Rev: src/scm/make-char-classes.scm:1.3
parent 88543f0a
......@@ -92,14 +92,14 @@
(filter (invert-predicate integer-or-char?) o))))
(else (my-error "Bad char set specification ~s" o))))
;; Depends on charsets implemented as strings
(define char-set=? string=?)
(define char-set-empty?
(let ((empty (chars->char-set '())))
(lambda (o) (char-set=? o empty))))
(define (char-set-empty? o)
(char-set= o char-set:empty))
(define char-set-assoc assoc)
(define (char-set-assoc set alist)
(cond ((null? alist) #f)
((char-set= set (caar alist)) (car alist))
(else (char-set-assoc set (cdr alist)))))
;; We use an acyclic graph, where the input char-sets are used as
;; roots, and two intersecting nodes will branch into three childen,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment