Currently, you can wrap the JS call in js* like so (js*
"MyLib.doSomething(arg1,arg2)").
So this will pass the compile time without resolving the external lib
calls.

It is worth noting that you may come across an interesting problem
that I did in similar scenario to yours.
If you set the optimizations flag to advanced, the compiler will most
probably rename the external lib function name calls and you'll get an
"... undefined" error at runtime.

In a nutshell, Google Closure Compiler has support for "externs"
option that can be passed in to the compiler/optimizer.
The "externs" option presents the list of JS files to be excluded
during the optimization process, hence no renaming will take places
for those external library members.
An enhancement ticket has been opened for this and I am currently
working on the patch.

Refer to my post here for more detail on this:
http://groups.google.com/group/clojure/browse_thread/thread/2b760a0acb2cbc1e/5e890da90e2bc771

-Alen

--
Science is what you know, philosophy is what you don't know.
-- Bertrand Russell

On Aug 5, 3:00 am, Timothy Baldridge <tbaldri...@gmail.com> wrote:
> I'm looking into using clojurescript on our website. However, we have
> several external js libraries that we need to access from
> ClojureScript. Is there a way to execute javascript code from
> ClojureScript and not have the function names resolved at compile
> time?
>
> Basically I want to do:
>
> (foo "test" 1 2)
>
> where foo is a global js function that isn't visible to the
> clojurescript compiler, but will be when the code is loaded in the
> browser.
>
> Timothy
>
> --
> “One of the main causes of the fall of the Roman Empire was
> that–lacking zero–they had no way to indicate successful termination
> of their C programs.”
> (Robert Firth)

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