DMD 0.168 release

Stewart Gordon smjg_1998 at yahoo.com
Tue Oct 3 09:23:43 PDT 2006


Georg Wrede wrote:
> Stewart Gordon wrote:
>> Walter Bright wrote:
>>
>>> Better array literals.
>>>
>>> http://www.digitalmars.com/d/changelog.html
>>
>>
>> Could I please have your feedback on this sometime soon?
>>
>> http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=41978 
> 
> 
> The following questions are possibly way-noobs, but I hope I'm not the 
> only one who's understanding might benefit from some info. :-)
> 
> Oh, and this is not at all directed towards the proposal: for all I 
> know, what I ask here is "the usual way to do it".
> 
> On the above refferd page, a couple of things stuck in the eye:
> 
>  - Why is Statement split between BasicStatement and the other three, 
> and only then the rest of the statements (the subs of BasicStatement)? I 
> mean, the reason for this is not immediately obvious.

In order to make the distinction between statements that can be the body 
of a control statement and statements that can't.  Compare the 
definitions of ControlledStatement and CCedStatement.

>  - (This probably is a real stupid question:) in IfCondition it says
> 
>          'auto' Identifier '=' Expression
>          Declarator '=' Expression
> 
> one would think that the "auto" line would be sort-of included in the 
> Declarator line. In other words, isn't "auto" just a case of 
> declaration? (In D overall, not specifically here.)

The current declaration syntax treats AutoDeclaration separately from 
specific-type declarations.

>  - DoStatement has an explicit ';' at the end, the others don't. What am 
> I missing here?

Clarity.

Suppose you saw

     }
     while (condition)
     doSomething();

in the middle of some code.  If DoStatement didn't have a terminating 
';', then you would have to look up, possibly several pages, to find out 
for certain whether the while applies to what precedes or to what follows.

>  - In what circumstances would a Pragma statement create or need to 
> create a new scope? (Yes, I'm ignorant on this...)

When the nature of the pragma dictates it.  I'm sure there's plenty of 
potential to invent pragmas with this characteristic.  They just haven't 
been invented yet, at least AFAIK.

> ---
> 
> Stewart, I wish I could say that all the suggestions seemed valid and 
> good, but since I just declared myself ignorant, I can't. ;-)
> 
> Oh, the existence of both LabelledStatement and LabeledStatement, and so 
> on -- does give the impression that this BNF never actually has been 
> used as input to a parser generator? I seem to remember that Walter 
> doesn't use any of this because his parser is hand-written.

That's my recollection too.

> Still, I think it is imperative that we have a valid and usable BNF 
> spec! And this spec should be the Canonical authority, should DMD, GDC 
> or other compilers or people find issues in D syntax.
> 
> Of course we now have the front-end to use for such, but that is IMHO 
> not a viable solution for studying the language, for writing third-party 
> D compilers, or for automatic tools.

I agree.

Stewart.

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- 
PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y
------END GEEK CODE BLOCK------

My e-mail is valid but not my primary mailbox.  Please keep replies on 
the 'group where everyone may benefit.



More information about the Digitalmars-d-announce mailing list