3 ;;; Mes --- Maxwell Equations of Software
4 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
6 ;;; This file is part of Mes.
8 ;;; Mes is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; Mes is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
23 ;;; Minimal implementation of srfi-14, for nyacc.
27 ;; FIXME: have structs
28 (define (char-set . x)
32 (and (pair? x) (eq? (car x) '*char-set*)))
34 (define (char-set= a b)
35 (and (char-set? a) (char-set? b)
38 (define char-set:whitespace (char-set #\tab #\return #\vtab #\newline #\space))
40 (define (string->char-set x . base)
41 (apply char-set (append (string->list x) (if (null? base) '() (cdar base)))))
43 (define (string->char-set! x base)
44 (set-cdr! (last-pair base) (string->list x))
47 (define (char-set-contains? cs x)