Re: [YANG] so many naming scopes
Andy Bierman <ietf@andybierman.com> Wed, 09 January 2008 16:57 UTC
Return-path: <yang-bounces@ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com)
by megatron.ietf.org with esmtp (Exim 4.43)
id 1JCeFV-0003Q6-D7; Wed, 09 Jan 2008 11:57:53 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43)
id 1JCeFU-0003Q0-Jd
for yang-confirm+ok@megatron.ietf.org; Wed, 09 Jan 2008 11:57:52 -0500
Received: from [10.90.34.44] (helo=chiedprmail1.ietf.org)
by megatron.ietf.org with esmtp (Exim 4.43) id 1JCeFU-0003Ps-8H
for yang@ietf.org; Wed, 09 Jan 2008 11:57:52 -0500
Received: from smtp120.sbc.mail.sp1.yahoo.com ([69.147.64.93])
by chiedprmail1.ietf.org with smtp (Exim 4.43) id 1JCeFT-0002Zw-LE
for yang@ietf.org; Wed, 09 Jan 2008 11:57:52 -0500
Received: (qmail 55580 invoked from network); 9 Jan 2008 16:57:51 -0000
Received: from unknown (HELO ?192.168.0.10?) (andybierman@att.net@68.120.84.5
with plain)
by smtp120.sbc.mail.sp1.yahoo.com with SMTP; 9 Jan 2008 16:57:50 -0000
X-YMail-OSG: jrwdagIVM1lhZx1Sr9Iqqva4OF9VTHinOMnFfC_3DTyjAxwrhGq92HRCVJsxU5PYgURXMf0Lpcd_TlWOr02p_z6U6Gn6gBc004Q-
Message-ID: <4784FD0D.6020103@andybierman.com>
Date: Wed, 09 Jan 2008 08:57:49 -0800
From: Andy Bierman <ietf@andybierman.com>
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
MIME-Version: 1.0
To: "tom.petch" <cfinss@dial.pipex.com>
Subject: Re: [YANG] so many naming scopes
References: <200801082230.m08MUP3O095222@idle.juniper.net>
<012701c852d5$ff6ffc60$0601a8c0@pc6>
In-Reply-To: <012701c852d5$ff6ffc60$0601a8c0@pc6>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Scan-Signature: 00e94c813bef7832af255170dca19e36
Cc: yang@ietf.org
X-BeenThere: yang@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: YANG modeling Language for NETCONF <yang.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/yang>,
<mailto:yang-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www1.ietf.org/pipermail/yang>
List-Post: <mailto:yang@ietf.org>
List-Help: <mailto:yang-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/yang>,
<mailto:yang-request@ietf.org?subject=subscribe>
Errors-To: yang-bounces@ietf.org
tom.petch wrote: > ----- Original Message ----- > From: "Phil Shafer" <phil@juniper.net> > To: "tom.petch" <cfinss@dial.pipex.com> > Cc: "Bert Wijnen - IETF" <bertietf@bwijnen.net>et>; "Andy Bierman" > <ietf@andybierman.com>om>; <yang@ietf.org> > Sent: Tuesday, January 08, 2008 11:30 PM > Subject: Re: [YANG] so many naming scopes > > >> "tom.petch" writes: >>> There are languages where no word is reserved, where the same symbol(word) > can >>> be used for label, type, module etc. XML is arguable worse with the ability > to >>> start a fresh namespace on alternate lines. These belong in the bin. >> That's a very strong statement, given that the motivation for >> avoiding reserved words is typically future proofing. Don't paint >> it as a universally bad feature. >> >> For example, if I use "action" as a leaf in my model and the next >> version of YANG adds a feature that uses "action" as a keyword, my >> model is broken and needs repair. >> >> Many languages reserve unused keywords just on the odds they will >> need them in the future, but they are seldom right. By keeping the >> namespace of user-defined stuff out of the namespace of keywords, >> YANG avoids this issue entirely. As the number of modules defined >> in YANG approaches the number that are defined in SMI, this will be >> an important language feature. >> > Yes, I expressed myself strongly, perhaps as a result of spending time in 2007 > with XML documents where there was widespread use of an element named <element> > as well as one named <attribute>; I wish that XML had reserved those words:-( I > accept that it is a trade off, and devising a language without reserved words is > an achievement; but I find it costs usability when eg you can have labels such > as 'if' and 'then' and variables such as 'for' and 'case'. I mean, it is sort > of obvious, you are writing this small simple program that will only ever have > one case construct so it is natural to name the associated variable 'case'. > > If a language has concepts which are widely written about in English - perhaps > container, leaf, index, key would qualify - then I would prefer those to be > reserved, else someone someday will use them. > My concern is that even though compilers and YANG experts are aware of the 6 different naming scopes defined in sec. 6.2, perhaps newbies would be confused by seeing data models that mix them all together. Now you bring up a new twist: typedef typedef { type string; } leaf leaf { type typedef; } IMO, there needs to be guidelines (in the form of SHOULD NOT text) that says not to use YANG keywords for identifiers and not to use the same values for typedefs, groupings, and object names, even though it is allowed. In IETF-speak, a 'SHOULD' means vendors can do what they want in their DMs, but WGs will have to justify any violations of the CLR to the IESG. > Tom Petch > >> Thanks, >> Phil > Andy _______________________________________________ YANG mailing list YANG@ietf.org https://www1.ietf.org/mailman/listinfo/yang
- [YANG] so many naming scopes Andy Bierman
- Re: [YANG] so many naming scopes Martin Bjorklund
- Re: [YANG] so many naming scopes Andy Bierman
- Re: [YANG] so many naming scopes Phil Shafer
- Re: [YANG] so many naming scopes Martin Bjorklund
- Re: [YANG] so many naming scopes Balazs Lengyel
- Re: [YANG] so many naming scopes Andy Bierman
- RE: [YANG] so many naming scopes Bert Wijnen - IETF
- Re: [YANG] so many naming scopes Andy Bierman
- Re: [YANG] so many naming scopes Juergen Schoenwaelder
- Re: [YANG] so many naming scopes Andy Bierman
- Re: [YANG] so many naming scopes tom.petch
- Re: [YANG] so many naming scopes Phil Shafer
- Re: [YANG] so many naming scopes tom.petch
- Re: [YANG] so many naming scopes Andy Bierman
- Re: [YANG] so many naming scopes Phil Shafer
- Re: [YANG] so many naming scopes Juergen Schoenwaelder
- Re: [YANG] so many naming scopes Andy Bierman
- Re: [YANG] so many naming scopes Juergen Schoenwaelder
- Re: [YANG] so many naming scopes Phil Shafer
- Re: [YANG] so many naming scopes Balazs Lengyel
- Re: [YANG] so many naming scopes Juergen Schoenwaelder
- RE: [YANG] so many naming scopes Bert Wijnen - IETF