: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
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
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ć
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)
...
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
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
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
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
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
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ć
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
11 matches
Mail list logo