December 11, 2004 Enum is Forward Referenced | ||||
---|---|---|---|---|
| ||||
I guess enums can't be forward referenced like other symbols in D? This does not work: module enumtest; # struct Foo # { # TEST X; # } # # enum TEST { A, B, C } Though doing this is, perhaps, unnecessary, it doesn't seem to be consistant with what D is supposed to be able to do. Quoted here: "Names at the global level can be forward referenced without needing a special declaration:" -- http://www.digitalmars.com/d/sdwest/paper.html Perhaps this forward referencing flexibility applies only to functions, structs, and classes? Curious. -- John |
December 12, 2004 Re: Enum is Forward Referenced | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Reimer | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Added to DStress as http://svn.kuehne.cn/dstress/run/enum_10.d http://svn.kuehne.cn/dstress/run/enum_11.d Thomas John Reimer schrieb am Sat, 11 Dec 2004 15:26:00 -0800: > I guess enums can't be forward referenced like other symbols in D? > > This does not work: > > module enumtest; > > # struct Foo > # { > # TEST X; > # } > # > # enum TEST { A, B, C } > > Though doing this is, perhaps, unnecessary, it doesn't seem to be consistant with what D is supposed to be able to do. > > Quoted here: > > "Names at the global level can be forward referenced without needing a special declaration:" > > -- http://www.digitalmars.com/d/sdwest/paper.html > > Perhaps this forward referencing flexibility applies only to functions, structs, and classes? > > Curious. > > -- John -----BEGIN PGP SIGNATURE----- iD4DBQFBvM+l3w+/yD4P9tIRAi5aAJj7/bG3Fecy+jN1dKFSVT8PjpYUAKC1OUdE ww8hUFd/9ljcrNU0wfd1uw== =2t+j -----END PGP SIGNATURE----- |
Copyright © 1999-2021 by the D Language Foundation