Re:Using Clojure for Web Apps
by kgwxd on Thursday December 12, 2019 @05:36PM
(#21777328)
The first example is missing the scope brackets likely enclosing the expressions, and there should probably be a few semi-colons.
[ Parent
| on HN ]
Re:Using Clojure for Web Apps
by wostusername on Thursday December 12, 2019 @05:53PM
(#21777501)
>The first example is missing the scope brackets likely enclosing the expressions
Sure, but so is the Clojure one. So I guess it's more like:
fun bar () {
let x = 5,
y = 10
foo(x,y)
}
vs (defn bar []
(let [x 5
y 10]
(foo x y)))
Re:Using Clojure for Web Apps
by lkschubert8 on Thursday December 12, 2019 @08:09PM
(#21778242)
The clojure example was not missing the "scope brackets". That's exactly what let is. The equivalent c like in your first example should just be enclosed in brackets.