mkremins / flense

Edit trees, not text
MIT License
101 stars 3 forks source link

Action definition API is weird #41

Closed mkremins closed 10 years ago

mkremins commented 10 years ago

These lines from flense-demo (also appearing in flense-nw) are evidence of a Bad Thing. We're basically forcing consumers to :require the various flense.actions.* namespaces for the "side effect" of evaluating defaction calls that actually define the actions each namespace exports.

defaction itself is kind of a weird API. There's no real reason actions have to be defmethod clauses in what amounts to a global mutable dispatch table, and as far as I can tell the fact that they are is an artifact of some no-longer-relevant reasoning from months ago. Probably every one of these namespaces should just define and export a map from action names to action "specs" and the consumer should just merge these together as desired.