Fork me on GitHub
Vincent Cantin16:12:23

For those who saw the movie Inception … I present you the Macroception - a macro defined in a macro

rich 12
hammock 4
godmode 8

For lack of an Alex icon.


:puredanger: please

Alex Miller (Clojure team)16:12:17

most annoying f'ing code I ever wrote

😆 4
Vincent Cantin16:12:36

I was wondering if it was possible to use a double syntax quote .. lol


yes... (in general, not referring to any specific code)

Vincent Cantin16:12:02

to avoid the (list inside

Alex Miller (Clojure team)16:12:31

well, that particular code is mostly a dupe of defop - that was the annoying part (defcompop mostly copies it)

Alex Miller (Clojure team)16:12:11

It's probably possible to DRY it out, but I assume that would be even worse

😱 4

Great line for on defn podcast btw. @U04V5V0V4 maybe you should re-invite Alex, it's been almost 50 episodes 🙂

Alex Miller (Clojure team)16:12:31

defcompop is speculative, may not survive

Alex Miller (Clojure team)17:12:28

@U8MJBRSR5 it is possible, but there are some very subtle tradeoffs and I found this was easier


sometimes duplicating is worth it

Alex Miller (Clojure team)17:12:16

a smarter person than me could probably improve that code

Vincent Cantin17:12:56

I left a dependency on spec alpha2 in my current project even if I don’t use it yet, because I am happy to see a new git commit hash each time I update my deps to their latest version.

Alex Miller (Clojure team)17:12:33

fyi, recent commits renamespaced, and prob going to change the project name too, which will break any dependees

Alex Miller (Clojure team)17:12:06

but back to defop/defcompop - these were really interesting to work through. they do highlight the downsides of the macro-expander approach in spec (requiring macros to do composition)

Alex Miller (Clojure team)17:12:31

if you don't care about the "language" side of specs (only about the programmatic side), that's not technically necessary anymore in spec 2 though