;; ;; Base.egi ;; (define $id (lambda [$x] x)) (define $bool (matcher {[,$val [] {[$tgt (if (eq? val tgt) {[]} {})]}] [$ [something] {[$tgt {tgt}]}] })) (define $or (lambda [$b1 $b2] (if b1 #t b2))) (define $and (lambda [$b1 $b2] (if b1 b2 #f))) (define $not (lambda [$b] (match b bool {[,#t #f] [,#f #t]}))) (define $char (matcher {[,$c [] {[$tgt (if (eq? tgt c) {[]} {})]}] [$ [something] {[$tgt {tgt}]}] })) (define $eq?/m (lambda [$a $x $y] (match x a {[,y #t] [_ #f]}))) (define $compose (lambda [$f $g] (lambda $x (apply g (apply f x))))) (define $compose3 (lambda [$f $g $h] (lambda $x (apply h (apply g (apply f x))))))