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:
> user=> (let [k (+ 2 2)])
>  nil
> 
> What is it I get wrong?

You have no expressions (after the brackets) in your let statement, only 
bindings (the stuff inside the brackets).

>From 
><http://clojure.org/special_forms#Special%20Forms--(let%20[bindings*%20]%20exprs*)>
(let [bindings* ] exprs*)

To get the result you want:

user> (let [k (+ 2 2)] k)
4

Michael Glaesemann
grzm seespotcode net



-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to