k is not global binding so it does not resolve
let helps to define local binding
thanks
Abraham
On Oct 10, 2:09 pm, Ulises wrote:
> >> What is it I get wrong?
>
> As the others said, you have no expressions being evaluated in the
> body of let and hence you get nil. The way I understand let is t
>> What is it I get wrong?
As the others said, you have no expressions being evaluated in the
body of let and hence you get nil. The way I understand let is that
you define some bindings to be used in the body of let which will
cease to exist (if they didn't exist before the let expression) after
On Oct 10, 2010, at 0:01 , Andreas Kostler wrote:
> From "Programming Clojure", Chapter 2 - Bindings:
> "The bindings are then in effect for exprs, and the value of the let
> is the value of the last expression in exprs."
> To me this reads:
> user=> (let [k (+ 2 2)])
> 4
>
> However, repl says
"Andreas Kostler" wrote:
>From "Programming Clojure", Chapter 2 - Bindings:
>"The bindings are then in effect for exprs, and the value of the let
>is the value of the last expression in exprs."
>To me this reads:
>user=> (let [k (+ 2 2)])
> 4
>
>However, repl says:
>user=> (let [k (+ 2 2)])
>
>From "Programming Clojure", Chapter 2 - Bindings:
"The bindings are then in effect for exprs, and the value of the let
is the value of the last expression in exprs."
To me this reads:
user=> (let [k (+ 2 2)])
4
However, repl says:
user=> (let [k (+ 2 2)])
nil
What is it I get wrong?
Thanks