Re: [PATCH 3/5] Added config_default($key, $default) to Git.pm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 22, 2007 at 04:55:52AM -0600, Dan Zwell wrote:

> Method returns a configuration value if defined, or the default
> value that was passed in, otherwise.
> 
> The main purpose of this method is to allow the empty string to
> be a valid configuration option, and to replace the following
> construct:
> 
> $val = $repo->config('my.key') || $default_val

The config subroutine does not currently take a third argument. Is there
a particular reason not to make $repo->config('my.key', $default_val)
the equivalent of config_default?

> +in situations where the empty string is an acceptable return value.
> +This method may also be called in a vector context, when expecting

The term "vector context" is not commonly used. Most of the perl
documentation calls it "list context" (try googling for each and seeing
the hit numbers).

-Peff
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux