~jojo/Carth

ref: d43904b49f898feb4b2e6ebef26d62e5651047bf Carth/std/macros.carth -rw-r--r-- 284 bytes
d43904b4JoJo std: Add Mutex 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
(defmacro apps
  (case (op x) x)
  (case (op x1 x2 xs ...) (apps op (op x1 x2) xs ...)))

(defmacro appsr
  (case (op x) x)
  (case (op x xs ...) (op x (appsr op xs ...))))

(defmacro list
  (case (xs ...) (appsr list/cons xs ... Nil)))

(defmacro +s (case (xs ...) (apps + xs ...)))