git » homepage.git » master » tree

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

{"by":"wooby","id":8924093,"kids":[8924227],"parent":8923939,"text":"Ah, point taken.  Here is a valid version:<p><pre><code>    (case-host\n     :clj\n     (deftype Foo []\n       JvmOnlyInterface\n       (aMethod [blah blah] ...))\n     :cljs\n     (deftype Foo []))\n    \n    (extend-type Foo\n      SomeCommonProtocol\n      (someMethod [blah] ...))\n</code></pre>\nIt is true there are countless examples.  There are also countless counter-examples.  And for the examples that are competitive in terseness, there is already cljx.<p>I personally don&#x27;t &quot;just want to hack it&quot;, especially when it comes to writing portable code.  I agree that portability poses subtle new challenges to application design.  I just prefer to meet those challenges in a way that is programmable, which syntactic extension is definitely not.","time":1421860622,"type":"comment"}