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

Re: Named params for Perl bindings

From: Nik Clayton <nik_at_ngo.org.uk>
Date: 2006-11-24 10:38:32 CET

Max Bowsher wrote:
> Garrett Rooney wrote:
>> On 7/20/06, Nik Clayton <nik@ngo.org.uk> wrote:
>>> Assuming I get the time to do the work, would anyone be interested in
>>> patches to the Perl bindings to support named parameters as well as
>>> positional parameters?
>>>
>>> This would mean that as well as being able to write code like:
>>>
>>> $ra->get_log([$paths], $rev, 1, 20, 0, 0, sub { ... });
>>>
>>> which is a bit obtuse (quick, without access to the docs, which of
>>> those '0'
>>> params is 'discover_changed_paths', and which is 'strict_node_history'?).
>>> The changes I'm thinking of would let you write code like this:
>>>
>>> $ra->get_log({ paths => [ $paths ],
>>> start => $rev,
>>> end => 1,
>>> limit => 20,
>>> discover_changed_paths => 0,
>>> strict_node_history => 0,
>>> receiver => sub { ... } });
>>>
>>> Although it's more verbose, it's much more maintainable.
>
> I would be delighted to be proved wrong, but I am very pessimistic about
> the above (at least, not without integrating the functionality into the
> core of SWIG itself - which would be a possible avenue, but would mean
> that the enhancement couldn't be made available in Subversion until it
> was released in SWIG and we had increased the minimum SWIG version to
> the new release).

I've got a reasonable idea how to do this now, I might have a proof of
concept patch for one function by the end of this train journey.

How do people feel about making the Perl Subversion bindings dependent on
non-core (i.e., they don't ship with Perl) modules from CPAN? I'm
specifically thinking of Params::Validate, which would simplify the above
somewhat.

N

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 24 15:27:51 2006

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.