I don't think proxy creates a named class, though. I believe h2 looks up 
user functions via a string naming the class.

On Saturday, July 20, 2013 9:31:38 AM UTC-7, Alex Fowler wrote:
>
> So, out of what you're saying - you want to implement an interface, 
> without adding new methods - I strongly suggest using proxy and delegate 
> all the type-resolution hassle to JVM (just rely on it).
>
> If you are really sure you need specifying types explicitly, then use type 
> hints and dedicated clojure handling functions. Explore typehints like 
> `^ints` or `^floats` and array-related functions like (ints) or 
> (int-array). I would avoid using gen-class until it is really necessary 
> (out of bytecode compatibility requirements I guess)
>
>
> суббота, 20 июля 2013 г., 17:42:36 UTC+4 пользователь Brian Craft написал:
>>
>> I'm trying to write a user function for h2. I think that means I need 
>> gen-class, but I'm extremely fuzzy on how java class loading works. Perhaps 
>> my question is moot, because I just ran across this obscure note in a 
>> gen-class example:
>>
>> ;; declare only new methods, not superclass methods
>>
>> If I'm implementing an interface in h2, does that mean I shouldn't 
>> declare the methods? I also found a stackoverflow answer that suggested 
>> something like
>>
>> ["[Ljava.lang.Integer;"]
>>
>> which looks like black magic, and I can't find this in the docs anywhere.
>>
>> On Saturday, July 20, 2013 2:39:06 AM UTC-7, Alex Fowler wrote:
>>>
>>> Some questions to clarify things up:
>>>
>>> Do you mean - how do you create that type of value or how do you 
>>> generatte a method that accepts that very type?
>>>
>>> Are you sure you need to use gen-class and not proxy or reify?
>>>
>>> суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь Brian Craft написал:
>>>>
>>>> For implementing a method with this signature
>>>>
>>>> int getType(int[] inputTypes) 
>>>>
>>>> How would I declare inputTypes in gen-class?
>>>>
>>>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to