Hi everyone,

After the very interesting keyword argument debate, I have another question
about API design. Specifically I'm interested in suggestions about
parameter order. The new API guidelines, which have changed very recently
to favour maps over keyword args, also changed to include a suggestion that
the keyword map be the first argument, since it's the "least variance"
argument.

I've been using some fairly simple rules to order my parameters, basically
1) functions that operate on collections should have the collection last to
interoperate with ->>, and 2) functions operating on a "main" object should
accept that first, to interoperate with ->. #2 is generally pretty
intuitive since it's the same as Java interop and protocol calls, but
there's still a fair amount of ambiguity with just these rules unless all
your functions have one or two arguments.

I'm interested in opinions about the "variance" ordering, since I assume
this is to facilitate use of partial and the like. I never really use
partial myself so I don't have a good feeling for how this ordering should
work - any comments or opinions?

Thanks,
Colin

-- 
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/d/optout.

Reply via email to