Rationale
Given that Clojure constrains import, it could infer/guess more about untyped method calls.
Plan
- Given
(.foo untyped-x ...)
- See which imported classes have a
foo
method of matching arity - Compile one or more speculative typed calls
- if type guard fails, default to reflection
- See which imported classes have a
- Auto-method wrapper generation based on above
(map .foo ...)
- caching?
Issues
- Wait for new compiler
Labels:
1 Comment
Hide/Show CommentsSep 09, 2012
Kevin Downey
not sure what "caching?" means above but I have some changes to clojure that cause it to generate code that caches reflector objects (Methods) for reflective calls.
https://github.com/hiredman/clojure/commits/reflection-method-caching