We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
When writing compilers pattern matching is incredibly useful. Dan & Will both recommend supporting function application.
(defn parse [expr] (match [expr] [['if (test :> parse) (then :> parse) (else :> parse)]] {:op :if :test test :then then :else else}))
A match-syntax macro could probably be a lot cleaner:
match-syntax
(defn parse [expr] (match-syntax expr (if ~(test :> parse) ~(then :> parse) ~(else :> parse)) {:op :if :test test :then then :else else}))