On Wed, Sep 7, 2016 at 7:02 PM, Dale R. Worley <wor...@ariadne.com> wrote:

> Andy Bierman <a...@yumaworks.com> writes:
> > Using a key of type empty is utterly pointless unless the point
> > is to make the instance identifier longer.
>
> IMO using a key of type empty (or any type with only one value) is
> *pointless* but should be *valid*.  Things should be valid unless
> processing them according to the ordinary rules can't work.  Indeed,
> specifically banning them increases the complexity of the
> specification.
>
>
It is both pointless and valid.



> The reason for this is that the code (in this case, the module
> definition) may be generated by an automatic process, and those
> processes are easier to construct if the rules contain fewer
> irregularities.  E.g., multiplying a number by zero is pointless, in
> that the result is always zero, and one might ask, Why not just write 0
> instead of the multiplication?  But everyone agrees that the statement
>
>     a = 0 * b;
>
> is *valid*, and can easily imagine situations where a process might
> generate it as an output.
>
>
Not sure that this has to do with YANG list keys.



> >> Unless I'm off, the line should be fixed to avoid the string
> >> conversion:
> >>
> >>          /ex:system/ex:service[ex:name='foo'][ex:enabled]
> >>
> >> and a negation should be:
> >>
> >>          /ex:system/ex:service[ex:name='foo'][not(ex:enabled)]
> >
> > There is only one value provided by type empty.  The 2nd instance
> > identifier is invalid.
> > There is no instance possible that does not include the 'enabled' leaf.
>
> The 2nd instance identifier is (should be) *valid* even if it always
> returns the empty set.  (Assuming it is used in contexts where a set can
> be returned.)
>


I disagree -- an instance identifier has a strict syntax.
The 2nd expression is valid XPath (again, pointless and valid)


>
> Dale
>


Andy
_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to