|
|
|
|
|
by filoeleven
1645 days ago
|
|
The last time “macros in Clojure” came up, I searched through some of the libraries I’ve run across to see how often they’re used and, as you suggest, it ain’t much. Re-frame has just one, and it looks like it’s used for testing. Clara-rules has eight that are used in the library, which implements a forward-chaining Rete rule engine. Core.logic has a handful, and that’s essentially “prolog inside Clojure.” So clearly those libraries get a lot of mileage out of data and functions, with just a dash of macro. I have yet to reach for them myself, and I can’t imagine a situation where I’d need a macro instead of a function. I think they’re probably great for library developers who are smarter than me, and I’m happy to leave them to it. |
|
That's pretty abstract but honestly its not really such an earthshattering feature. I'd argue it's pretty much necessary for any "final" programming language to be infinitely metaprogrammable (i.e. a lisp-3) but we don't have a mature language like that yet. Probably it will arrive from laskell/hisp kinda synthesis.