On Sat, Jan 15, 2011 at 6:44 AM, David Powell <djpow...@djpowell.net> wrote:
> Ken Wesson wrote:
>> Even then, couldn't the compiler generate the needed interfaces for a
>> specific Clojure project on the fly along with the appropriate calls?
>
> I don't see why it couldn't. Actually I just hacked the Clojure
> compiler to do that, removed the limitation on 4 args, and removed all
> of the static IFn$*** classes, and it seemed to work fine.
>
> The static IFn$*** classes probably have some small value though. For
> instance, if some Java code is passed a dynamically created fn, which
> it knows to have a primitive interface, it can cast it to one of these
> pre-defined interfaces, whereas if the interfaces were only created
> dynamically, it wouldn't be easy to get the Java to compile in that
> case.

I think this can be dealt with easily enough. If callability from Java
is desired, you could give the interface an explicit name, in effect,
using existing facilities such as records and protocols and gen-class;
or write an explicit interface in Java and implement it using proxy;
or etc.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to