Subject: [netmod] proposed change to 7.3.4

From: Ladislav Lhotka <[email-masked]>
Date: Sat, 17 Oct 2009 12:26:38 +0200

Hi,

the last paragraph in Sec. 7.3.4 should also cover the case when a
restriction specified in a leaf definition is incompatible with the
default value of the leaf's type.

OLD

   If the base type has a default value, and the new derived type does
   not specify a new default value, the base type's default value is
   also the default value of the new derived type.  If the base type's
   default value is not valid according to the new restrictions, the
   derived type MUST define a new default value.

NEW

   If the base type has a default value, and the new derived type does 
   not specify a new default value, the base type's default value is
   also the default value of the new derived type.

   If the base type's default value is not valid according to the new
   restrictions specified in a derived type or leaf definition,
   the derived type or leaf definition MUST specify a new default value
   compatible with the restrictions.

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 19 Oct 2009 12:38:29 +0200 (CEST)

> default value of the leaf's type.

But 7.3.4 is called "The typedef's default Statement".  We should not
talk about leafs here.  In 7.6.3 we say:

  The value of the "default" statement MUST be valid according to the
  type specified in the leaf's "type" statement.

Maybe I miss your point?

/martin

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

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 19 Oct 2009 12:46:57 +0200

>   type specified in the leaf's "type" statement.

leaf foo {
    type bar {
        range "1..10";
    }
}

typedef bar {
    type uint8;
    default 42;
}

The default here is typedef's.

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 19 Oct 2009 12:57:33 +0200 (CEST)

> The default here is typedef's.

Ok.  Got it.   I suggest we write:

NEW

   If the type's default value is not valid according to the new
   restrictions specified in a derived type or leaf definition,
   the derived type or leaf definition MUST specify a new default value
   compatible with the restrictions.

instead.

I was confused by the fact that the two paragraphs started with "If
the base type", but they talked about different things...

/martin

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 19 Oct 2009 13:01:59 +0200

>    compatible with the restrictions.

OK. Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C