Re: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-14 Thread David Nolen
:require now no longer requires :as. :require now also supports :refer (thanks Michal!) which brings us in line with Clojure on the JVM. Still discussing the implications of doing :import (CLJS-312). David On Mon, Jun 11, 2012 at 9:36 PM, Michał Marczyk michal.marc...@gmail.comwrote: Patch

Re: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-11 Thread tomoj
This workaround doesn't work if the super-namespace doesn't exist. For example, goog.async is never provided, but goog.async.Deferred is provided (in the third-party bits of closure) and is itself the Deferred constructor. (:require [goog.ui :as ui]) similarly throws an error for me. Any

Re: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-11 Thread David Nolen
This is an known existing issue. Using :require to important constructors just doesn't make sense. 2 patches I think could help here: 1) support for :import 2) support for :require w/o :as Anyone game to submit some fixes? David On Thu, Jul 28, 2011 at 10:41 AM, Marko Kocić

Re: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-11 Thread tomoj
I noticed that it works fine to just do (:require [goog.async.Deferred :as d]) and to use (goog.async.Deferred.) to call the constructor (in this case Deferred is also used as a namespace, so require makes sense). With :require w/o :as support, you'd have (:require goog.async.Deferred) ...

Re: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-11 Thread David Nolen
On Mon, Jun 11, 2012 at 1:37 PM, tomoj t...@tomoj.la wrote: I noticed that it works fine to just do (:require [goog.async.Deferred :as d]) and to use (goog.async.Deferred.) to call the constructor (in this case Deferred is also used as a namespace, so require makes sense). With :require w/o

Re: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-11 Thread Michał Marczyk
On 11 June 2012 18:49, David Nolen dnolen.li...@gmail.com wrote: Anyone game to submit some fixes? I am. I'll create a new ticket for :import and build :require w/o :as on top of that (attaching patch to CLJS-272). M. -- You received this message because you are subscribed to the Google

Re: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-11 Thread Michał Marczyk
See http://dev.clojure.org/jira/browse/CLJS-312 for :import (patch attached). Looking at 272 now... On 12 June 2012 03:16, Michał Marczyk michal.marc...@gmail.com wrote: On 11 June 2012 18:49, David Nolen dnolen.li...@gmail.com wrote: Anyone game to submit some fixes? I am. I'll create a

Re: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-11 Thread David Nolen
Thanks! On Mon, Jun 11, 2012 at 9:22 PM, Michał Marczyk michal.marc...@gmail.comwrote: See http://dev.clojure.org/jira/browse/CLJS-312 for :import (patch attached). Looking at 272 now... On 12 June 2012 03:16, Michał Marczyk michal.marc...@gmail.com wrote: On 11 June 2012 18:49, David

Re: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-11 Thread Michał Marczyk
Patch attached to 272 (note it's created on top of 312). Cheers, M. On 12 June 2012 03:22, David Nolen dnolen.li...@gmail.com wrote: Thanks! On Mon, Jun 11, 2012 at 9:22 PM, Michał Marczyk michal.marc...@gmail.com wrote: See http://dev.clojure.org/jira/browse/CLJS-312 for :import

Re: Clojurescript - Javascript constructor and namespace with the same name problem

2011-07-30 Thread Chris Granger
FWIW, one work around for this is to include the sub-namespace as well and reference it from that one. So in your example: (ns notepad (:require [goog.dom :as dom] [goog.ui :as ui] [goog.ui.Zippy :as Zippy])) (ui/Zippy. ttt sss) On Jul 28, 7:41 am, Marko Kocić

Clojurescript - Javascript constructor and namespace with the same name problem

2011-07-28 Thread Marko Kocić
Hi all, When dealing with ClojureScript and Closure library it happens pretty often that Closure namespace is in the same time constructor for some object. Take a look for this example: (ns notepad (:require [goog.dom :as dom] [goog.ui.Zippy :as Zippy])) First, require forces me