Closed runexec closed 11 years ago
These macros are rather too specific in what they do. Macros that add syntax sugar should be used sparingly, as they trade brevity for complexity, which is almost always not worth the trouble.
How about a def-behave that just does (def ~-symbol (behavioir ~@body)) ?
That's better, but still too specific. Clojure doesn't have def-atom
or def-agent
; it's sufficient just to have def
and atom
or def
and agent
.
Another big problem with overusing def* macros is that it implies something magical is going on. Often I regret adding defroutes
to Compojure, because it obscures the meaning of the routes
function.
Those are some very good points. I'll see what else I can come up with. Thanks for the input and the speedy responses.
def-behave-> and def-behave->>