forked from guenchi/Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
condition.sc
46 lines (32 loc) · 1.23 KB
/
condition.sc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
(library (core condition)
(export
or/=?
and/=?
not/=?
or/eq?
and/eq?
not/eq?
or/eqv?
and/eqv?
not/eqv?
or/equal?
and/equal?
not/equal?
)
(import
(scheme)
(only (core syntax) define-syntax-rule)
)
(define-syntax-rule (or/=? x e ...) (or (= x e) ...))
(define-syntax-rule (and/=? x e ...)(and (= x e) ...))
(define-syntax-rule (not/=? x e ...)(and (not (= x e)) ...))
(define-syntax-rule (or/eq? x e ...)(or (eq? x e) ...))
(define-syntax-rule (and/eq? x e ...)(and (eq? x e) ...))
(define-syntax-rule (not/eq? x e ...)(and (not (eq? x e)) ...))
(define-syntax-rule (or/eqv? x e ...)(or (eqv? x e) ...))
(define-syntax-rule (and/eqv? x e ...)(and (eqv? x e) ...))
(define-syntax-rule (not/eqv? x e ...)(and (not (eqv? x e)) ...))
(define-syntax-rule (or/equal? x e ...)(or (equal? x e) ...))
(define-syntax-rule (and/equal? x e ...)(and (equal? x e) ...))
(define-syntax-rule (not/equal? x e ...)(and (not (equal? x e)) ...))
)