hara.common.grammar-macro
tf-case
added in 4.0
(tf-case [_ val & options])transforms the case statement to switch representation
tf-do-arrow
added in 4.0
(tf-do-arrow [_ & body])do:> transformation
(tf-do-arrow ’(do:> 1 2 (return 3))) => ’((fn [] 1 2 (return 3)))
tf-forange
added in 4.0
(tf-forange [_ [type? sym size params] & body])creates the forange form
(tf-forange ’(forange i 10(print i))) => ’(for [(var i 0) (< i 10) (:= i (+ i 1))] (print i))
(tf-forange ’(forange [i 10 3 -2] (print i))) => ’(for [(var i 10) (< i 3) (:= i (- i 2))] (print i))
tf-if
added in 3.0
(tf-if [_ check then & [else]])transforms if to branch
(tf-if ’(if true :A :B)) => ’(br* (if true :A) (else :B))
tf-lambda-arrow
added in 4.0
(tf-lambda-arrow [_ & more])generalized lambda transformation
tf-tcond
added in 4.0
(tf-tcond [_ & more])transforms the ternary cond
(tf-tcond ’(:?> :a a :b b :else c)) => ’(:? :a [a (:? :b b c)])
tf-when
added in 3.0
(tf-when [_ check & body])transforms when to branch
(tf-when ’(when true :A :B :C)) => ’(br* (if true :A :B :C))
tf-xor
added in 4.0
(tf-xor [_ a b])transforms to xor using ternary if
(tf-xor ’(xor a b)) => ’(== (not (not a)) (not (not b)))