[ClojureScript] Re: Idiomatic way of accessing JavaScript properties in nested "namespaces"

2014-08-28 Thread Francis Avila
Avoid dots in the name part of symbols. "js/a.b.c" works to reference "a.b.c" by value (i.e. without calling it), but it's not idiomatic. Prefer (.. js/a -b -c), or using your examples: (.. js/Foo -Bar -Foo2 -myProperty) (.. js/Foo -Bar -Foo2 myMethod) The "js" pseudo-namespace is special becau

[ClojureScript] Re: Idiomatic way of accessing JavaScript properties in nested "namespaces"

2014-08-28 Thread Ivan L
why is it not considered idiomatic, I see that pattern used all the time. Doesn't clojure itself use fq namespaces occasionally? (just no js prefix) On Thursday, August 28, 2014 5:45:55 PM UTC-4, Francis Avila wrote: > Avoid dots in the name part of symbols. "js/a.b.c" works to reference "a.b.c

[ClojureScript] Re: Idiomatic way of accessing JavaScript properties in nested "namespaces"

2014-08-28 Thread Rafal Spacjer
Sounds good, thank you. Of course I agree, that using dots (like in "(js/console.log x)") is faster to write. W dniu czwartek, 28 sierpnia 2014 23:45:55 UTC+2 użytkownik Francis Avila napisał: > Avoid dots in the name part of symbols. "js/a.b.c" works to reference "a.b.c" > by value (i.e. witho

[ClojureScript] Re: Idiomatic way of accessing JavaScript properties in nested "namespaces"

2014-08-29 Thread Rafal Spacjer
On the other hand, I've found this JIRA bug: http://dev.clojure.org/jira/browse/CLJS-455 with the comment of David Nolen: "This patch creates issues around using constructors provided by libraries outside ClojureScript and GClosure. Also from Rich's original commit support js prefix, it seems l

[ClojureScript] Re: Idiomatic way of accessing JavaScript properties in nested "namespaces"

2014-08-29 Thread Francis Avila
There's no question that it's allowed. You can use js/a.b.c However, it is *less idiomatic* because there's no analogous construct in Clojure (not ClojureScript) code. In Clojure, a symbol referencing a var in a namespace will only ever have a name part without dots. The fact that the CLJS-445

[ClojureScript] Re: Idiomatic way of accessing JavaScript properties in nested "namespaces"

2014-08-29 Thread Rafal Spacjer
Fully agree, thank you for helping me. W dniu piątek, 29 sierpnia 2014 20:37:30 UTC+2 użytkownik Francis Avila napisał: > There's no question that it's allowed. You can use js/a.b.c > > > > However, it is *less idiomatic* because there's no analogous construct in > Clojure (not ClojureScript)