add boolean=?
This commit is contained in:
parent
1fa0308ea8
commit
6296d4bee2
|
@ -65,7 +65,7 @@
|
||||||
| 6.2.5 Syntax of numerical constants | yes | |
|
| 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.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.2.7 Numerical input and output | no | |
|
||||||
| 6.3 Booleans | incomplete | TODO: `boolean=?` |
|
| 6.3 Booleans | yes | |
|
||||||
| 6.4 Pairs and lists | yes | |
|
| 6.4 Pairs and lists | yes | |
|
||||||
| 6.5 Symbols | incomplete | TODO: `symbol=?`, `symbol->string`, `string->symbol` |
|
| 6.5 Symbols | incomplete | TODO: `symbol=?`, `symbol->string`, `string->symbol` |
|
||||||
| 6.6 Characters | incomplete | TODO: almost all functions in the section :-( |
|
| 6.6 Characters | incomplete | TODO: almost all functions in the section :-( |
|
||||||
|
|
|
@ -244,3 +244,13 @@
|
||||||
(eq? '*values-tag* (car res)))
|
(eq? '*values-tag* (car res)))
|
||||||
(apply consumer (cdr res))
|
(apply consumer (cdr res))
|
||||||
(consumer 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)))
|
||||||
|
|
Loading…
Reference in New Issue