Fork me on GitHub

is there any streaming/video of the om next talk in euroclojure?


so quite today, or I am in a different time zone?


heh well, it's 3am-11pm in US simple_smile


8.30am here in the UK!


6:13pm in au :)


4:45pm in singapore


Hi guys. I have a similar vector


[:div {:class "navbar navbar-fixed-top"} [:div {:class "container-fluid"} [:div {:class "navbar-header"} [:a {:class "navbar-brand" :href "#"} "Photogallery"] [:div {:class "version"} "0.93"]]] [:button {:on-click #(do (println "click xxx") (om/set-state! owner :xxx [:table {} ; {:on-click (fn [] (js/alert "test"))} "asd" ;[:div {} ; [:table {} ; [:tr {} ; [:td {} ; "qwerty"]]]] ]))} "xxx"] (fn [] ;(html/render-html (om/get-state owner :xxx)) (when (not (nil? (om/get-state owner :xxx))) (om/get-state owner :xxx) ;(om/get-state owner :xxx) )) ]


I wrote a function which generates the html from us this vector and renders it afterwards component of om


everything worked OK until I tried to use the design (fn [] (when (not (nil? (om/get-state owner: xxx))) (html/html-render (om/get-state owner: xxx))))


Uncaught TypeError: is not a function


you can format your code with `


and slack posts are mutable 😉


per our discussions yesterday about :import and Google Closure I found an error in an otherwise very nice ClojureScript resource:


@a.espolov: formatted it for you

[:div {:class "navbar navbar-fixed-top"}
 [:div {:class "container-fluid"}
  [:div {:class "navbar-header"}
   [:a {:class "navbar-brand" :href  "#"} "Photogallery"]
   [:div {:class "version"} "0.93"]]]
 [:button {:on-click
              (println "click xxx")
              (om/set-state! owner :xxx
                             [:table {} {:on-click (fn [] (js/alert "test"))}
                              [:div {}
                               [:table {}
                                [:tr {}
                                 [:td {}
 (fn []
   ;(html/render-html (om/get-state owner :xxx))
   (when (not (nil? (om/get-state owner :xxx)))
     (om/get-state owner :xxx)
     ;(om/get-state owner :xxx)


in a correctly specified issue, half of the answer


anyone using figwheel? I'm having trouble using :on-jsload in project.clj. It doesn't trigger given function when I change some file. 😕


namespaces and Google Closure is still beating me up, but I'm not down for the count...


interestingly, all of these forms "work", but I suspect that the last one is meant to be idiomatic:

[:p " "]
    [:p "goog/global.COMPILED " goog/global.COMPILED]
    [:p "(.-COMPILED goog/global) " (.-COMPILED goog/global)]


goog is a namespace, global is an object attached to that namespace, COMPILED is an attribute of the global object


what's confusing is why the first two versions work


those are all valid.


will never change.


another interesting thing is that I can't find any mention on the wiki of the fact that "ClojureScript has a special syntax for access to the entire platform environment through the js/ special namespace. " Might be so simple that it's taken for granted but on the other hand it seems worth pointing out.


thanks for reporting @meow, going to reword that part about :import right now


@dnolen: hmm. okay. Is one form preferred? I like goog/global.COMPILED but I'm also trying to break myself of OOP idioms.


@dialelo: you're welcome simple_smile


@meow: no preferred thing in this case.


pkobrien: surprised about js/foo not being documented, I would double check to be sure.


well, on this page there is only one example that uses the js namespace, but no mention that the namespace exists or what it is for:


the quickstart page makes no use of js/


the Dependencies page uses the js namespace but never explains it


I've been all over the wiki and can't find any explicit mention of the js namespace.


Hello, is there anything known, that Chrome is not working with the austin browser repl? When I run it, every operation hangs. After trying firefox, they are working as expected. 😩


@dnolen: when you say "no preferred thing in this case" do you mean the case of the Google Closure namespace? And that otherwise the rules defined for Host Interop on the wiki are meant to be the standard?


I tend to refer to that instead of the official clojurescript wiki


@roberto: thanks. I need to spend more time there. Found their link to js/


hmm, this also works: js/window.Infinity (no, really, I'm not confused by this at all...)


@meow: all this stuff is supposed to work

dnolen15:06:50 always works.


js/ references the global namespace, or window. Window has a circular self-reference. So: window.window === window in JS. So (= js/window.window js/window)


I just find it confusing when I read something like the Host Interop section of the wiki that states:

To access object properties (including functions that you want as a value, rather than to execute) use a leading hyphen:

(.-Infinity js/window)
 => Infinity
I'm still learning but I'll get there eventually. simple_smile


@teslanick: that part I have no problem with - it's only the syntax that's throwing me off at the moment


You should be able to do just: js/Infinity


@teslanick: true. I'm just starting with what is on the wiki and trying to understand the syntax rules for cljs.


so I'm not at all confused by what is represented by js, window, global, or how they might differ on different target platforms, or references to the exact same object on browser platforms, etc. That part is pure fun and I'm reading the Google Closure book and going through the closure source code.


I'm just getting tripped up on making use of all the Google Closure goodies from within cljs and trying to do it in an idiomatic fashion while also learning clojure and clojurescript at the same time.


But I see the light at the end of the tunnel and I'm having a blast so it's all good. simple_smile


@meow: FWIW, ClojureScript: Up and Running has a section covering the special js namespace.


@mfikes: Thanks. I just thought maybe it was worth mentioning its existence on the wiki somewhere.


@meow: Yes. IMHO, the wiki should contain a comprehensive normative description of ClojureScript.


@mfikes: I'd be happy to read/review/test/edit such a thing if someone were to write it.


I happen to think that ClojureScript is going to gain in popularity quite rapidly, quite soon, and may overtake (or at least catch up to) languages like Python. That means more programmers will be coming to it without previous exposure to Clojure and some without exposure to Javascript.


Coming from python (which I chose over perl, which was way more popular at that time around 1999) I'm a fan of having "one and only one right way" for things.


@meow: Best I can tell, the “Differences from Clojure” wiki page most nearly plays the role of being a language specification.


@mfikes: I agree. But the structure is cumbersome as a reference because you have to refer to the Clojure page.


@meow: Yeah. I've been wondering if a ClojureScript copy of the Clojure specification pages would be better.


And nowhere is there a good description of the host environment and its impact on the global namespace. By that I mean that values in the global namespace like NaN, Infinity, -Infinity, +Infinity, and the js and Math namespaces are a result of being hosted on JavaScript. And yet there is hardly a mention of them. This isn't necessarily a big deal, but it wouldn't hurt to explicitly describe what you get when you work in cljs, IMHO.


I recently did a bunch of work in QML, which is also a hosted language on JavaScript with the same things in their namespace because its part of the ECMA standard thingie. So I'm familiar with it.


@mfikes: I think it would be nice and useful to be able to go to a single page that captures everything to do with the ClojureScript spec without having to refer back to a Clojure spec. This might be a duplication of information but while I'm working in cljs as a newbie its been a struggle to pull together all the bits and pieces of information.


@meow: Maybe it could be multi-page and roughly of the same structure and content as the Clojure spec.


I think the only thing I've seed David comment on regarding this is the idea of it being a freely-editable wiki scales well for where we are now with the language.


Every time we discover some undocumented aspect of ClojureScript (like the js nsmespace) a few sentences or paragraphs could be added to the spec by the community.


@mfikes: Why not just create a single page to get things started and then if any section becomes too big we can split it off into a separate page?


@meow: Yes. That seems sensible.


And since David is in favor of using the wiki for this then I am happy to help.


I don't want to create a tutorial or api reference - those already exist elsewhere. We just need an overview with a few examples to illustrate the concepts.


I know I'm preaching to the choir. 😉


A cljs version of what's on this page would be nice:


I'd like to at least deal with: importing, namespaces, notation (dotted member access), importing of Classes and implicit class constructors, the global namespace, whether or not the Math/ namespace has any value, and the Google Closure namespaces/classes/objects/attributes and how they represent exceptions to the general rules.


Even if you skim through you can envision a similar page that is accurate for ClojureScript.


does anyone know how to get the react devtools working with Om?


I'm completely confused by this:

Library API

The "Library API" is an index of the symbols you can use inside any ClojureScript application.

These symbols span multiple sources, which you don't really need to know (see table below). We omit Google Closure* and JavaScript** symbols from this API reference, though they are included in and accessible from every ClojureScript application.

Google Closure Library
JavaScript's native library


My understanding is that there are no symbols from Google Closure that are included in and accessible. Not without specific imports, just like any other external namespace.


It's just that the Google Closure library is "bundled" as part of the compilation process, but no symbols are available within the global namespace of a ClojureScript application, right?


Or have I completely lost my mind?


pkobrien: yes -- in other words, it's there to be :required or :imported without needing to add a lib ref


Google Closure is bundled, making it easy to import and use in your app. There is a js/ namespace that provides access to the JavaScript host environment. Beyond that, there are no symbols from either of these that are "included in and accessible".


I think the original text is terribly misleading.


I just read the guide being given away by @bostonou on his and wanted to say that it was very well written and worthwhile. Anyone working with cljs and core.async is likely to get something of value out of it. Good job!


And I think everyone here has a sense of how picky I can be... 😉


I'm looking to use the clojurescript compiler from clojure to compile small cljs scripts. I'm digging through the documentaiton but can anybody point in the right direction?


zmaril: i'd start with the Quick Start and look at the entry points there to see how the internal interfaces work


sente users, is it expected that server->client events arrive at a different order than they were sent?