Multiple attribute specifiers

Steve Horne stephenwantshornenospam100 at aol.com
Thu Sep 7 06:21:56 PDT 2006


On Thu, 07 Sep 2006 09:25:15 -0300, Ary Manzana <asterite at gmail.com>
wrote:

>Stewart Gordon wrote:

>> It should _definitely_ issue an error.  I call this a bug indeed.
>
>In some post of the "learn" list someone said the last attribute should 
>be taken.

If your referring to me, that's not 'should be' exactly.


First, I'm just a newb making noise, so don't necessarily pay too much
attention. I was just saying how I interpreted the behaviour, and what
the apparent plus side might be.


Second, there seems to be three different ways to apply a modifier.

1.  The C++-style colon syntax.
2.  The multi-definition block with braces.
3.  The single line definition.

On principle, writing two access modifiers in the same style should
generate a warning (same modifier given twice) or an error (modifiers
conflict). But one form overriding another (or nesting the block form)
probably not.

Basically, don't allow...

  public private blah;

or...

  private public
    {
      blah;
    }

I just don't think this is such a big deal. There are other errors
that D can't catch. There are errors D never will be able to catch.
This one, sure, in an ideal world it should. But is it really an error
that people will make? And even if they do, how much trouble will it
really cause?

But then again, appearances can be important too, I suppose.

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



More information about the Digitalmars-d-learn mailing list