From: Stefen Boyd (stefen@boyd.com)
Date: Fri Oct 19 2001 - 12:26:38 PDT
Precedence: bulk
At 11:24 AM 10/19/2001 -0700, Michael McNamara wrote:
>Does the spec say it is illegal?
>
>Paul's question was not considering use of a reserved word as the
>value, but rather the keyword being what would otherwise be a reserved
>word.
Mac,
Even though my reply was not very studied, I believe it
is accurate. At least as far as what the spec says (or
doesn't say).
If you look at section 2.7.3 it doesn't say what you
can't do with a keyword: "Keywords are predefined
nonescaped identifiers that are used to define the
language constructs." I guess everyone is supposed
to know that they can't be used for anything else
*but* defining language constructs.
Keywords(such as "case") are allowed for names of
system tasks, system functions, and compiler directives:
"Any valid identifier, including keywords already
in use in contexts other than this construct, can
be used as a system task or function name."
Section 2.7.4, last paragraph.
"Any valid identifier, including keywords already
in use in contexts other than this construct, can
be used as a compiler directive name." Section 2.7.5
last paragraph.
And note 2 at the end of section 19.3.2 points out that
you can have "reg define;" since it's only a compiler
directive keyword.
Since we didn't put in similar wording for attributes,
I would expect them to behave the same as every other
non-excluded use of an identifier. It seems rather
poor that we never explicitly said that you can't use
a keyword unless an exception is given (or is it buried
somewhere I didn't look?).
Having said all that, I don't know why we couldn't
allow keywords into attributes... but we would need
to add language such as given in 2.7.4 or 2.7.5 to
explicitly allow it.
Stefen
<p>--------------------
Stefen Boyd Boyd Technology, Inc.
stefen@BoydTechInc.com (408)739-BOYD
www.BoydTechInc.com (408)739-1402 (fax)
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:54:47 PDT
and
sponsored by Boyd Technology, Inc.