Closed DjebbZ closed 10 years ago
This is an important point, thanks!
It needs a little bit more clarification which I will add.
I also tried something else, maybe silly, of defining functions inside of a function definition, i.e. defn
inside another defn
. The compiler didn't like this, but the equivalent in javascript is perfectly legit. Maybe you could add a note about this ? Also I don't understand why it doesn't work in CLJS.
I actually already added a note and explanation about that too.
Sorry, I should really read the whole tutorial and ask afterwards. By the way, this tutorial rocks !
I think this point is important, since in Javascript when you define a function inside a scope, this function is only available in this scope. Here ClojureScript allows a function defined in a
let
bindings (concept close to thescope
) to be available outside thelet
. Not sure my change in the code nor this very comment is clear, but for a ClojureScript beginner like familiar with Javascript I felt this needed to be explained and explicit.