I don't understand (def someVar (newInstantiatedGoogFxObject...)).
Why does (def someVar (new-goog-fx-object ...)) fail whereas (let
[somevar (new-goog-fx-object ...) ] works?

I'm trying to define a variable using def and instantiate a new
goog.fx.DragDrop, but this clojurescript:

    (def dragSource (fx/DragDrop. "myText" "stuff"))

produces this javascript and resulting error:

    dom.test.dragSource = (new goog.fx.DragDrop("myText","stuff"));

    -->Uncaught TypeError: undefined is not a function

whereas the let-based version instantiates and executes just fine:

    (defn run-draganddrop []
        (let [dragSource (fx/DragDrop. "myText" "stuff")]
            ...
        )
    )

-----------------------
Here is the actual source file:

(ns dom.test
  (:require [goog.fx               :as fx]
            [goog.graphics         :as graphics]
))

;FAILS in the browser. It requires the expression to be a function.
The expression is undefined.
;IMO the expression should produce a new object and should not be a
function.
(def dragSource (fx/DragDrop. "myText" "stuff"))

;SUCCEEDS.
(defn run-draganddrop []
  (let [dragSource (fx/DragDrop. "myText" "stuff")]
  )
)

Thanks.  Bill

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