4 ms·
This highlights one of my biggest problems with lisp and macros. Every personal preference of every coder results in a macro that changes the basic symantics o
by aero142 17y ago
This highlights one of my biggest problems with lisp and macros. Every personal preference of every coder results in a macro that changes the basic symantics of the language. If I were to pick up code that used this macro, now I have to lean a new function call syntax. Just one macro to change the function call symantics, and just one DSL isn't a problem, but multiply that by every coder's interpretation of "natural calling convention" and every domain's DSL and next thing you know, you don't even recognize the language anymore. The original author usually thinks it make code "cleaner" and more readable, but I find that it rarely does.
- cemerick 17y agoI don't find the linked macro particularly compelling -- however, that macro doesn't change anything about the semantics of anything, it just automates the processing of arguments. Any function is always free to interpret its arguments however it wants, and a lot of clojure fns already accept & args consisting of key-value pairs that are turned into maps at runtime and then inspected.
- gcv 17y ago1. As cemerick pointed out, let-kw operates inside the function definition. It does not change any semantics. 2. Most keyword arguments for Clojure's built-in functions follow the calling convention which let-kw makes easy, whereas the pass-in-a-separate-map convention is not used in clojure.core anywhere (that I can think of). 3. I've heard this type of anti-DSL argument before, but no one making it has ever linked to a (source-available) project where this caused a problem. Frankly, I've never heard of a dailywtf-type horror story about this, either. Do you actually have some evidence to support your view?