git » homepage.git » master » tree

[master] / archive / forums / hacker-news / raw / items / 8924337.json

{"by":"wooby","id":8924337,"kids":[8924545],"parent":8924227,"text":"I agree that Feature Expressions don&#x27;t add power, because yes, they are semantically equivalent to C preprocessing and orthogonal to the idea of Lisp.<p>What excites us most about Feature Macros is that they <i>do</i> add power.  Here is an example of something we think is powerful from the proposal - a cross-platform macro:<p><pre><code>    (case-host\n      :cljs nil\n      :clj  (defmacro my-macro [name &amp; body]\n              (case-target\n                :clj  `(.println (System&#x2F;-out) (str (do ~@body)))\n                :cljs `(.log js&#x2F;console (str (do ~@body))))))</code></pre>","time":1421862691,"type":"comment"}