Why does (.foo (new Bar)) use a different method invocation mechanism than (def bar (new Bar)) (.foo bar)?

2011-01-16 Thread Robert Campbell
I've been trying to understand exactly how these two statements are evaluated by tracing execution through Compiler.java, Reflector.java, etc of tag 1.2.0. The second form - (.foo bar), expanded to (. bar foo) - eventually calls Reflector.invokeNoArgInstanceMember. The first form - (.foo (new

Re: Why does (.foo (new Bar)) use a different method invocation mechanism than (def bar (new Bar)) (.foo bar)?

2011-01-16 Thread Rasmus Svensson
2011/1/16 Robert Campbell rrc...@gmail.com: The second form - (.foo bar), expanded to (. bar foo) - eventually calls Reflector.invokeNoArgInstanceMember. For that form, the clojure compiler cannot infer the type of bar, and does not know which exact method (class + type signature) .foo