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 wrote: > Patch attached to 272 (note it's

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 wrote: > Thanks! > > On Mon, Jun 11, 2012 at 9:22 PM, Michał Marczyk > wrote: >> >> See >> >> http://dev.clojure.org/jira/browse/CLJS-312 >> >> for :import (patch attached). Looking at 272 no

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 wrote: > 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 wrote: > > On 11 June 2012 18:49, David Nolen wrote: > >> Anyone game to submi

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 wrote: > On 11 June 2012 18:49, David Nolen wrote: >> Anyone game to submit some fixes? > > I am. I'll create a new ticket for :import and build :require w

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 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 Groups "Clojure" group. To

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 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 :as suppo

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) ... (goo

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ć wrote: > Hi all,

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 o

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ć wrote: > Hi