Re:Why use Clojure?
by TylerE on Tuesday December 24, 2013 @01:50PM
(#6960587)
This is why I like nimrod, which gives you the best both worlds
With the added bonus that you get compile-time type checking (as well as a fair bit of type inference - notice I didn't have to specify any types other than the function signature), and the code itself compiles down to highly efficient C (https://gist.github.com/tylereaves/8116774 if you're really curious, do remember that code isn't intended to be human readable/modifiable).
[ Parent
| on HN ]
Yeah, in thinking about my example a little more and generalizing, I think one of the problems that people have with reading clojure is that it doesn't have as robust a syntactic indication of scope that other languages have.
Re:Why use Clojure?
by JackMorgan on Tuesday December 24, 2013 @07:26PM
(#6961697)
Don't you mean clojure has a MORE robust indication of scope than other languages? In clojure you can nest lets, and it is very obvious when the binding is out of scope, but in c-style languages, once bound, they stay bound till the end of the function.
Nope, Nimrod (at least) has full lexical scopes if you want
proc foo(x: int): int =
let z = x * 2
#z visible
block:
let y = z * 4 #z & y visible
let foo = 3 #z and foo visible, y out of scope
Re:Why use Clojure?
by JackMorgan on Wednesday December 25, 2013 @11:39AM
(#6963329)
I said "c-style", not ML style.