On Fri, Dec 27, 2013 at 11:03 AM, Gary Trakhman <gary.trakh...@gmail.com>wrote:

> Why should functions share information?
>

Maybe I'm the odd one out, but every project I've done has at least a few
bits of info shared by many functions.  It might be something like
BUFFERSIZE or NUM-THREADS or DATABASE_URL.  Basically, they are things I
expect to be unchanged.  I separate it out as a var so that I don't have to
repeat the number 30268 everywhere, and I can easily change it for the
whole project if necessary.  In the initial design, nothing suggests to me
that {:buffer-size, :number-threads, :database-url} is some data structure
that I should be explicitly passing around and destructuring in all my
functions, just in case some day I decide I want to configurations to exist
simulatenously.

Can we create a path that makes it easier to get from the version where we
expect things to be unchanged to the version where we need to support
multiple configurations?



>  Vars are easy, but wrong at times, thus the tension.  Is there something
> in between the purity and the ease?
>

Exactly.

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to