Multiple attribute specifiers

Steve Horne stephenwantshornenospam100 at aol.com
Thu Sep 7 22:58:25 PDT 2006


On Thu, 07 Sep 2006 19:31:01 +0100, Stewart Gordon
<smjg_1998 at yahoo.com> wrote:

>Can you remember anything at all about this post?  Such as who wrote it, 
>or enough words from the subject line or body that there is some hope of 
>finding it?

The relevant bits from the original post, reposted and crossposted...

: I'd guess it falls out of allowing several access modifier styles...
: 
: class xxx
: {
:   public:
:     private int x;
: }
: 
: This makes sense. The C++-like colon can be seen as changing a default
: that runs on until the next access modifier. The Java-like variant is
: more convenient for a this-declaration-only access modifier. With the
: block version supported as well, it's obviously mainly about keeping
: C++ and Java programmers happy, but there is a logic to layering
: access modifiers.
: 
: In the compiler, it's probably easier to handle that as 'the last
: modifier is the real one' than to sort out different cases, and have
: more specific rules.
: 
: Also, the grammar probably just allows modifiers to be added to
: declarations arbitrarily. Should 'private' go before or after
: 'static'? Why not allow both cases. But the easiest way to allow both
: cases will also allow two access modifiers, or two storage modifiers.
: 
: After all, the following compiles fine too...
: 
:   static static int m_Var;
: 
: No contradiction in that, of course, but still pretty wierd.
: 
: The question is... is this really a problem?

-- 
Remove 'wants' and 'nospam' from e-mail.



More information about the Digitalmars-d-learn mailing list