Hey Peter,

I personally found out that I require this functionality more when I am 
building web apps because I pass around the url query parameters to other 
functions for validation or other tasks and build my sql queries from there 
so some default are required. For several other clojure server apps I made 
I never found myself needing this.

A :merge-as would be nice, maybe something with the use of macro can be 
done. I used assoc as Sean suggested but It can get easily ugly if you have 
a lot of parameters and plenty functions needing this.

Ryan 

On Saturday, May 4, 2013 2:00:20 PM UTC+3, Peter Taoussanis wrote:
>
> Hi Ryan,
>
> I actually run into this quite often and feel that it's something that's 
> missing from destructuring: 
> http://grokbase.com/t/gg/clojure/128z9e3sqj/possible-to-merge-destructuring-or-defaults-with-as
>
> Basically, I'd advocate the addition of a new `:merge-as` destructure 
> option that functions as `:as` does now, but merges over the `:or` defaults.
>
> I get the impression that not many folks are running into this though. May 
> be a matter of style: I tend to like destructured fn args with defaults 
> that are transparent to the caller.
>
> - Peter Taoussanis
>

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