Open leek5pin opened 8 years ago
This should be mostly correct:
(re-defn #'clojure.core/reduce [[:f :coll] [:f nil :coll]])
(re-defn #'clojure.core/map [[:f :colls]])
(re-defn #'clojure.core/str [[:args]])
The types so far are:
:arg
any argument
:coll
any collection
:n
any number
:colls
& collections
:str
string
:strs
& strings
:f
function
:fs
& functions
:args
any & arguments
That is for input:
(pre-re-defn #'clojure.core/reduce)
(pre-re-defn #'clojure.core/map)
(pre-re-defn #'clojure.core/str)
Whats' the nil
in 3-arg reduce?
good point. i just noticed that too. I'm not sure what I want that to be.
well, I want it to be :arg.
Do I? what do you think? We have no reason to check arbitrary arguments, and no reason to do anything at all with a function like #'clojure.core/str
I figured out why nil was there. :val
was missing from my hash map that went to :arg
. although my question still remains.
So, it seems to work for everything that does not have pattern matching in the function definition. I'll add functionality for that later. Before that I need to add some testing.
Currently, it will give you nil if the name of the argument is missing from the arg-type
map. The clojure cheatsheet entries are mostly the same as the doc-strings, so you can find that missing data there.
You can run this line of code to check it out:
(map #(println (pre-re-defn %)) (vals (ns-publics 'clojure.core)))
Looks great, thanks! I haven't tried it yet, but Tony and I will look at it on Tuesday.
two step process where minimal thing is humanly readable
need to incorporate
meta
to get metadata on functionsneed to parse metadata to be readable by our asset_handling