On Sat, May 12, 2012 at 9:20 AM, larry <larrye2...@gmail.com> wrote:
> (defn adder[n]
>   (let [x n]
>      (fn[y] (+ y x))))
>
> Is the let necessary?  It seems redundant.

Can you provide a specific reference to where the example appears in
Joy of Clojure (page number)? I assume the actual example in context
is trying to illustrate something specific.

No, let isn't needed here, it just serves to introduce a new name for
the argument n (and probably make it clearer that the body of adder is
a closure).
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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