On 18 June 2013 14:38, Softaddicts <lprefonta...@softaddicts.ca> wrote:
> I use destructuring most of the time, the main benefits I see are runtime > validation > of typo errors in the option names, better doc strings and the ability to > provide defaults > where nil does not make any sense. > You can use destructuring on rolled up option maps as well. > Of course you may need to use apply to pass options in turn to another fn > but I found out that this happens most of the time internally, not in the > public API. > I find myself constructing option maps quite often, but then I use a few libraries heavy on options, like clj-http, which benefit from merging option maps. > If the apply stuff gets repeatedly in the way, then use a macro to hide it. > It seems a fair bit of work to avoid a pair of brackets. If you need a macro or function to work around an issue created by some optional syntax sugar, I'd question whether that syntax sugar is worth it. - James -- -- 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.