diff --git a/README.md b/README.md index 04f53a68..7d986ddb 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ | 6.2.5 Syntax of numerical constants | yes | | | 6.2.6 Numerical operations | yes | some functions that return multiple values are not supported for now. Also, picrin does not provide complex library procedures. | | 6.2.7 Numerical input and output | no | | -| 6.3 Booleans | incomplete | TODO: `boolean=?` | +| 6.3 Booleans | yes | | | 6.4 Pairs and lists | yes | | | 6.5 Symbols | incomplete | TODO: `symbol=?`, `symbol->string`, `string->symbol` | | 6.6 Characters | incomplete | TODO: almost all functions in the section :-( | diff --git a/piclib/built-in.scm b/piclib/built-in.scm index 6a27bf5b..e98b043b 100644 --- a/piclib/built-in.scm +++ b/piclib/built-in.scm @@ -244,3 +244,13 @@ (eq? '*values-tag* (car res))) (apply consumer (cdr res)) (consumer res)))) + +(define (boolean=? . objs) + (define (every pred list) + (if (null? list) + #t + (if (pred (car list)) + (every pred (cdr list)) + #f))) + (or (every (lambda (x) (eq? x #t)) objs) + (every (lambda (x) (eq? x #f)) objs)))