Manifest constants (was const again)
"Jérôme M. Berger"
jeberger at free.fr
Sat Dec 8 23:23:40 PST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bruce Adams wrote:
> On Sat, 08 Dec 2007 23:19:07 -0000, Bill Baxter
> <dnewsgroup at billbaxter.com> wrote:
>
>> Jérôme M. Berger wrote:
>>> Walter Bright wrote:
>>>> Derek Parnell wrote:
>>>>> For example ...
>>>>> enum
>>>>> {
>>>>> defname = "upload.log",
>>>>> float fudge = 61.74,
>>>>> char starter = 'r',
>>>>> qwerty = 0xF4,
>>>>> foobar = SomeFunc("foobar") }
>>>> No, that would be:
>>>>
>>>> enum defname = "upload.log";
>>>> enum float fudge = 61.74;
>>>> enum char starter = 'r';
>>>> enum qwerty = 0xF4;
>>>> enum foobar = SomeFunc("foobar");
>>> So, basically, what you're saying is that not only enum is a list
>>> with only one element, but it's a list that can never have more than
>>> one element?? What kind of enumeration is that?
>>
>> That is amusing. So Walter, why not allow more than one element?
>>
>> --bb
>
> If it was really a list you could usefully have an empty one.
> I suspect the objection is mixing multiple types in one declaraiton.
>
> enum
> {
> a = 1;
> b = 2;
> }
>
> makes sense in a way that:
>
> enum
> {
> a = 1;
> b = "foo";
> }
>
> does not.
Which only goes to show that "enum" is a poor choice of keyword for
manifest constants...
Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
| mailto:jeberger at free.fr | ICQ: 238062172 |
| http://jeberger.free.fr/ | Jabber: jeberger at jabber.fr |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFHW5f8d0kWM4JG3k8RAm5DAJ4j7TM5rF73yJEUBxC6CxXYM0wogQCgsJks
8dJOdmSuw2is4zSPjNMt6VM=
=m+5V
-----END PGP SIGNATURE-----
More information about the Digitalmars-d
mailing list