Couldn't really get started (with the latest clean install of leiningen from homebrew).
$ lein cljsbuild auto async-tutl
...
java.lang.Exception: Unknown build identifier: async-tutl
Did the name of the tutorial change?edit: ell instead of 1. I guess that's why I use a heavily-serifed font for my coding. I even re-read the command several times looking for a simple typo to catch exactly this problem.
You have a typo there. The proper command is:
$ lein cljsbuild auto async-tut1
Note the one instead of the ell.
Re:ClojureScript 101
by swannodette_ on Friday November 08, 2013 @10:51PM
(#6700620)
The project is async-tut1 not async-tutl. Look at your project.clj.
Being totally new to Sublime I was actually got confused on configuring paredit and lispindent with Sublime 2.
get sublime2 http://www.sublimetext.com/2
package control https://sublime.wbond.net/installation#st2
launch "sublime 2"
ctrl-`
paste in the package control script (from above link) <ret>
re-launch "sublime 2"
⌘-shift-p # dialog comes up
install ↓ <ret>
# up will pop a dialog after reading the package database
paredit <ret>
⌘-shift-p
install ↓ <ret>
lispindent <ret>
The extra level of detail would cloudy the main flow of the tutorial so maybe have some supporting material links for the slower kids?This is great. We currently hold a weekly clojure class at work, and this will be very helpful to some of the people who attend. The more content the better!
Suggestion: add a form around the input and button, and bind on its submit. That makes the application work when pressing [return] from the input field
(you'll have to include a (.preventDefault e) in the (listen) callback though)
The (.log js/console (dom/getElement "query")) command returns "null" instead of a DOM element. Curiously, manually running the equivalent command in the Chrome console works as expected:
> goog.dom.getElement
function (element) {
return goog.isString(element) ?
document.getElementById(element) : element;
}
> goog.dom.getElement("query")
<input id="query" type="text">If someone could provide a good pointer to better understand lisp syntax / Clojure I would appreciate it. Clojure is so confusing and hard to follow for the beginner!
Re:ClojureScript 101
by NoodleIncident on Saturday November 09, 2013 @07:00PM
(#6704227)
The biggest difference is that functions go after the left-paren, not before. Commas are also unnecessary, they're just whitespace
foo(bar, baz) => (foo bar baz)
herp(bar, derp(baz)) => (herp bar (derp baz))
This might help as well: http://adambard.com/blog/clojure-in-15-minutes/
Re:ClojureScript 101
by olivergeorge on Friday November 08, 2013 @11:02PM
(#6700643)
Perhaps note that scripts should be loaded after form elements. You get an odd error if (init) runs before the form elements exist.
Re:ClojureScript 101
by poppingtonic on Saturday November 09, 2013 @04:08AM
(#6701154)
I love this example. Working through this made me finally get started on reading Hoare's CSP book. Thanks!
I'm pretty excited about the latest release of ClojureScript that makes all this possible. With respect to speed of incremental compiles, code size, performance of generated code, and debugging we're finally in a good place (with of course many improvements planned in the near future).
None of this would have been possible without the tireless work of 62 contributors over the past two years, http://github.com/clojure/clojurescript/. A big thank you to all!
Happy hacking!