I wanted a function literal in Clojure that can take any number of arguments, but doesn't actually use them. So I've discovered %&
('rest arg' for function literal) and #_
('discard' reader macro).
But how they work together surprises me:
=> (macroexpand `#(... #_ %&))
(fn* [& rest__125459__125460__auto__] (...))
This looks like what I wanted (and seems to work in the end), but is it how the discard macro supposed to work? The doc says:
The form following #_ is completely skipped by the reader.
But apparently here the ignored %&
form has a side-effect, that is it affects the function literal args list. Should I rely on this behavior or does it look more like a bug?