On Thu, May 3, 2012 at 10:16 AM, Neale Swinnerton <ne...@isismanor.com> wrote:

>
> In the clojure-1.4.0 src  I found that the flag is defined in 
> ./src/jvm/clojure/asm/Opcodes.java  but is never referenced anywhere, which 
> leads me to the conclusion that currently it isn't possible to generate a 
> varargs method in clojure.
>
> Am I missing something?
>
> Should I raise this as an issue on JIRA?
>
>

Following on from my earlier e-mail

I had a further tinker around with the clojure src. The attached small
patch against clojure-1.4.0 adds the ability to make a gen-class
method a varargs methodd

e.g with the patch you add some meta data to make the method a varargs
method like this.

    (ns foo
      (:gen-class
       :name Foo
       :methods [^:varargs [foo ["[Ljava.lang.String;"] void]]
       ))

Most of the work to actually do that is already there in the generator
, it's just a question of hooking it up in genclass.clj

I'd be interested in feedback on this. In particular it feels to me
that there should be some extra validation, such that gen-class
complains is you attempt to make a method a varargs method without the
necessary signature.


regards

Neale
{t: @sw1nn, w: sw1nn.com }

-- 
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

Attachment: add-varargs-support-to-gen-class-v0.diff
Description: Binary data

Reply via email to