Fork me on GitHub
#off-topic
<
2019-12-19
>
Vincent Cantin16:12:23

For those who saw the movie Inception … I present you the Macroception - a macro defined in a macro https://github.com/clojure/spec-alpha2/commit/e4ae2603c055950a1b9e649e6fdb022e109fabaf#diff-30b3955ecb734ef29c10aa50217b5066R934

rich 3
hammock 1
1
godmode 2
borkdude16:12:53

For lack of an Alex icon.

souenzzo16:12:39

:puredanger: please

alexmiller16:12:17

most annoying f'ing code I ever wrote

4
😆 1
Vincent Cantin16:12:36

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

borkdude16:12:00

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

Vincent Cantin16:12:02

to avoid the (list inside

alexmiller16:12:31

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

alexmiller16:12:11

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

😱 1
borkdude16:12:14

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

alexmiller16:12:31

defcompop is speculative, may not survive

alexmiller17:12:28

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

borkdude17:12:40

sometimes duplicating is worth it

alexmiller17: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.

alexmiller17:12:33

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

alexmiller17: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)

1
alexmiller17: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