Fork me on GitHub
#clojure-dev
<
2018-01-10
>
andy.fingerhut21:01:49

Does anyone know of code that takes an arg vector for a function, perhaps including destructuring expressions as can appear in source code, and checks it for validity / parses it? I know there is the code in Clojure itself, of course, but it turns it into let expression code. Looking to see if there is something that parses into some kind of data structure.

bronsa21:01:16

you can use the destructuring spec?

andy.fingerhut21:01:11

That's definitely one possible approach I will investigate. thx

andy.fingerhut23:01:23

Does anyone know of any examples of using a map at the end of a defn with multiple arities? I hadn't noticed that before. e.g. (defn foo ([x] (inc x)) {:a 1 😛 2}) This causes the map at the end to be conj'd onto the map of metadata that optionally appears after the doc string, and just before the definition of the first function arity.

andy.fingerhut23:01:56

Apparently it has been part of defn since 2009

andy.fingerhut23:01:53

huh, no that is the last time the lines of code doing that were edited, but it goes back farther. Weird that I have never noticed it.

seancorfield23:01:54

That's a fun easter egg 🙂