[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [patch] Use hash for optional args with long argument list in Ruby bindings

From: Joe Swatosh <joe.swatosh_at_gmail.com>
Date: 2007-11-19 20:15:39 CET

Hi kou,

On 11/17/07, Kouhei Sutou <kou@cozmixng.org> wrote:
> Hi,
>
> In <ae6cb1100711162223v12831844v8da6168fbd8ea354@mail.gmail.com>
> "Re: [patch] Use hash for optional args with long argument list in Ruby bindings" on Fri, 16 Nov 2007 22:23:53 -0800,
> "Joe Swatosh" <joe.swatosh@gmail.com> wrote:
>
> > BTW as I was changing switch_editor2 to be similar, I remembered that I
> > hadn't asked yet: What is the reason for using the Hash for all arguments,
> > instead of just the optional arguments?
>
> This is for consistency. Users who uses only required
> arguments should use XXX API instead of XXX2 API.
>

Consistency with what?

Ruby core and stdlib use positional with optional in FileUtils,
CGI.tag, and REXML::Element.new that I could find with a quick browse.

Rails uses it all over.

The example "Collecting Hash Arguments" at the end of Chapter 6 in the
2nd edition of the pickaxe mixes a positional argument with the params
Hash.

Finally the svn commandline essentially has positional and optional
(named) arguments.

--
Joe
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 19 20:15:50 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.