+1 for Stuart's component lib. I've been using it a lot in my day job and
it works quite well. It also serves as a reminder not to throw global
config values into vars. Building code that works well with the library
makes it less natural to put random state values in globals.

Timothy



On Fri, Dec 27, 2013 at 1:25 PM, Cedric Greevey <cgree...@gmail.com> wrote:

> On Fri, Dec 27, 2013 at 3:13 PM, john walker <john.lou.wal...@gmail.com>wrote:
>
>> This works (clever hack!), but you would have to reduplicate the keys in
>> (defn bar [..]...), (defn baz [...] ...) etc.
>>
>
> (defmacro defthingyfn [name arglist & body]
>   `(defn name ~(vec (cons '{:keys [thingy mumble fiddly]} arglist))
> ~@body))
>
> (defthingyfn foo [x]
>
>   (...thingy ... mumble ... fiddly ... mumble ... mumble ... x ... thingy
> ...))
>
> (defthingyfn bar [x]
>   (...mumble ... thingy ... mumble ... mumble ... x ... thingy ... fiddly
> ... thingy ...))
>
> ...
>
> (Extending that to cope with docstrings and multiple arities is left as an
> exercise for the reader. :))
>
> --
> --
> 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.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

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