29 ms·
I have a few examples of it. One dev came up with their own macro that linked together the http client and json parsing into one magic macro which allowed them
by cogman10 3y ago
I have a few examples of it.
One dev came up with their own macro that linked together the http client and json parsing into one magic macro which allowed them to also format the json, log it, and a bunch of other conveniences mostly for that dev. Unfortunately, the function was highly tailored to where it existed (with hard coded params and such). It's invocation ended up looking something like `(ht-j g foo 'log')` (because this dev also liked shortening everything).
Another example of this is some devs wanted to make a super generic data fetching... thingy... so they came up with this wild macro where you could feed in http urls and a custom configuration and it'd expose calls to that downstream services. It allowed for a sql like interface into several different microservices. Interesting in concept, impossible to maintain. That project was ultimately scrapped.
I was unaware of "the lisp curse" before my comment. This was just what my company experienced.
- kazinator 3y agoSomething like (ht-j g foo 'log') could be a function. Someone could do that in Javascript like htj.(g, foo, 'log') or whatever, which is no more or less clear. You wouldn't have a code generation step to deal with, but you can expand macro calls in situations when the macro body isn't readable.