--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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 clojure+u...@googlegroups.com.
mynamespace.make = function(cls) {
return new (Function.prototype.bind.apply(cls, arguments));
};
(apply mynamespace/make qx.ui.mobile.form.Button ["Go!"])
The new operation intentionally demands a statically knowable type to construct. While this is true of Java as well, it's not true of JavaScript. However, it is true of the Google Closure compiler's "type system" for advanced compilation. That said, if the library you're using isn't going to be optimized with advanced, you can do any typical dynamic metaprogramming you'd want to do in JavaScript and call in to that.
mynamespace.make = function(cls) {
return new (Function.prototype.bind.apply(cls, arguments));
};Then from ClojureScript:
(apply mynamespace/make qx.ui.mobile.form.Button ["Go!"])
<script type="text/javascript">var MyTerop = {};MyTerop.make = function(cls) {return new (Function.prototype.bind.apply(cls, arguments));};</script>
(apply MyTerop/make(qxia-type-to-qx-class type)["It Woiks!", "identica/mmedia/games.png"])
WARNING: No such namespace: MyTerop, could not locate MyTerop.cljs, MyTerop.cljc, or Closure namespace "" at line 81 src/tiltontec/qxia/base.cljsWARNING: Use of undeclared Var MyTerop/make at line 81 src/tiltontec/qxia/base.cljs
MyTerop = {};MyTerop.make = function () {};
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@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 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 clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.