[134311] trunk/dports/devel/hub/Portfile
Lawrence Velázquez
larryv at macports.org
Sun Mar 22 10:56:36 PDT 2015
On Mar 22, 2015, at 12:23 AM, Mihai Moldovan <ionic at macports.org> wrote:
> On 22.03.2015 02:25 AM, Ryan Schmidt wrote:
>
>> The best way to clear the build.target (or any option) is to simply not give a value, e.g. by writing just:
>>
>> build.target
>
> FWIW, I disagree here. Not giving it a value could, for the casual
> observer (not so much a macports dev, but a user not knowing internals)
> mean "default value" or "empty". This is ambiguous and we should avoid
> being ambiguous, especially for people not knowing MacPorts, to lower
> the entry threshold (and it *really* makes more sense to me to actually
> specify a value than rely on "guessing".)
You're ignoring the fact that Ryan's suggestion is the ubiquitous method of clearing options. I cannot think of a single circumstance in which clearing an option means "set to default".* Introducing an alternate notation for this is making things *more* confusing because someone who sees "build.target" and "build.target {}" will reasonably wonder whether there's any difference and whether they should favor one over the other.
More importantly, they are not actually equivalent. "build.target" sets build.target to an empty list. "build.target {}" sets build.target to a list with an empty list as its only member. The code that handles build.target may end up treating these equivalently, but you can't assume that this will be the case for all options. Options that are sensitive to this difference will require Ryan's method for clearing and your method for specifying a single empty value, and that makes things even more confusing.
tl;dr: The correct way of clearing a list is Ryan's method, and you should use it.
* Ignoring the use of empty braces to signify an empty script, as for phases and variants.
vq
More information about the macports-dev
mailing list