On Mon, Nov 30, 2015 at 9:48 AM, Nick Wellnhofer <[email protected]> wrote:
> I think different semantics for positional and labeled arguments are even
> more confusing.

In the entire Lucy codebase, I can't actually find a function taking a single
positional bool argument which defaults to true.  It seems like it would be
relatively rare.  More common would be, say, a setter taking a *required*
bool argument.

(There's one method taking a positional bool which defaults to *false*:
Indexer#Commit, which takes a bool "optimize".  There are also constructors
which take a single bool such as RAMFile#new, but the Perl bindings for all
constructors use named params rather than positional args.)

> Anyway, I don't have a strong opinion on the whole issue.
> But now would be a good time to make any changes.

For labeled parameters, I continue to prefer the current behavior but have
been trying to listen and grok opposing views.  For positional arguments, I
don't think it matters as much and I would be willing to compromise and
willing to tolerate a certain amount of inconsistency for the sake of the
group.

> If we stick with "undef means default", we should also consider to disallow
> undef for Boolean and number arguments if there's no default.

That should be the current behavior for *all* arguments in the Perl bindings,
unless a change has gone through that I missed.  Arguments for which no
default value is specified are required, and either failing to supply the
argument or supplying an undef results in an exception.

Marvin Humphrey

Reply via email to