Thanks but... Ugh. I guess I should have mentioned this is Clojure/Javascript. Guessing clojure.reflect does not apply to JS.
Sorry for the trouble. -kt On Fri, May 27, 2016 at 1:30 PM, Gary Trakhman <[email protected]> wrote: > Here's a complex example using clojure.reflect, the intent of which was to > create a macro that emits type-hints for the actual constructors that are > available, to resolve ambiguity when there are multiple constructors with > the same number of arguments that differ in type. > > https://github.com/gtrak/interop/blob/master/src/interop/core.clj > > On Fri, May 27, 2016 at 1:25 PM Gary Trakhman <[email protected]> > wrote: > >> Yes, you'll have to use the reflection API to create a class dynamically. >> >> https://docs.oracle.com/javase/tutorial/reflect/member/ctorInstance.html >> >> On Fri, May 27, 2016 at 1:24 PM hiskennyness <[email protected]> wrote: >> >>> qooxdoo lets us supply oft-used widget parameters to the constructor. >>> For example, a button can specify its label and icon at new time. And this >>> works fine from cljs: >>> >>> (new qx.ui.mobile.form.Button "Go!") ;; label is the first arg >>> >>> But I am wrapping qooxdoo in something more concise and want to be able >>> to code: >>> >>> (qxia/make (::Button "Go!") >>> ..other init params to be "set" >>> >>> Unfortunately I cannot even >>> >>> (new (qx-class qia-type)) ;; computed class >>> >>> Let alone >>> >>> (apply new (qx-class qxia-type) make-inits) >>> >>> Not that I thought I would get away with it. :) I grok new is special. >>> >>> I can fall back on the qooxdoo API and use setLabel and setIcon, but I >>> like learning so I thought I would ask if there were some way to: >>> >>> 1. compute a class (preferably by first constructing a name) and/or >>> 2. do the moral equivalent of applying new to parameters >>> >>> -hk >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to [email protected] >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> To unsubscribe from this group, send email to >>> [email protected] >>> 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 [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to a topic in the > Google Groups "Clojure" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojure/4HWF7725JvM/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Kenneth Tilton 54 Isle of Venice Dr, Apt 5 Fort Lauderdale, FL 33301 [email protected] 646-269-1077 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
