Rationale
We need an interface to type information that:
- encapsulates Java reflection
- returns Clojure data not Java's reflection objects
- supports ASM in addition to reflection
- ASM offering type info without loading classes
- supports ClojureCLR
Users will be compilers and tools, as well as REPL users through an interactive wrapper interface.
Issues
Note, this list is primarily RH's notes on Stu's patch.
- hrm, the predicate language in describe
- always and/every?
- single pred would allow arbitrary logic
- Explore query-by-example, i.e. user provides partial data in same shape as returned
- always and/every?
- reflect-impl bad name for fn
- prefer things like do-reflect, still a verb
- typeref->name - typename
- typeref->sym - typesym
- typeref->* implies things of type typeref, we don't want to reify protocol like that
- ditto - typepath
- are we exposing the descriptor, internal-name confusion by having these helpers public, with no better docs than we complain about?
- defrecord Constructor/Method/Field
- make sure distinguishing these by type adds value
- much pain today in writing generic reflection code due to unequal treatment of members
- i.e. ctors are glorified static methods
- I'd prefer a first cut with maps and see where that is inadequate
- perhaps already done, notes?
- defrecord JavaReflector/AsmReflector
- unlike Contrstructor/Method/Field, these are plainly not information but are programming constructs and should be deftypes
- describe's built in pprint
- can we not get pprint to print the data structures nicely?
- giving the user a bunch of printout they can't lift and use as data isn't that great
- may be more useful to enhance pprint
Labels: