Hey,

I'm trying to write a Macro for CLJS which calls a Javascript Function 
directly in the generated code (NOT in the macro). But since the javascript 
function (and namespace) is unknown to Clojure it fails trying to resolve 
it.

Extemely simplified example:

question.clj
(ns question)
(defmacro foo [a b]
  `(goog.something/other ~a ~b))

app.cljs
(ns app
  (:require-macros [question]))

(question/foo 1 2)

; so the result should be
(goog.something/other 1 2)

Another problem will be the missing goog.require('goog.something') but 
thats something I can work arround.

How do I tell the macro to leave the symbol (goog.something/other) as is 
instead of trying to resolve it?

/thomas

PS: I'm playing with goog.result/wait* which looks very interesting. The 
Goal would be a macro which lets me write:

(let [req1 (xhr/getJson "/object/1")
      req2 (xhr/getJson "/object/2")]
  (wait-success [obj1 req1
                        obj2 req2]
    (do-stuff obj1)
    (do-other obj2)
    (do-more obj1 obj2)))

wait-success being the macro, hiding all the CombinedResult wrapping and 
unwrapping. Trying to coordinate 2 seperate async requests is annoying with 
callbacks.

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