HI Michael,

If I understand correctly, the proxy function might be what you are looking
for.  I think gen-class can only be used with AOT compilation.

-Rob

On Sun, Jun 27, 2010 at 8:19 AM, Michael Jaaka <michael.ja...@googlemail.com
> wrote:

> Hi,
>
> Is there any way to generate class in runtime and then use it?
> How far I can only generate interfaces.
>
> This works:
>
> (do
> (gen-interface  :name test.commons.Me
>                :methods [[ me [ String ] void ]])
>
> (def z (reify test.commons.Me
>                        (me [t z] (println "hello world" z))))
>
> (.me z "wowo")
> )
>
>
>
> That doesn't:
>
>
>
> (do
> (gen-class :name test.commons.Mee
>                :state sema
>                :methods [
>                                [ me2 [ String ] void ]]
>                :prefix "mee-"
> )
>
> (defn mee-me2[ this a ]
>        (println "hello" a "had state" (.sema this)))
>
> (.me2 (test.commons.Mee. ) "world")
> )
>
>
>
> --
> 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<clojure%2bunsubscr...@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 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