[CLJ-731] Create macro to variadically unroll a combinator function definition Created: 26/Jan/11 Updated: 28/Jan/11
|Fix Version/s:||Approved Backlog|
Clojure contains a set of combinators that are implemented in a similar, but slightly different way. That is, they are implemented as a complete set of variadic overloads on both the call-side and also on the functions that they return. Visually, they all tend to look something like:
To build this type of function for each combinator is tedious and error-prone.
There must be a way to implement a macro that takes a "specification" of a combinator including:
And builds something like the function foo above. This macro should be able to implement the current batch of combinators (assuming that http://dev.clojure.org/jira/browse/CLJ-730 is completed first for the sake of verification).
|Comment by Stuart Halloway [ 28/Jan/11 9:03 AM ]|
This seems useful. Rich, would you accept a patch?
|Comment by Stuart Halloway [ 28/Jan/11 9:40 AM ]|
Nevermind, just saw that Rich already suggested this on the dev list. Patch away.