Re: Resolve function or object by name in ClojureScript

2014-08-25 Thread Ashton Kemerling
To be fair, calling from outside of Clojurescript is probably the only use-case for this behavior that I can imagine, which is exactly what ^:export was designed (and named) for. -- Ashton Kemerling On Mon, Aug 25, 2014 at 12:18 PM, Thomas Heller wrote: > It is possible, the question is WHEN?

Re: Resolve function or object by name in ClojureScript

2014-08-25 Thread Thomas Heller
It is possible, the question is WHEN? You can make a function callable by name if you export it. (ns myns) (def ^:export testfn [] :foo) can be called like so, must be careful with name munging though: (let [the-fn (aget js/window "myns" "testfn")] (the-fn)) which also works with advanced

Re: Resolve function or object by name in ClojureScript

2014-08-25 Thread David Nolen
Any such facility is at odds with Google Closure Compiler's advanced compilation. David On Mon, Aug 25, 2014 at 11:59 AM, Timur wrote: > Hi everybody, > > Is there a way to resolve a function or object using its string name in > ClojureScript? I found this however it is old: > > http://stackover

Resolve function or object by name in ClojureScript

2014-08-25 Thread Timur
Hi everybody, Is there a way to resolve a function or object using its string name in ClojureScript? I found this however it is old: http://stackoverflow.com/questions/12020576/resolve-function-throws-an-error-in-clojurescript-but-not-clojure/12020663#12020663 Thanks in advance. -- You rec