I'm trying to write a macro that expands from this:
(product-context [n rule0, m rule1)]
(rule-maker2 (+ n m)) rule3))
Into this (assume that conc-fn and conc-products are functions):
(fn [tokens]
(if-let [[remainder# n m] (conc-products [rule0 rule1] tokens)]
(conc-fn [(rule-maker2 (+ n m)) rule3] remainder#)))
...but I can't figure out how to change [n rule0 m rule1] to (if-let
[[remainder# n m] (conc-products [rule0 rule1] tokens)] ...). I tried
reading the implementations of some core macros like if-let, but it
didn't help because if-let and when-let require one binding.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---