Subject: [Ietf-krb-wg] the naming of constants is a difficult matter

From: Tom Yu <[email-masked]>
Date: Thu, 26 Mar 2009 19:14:23 -0400

I have been thinking about what "spelling" to give the names of
protocol constants, especially as we are about to hand off some of
these to IANA.  Many integer constants have associated names that have
appeared in specifications and as identifiers in implementation code,
though the names are not part of the protocol.

I think the two most logical possibilities are:

* C language preprocessor macro style

* ASN.1 value reference style

Luckily, if we choose carefully, we can create rules mapping between
them.  I propose the following practices:

* Use ASN.1 value reference style in tables.

* Use C-style in running text.

The lexical structure of ASN.1 value references is more restrictive
than that of C language preprocessor macro names.  ASN.1 value
references are required to begin with a lowercase letter, followed by
hyphens, digits, or letters.  Two or more hyphens may not appear
adjacent to each other, and there may not be a hyphen at the end.

The obvious mapping to C language style identifiers is to change all
the letters to uppercase and replace all hyphens with underscores.

For example:

    pa-etype-info2              Int32 ::= 19

    #define PA_ETYPE_INFO2      19

(Ignore the fact that the above C-style symbol does not actually
appear in the MIT krb5 implementation, but something that looks a lot
like it does.)

In running (flat ASCII) text, the (conventionally) all-lowercase ASN.1
value references do not stand out.  Surrounding them with quotation
marks probably helps, but looks somewhat intrusive.  Simply
transforming the ASN.1 value reference to all-uppercase makes them no
longer valid value references.  (ASN.1 type references begin with an
uppercase letter.)  Using a C-style identifier makes it clear that the
reference is not to an ASN.1 type name.
_______________________________________________
ietf-krb-wg mailing list
[email-masked]
https://lists.anl.gov/mailman/listinfo/ietf-krb-wg

---

From: "Henry B. Hotz" <[email-masked]>
Date: Thu, 26 Mar 2009 16:43:08 -0700

+1
On Mar 26, 2009, at 4:14 PM, Tom Yu wrote:

> these to IANA.

------------------------------------------------------
The opinions expressed in this message are mine,
not those of Caltech, JPL, NASA, or the US Government.
[email-masked], or [email-masked]

---

From: Sam Hartman <[email-masked]>
Date: Mon, 30 Mar 2009 23:12:40 -0400

I prefer whatever option involves the least work on my part:-)
_______________________________________________
ietf-krb-wg mailing list
[email-masked]
https://lists.anl.gov/mailman/listinfo/ietf-krb-wg