Subject: [netmod] yang-02 examples nits

From: Andy Bierman <[email-masked]>
Date: Sun, 30 Nov 2008 10:05:29 -0800

Hi,

These are nits, but we all know many people in a hurry
learn from the examples, and (!) skip some of the normative text.

  1) pg 91.: augment example uses type ChannelNumber, which is not
     defined anywhere

  2) sec. 9.4.5: 2nd and 3rd constructs should be legal YANG.
     The type clause cannot appear alone, and this example is confusing.

     E.g., OLD:

      type my-base-str-type {
          // legal length refinement
          length "11 | 42..max"; // 11 | 42..255
      }

      NEW:

      typedef my-legal-refinement {
          type my-base-str-type {
              // legal length refinement
              length "11 | 42..max"; // 11 | 42..255
          }
      }

  3) sec. 9.6.5: it would be good to show an enumeration example
     that has complex identifiers, to point out how different
     they are from bit names.

     e.g.:

     typedef my-display-duplex {
         type enumeration {
             enum 'half duplex';
             enum 'full duplex';
             enum 'unknown duplex';
         }
     }

Andy

_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: Phil Shafer <[email-masked]>
Date: Sun, 30 Nov 2008 14:37:35 -0500

>  1) pg 91.: augment example uses type ChannelNumber, which is not

Given that examples are not meant to be fully self-contained, I'm
not sure I see an issue here.  ChannelNumber may be defined elsewhere
in the module, not all of which is included in the example.

>     The type clause cannot appear alone, and this example is confusing.

This type clause can appear inside a leaf or a typedef.  The examples
aren't meant to be self-contained, so the enclosing statements are
not included.

>     typedef my-display-duplex {

If we need this, we should use a better example, since
<duplex>half</duplex> is a better encoding.  Personally I think
this (the ability of a enum to contain a space) is a minor point
nor worthy of an example.

Thanks,
 Phil