| |
| Posted by Stewart Gordon | PermalinkReply |
|
Stewart Gordon
| 1. One or two new spelling mistakes. E.g. "arbitrarilly" has come back
on garbage.html
2. overview.html
synchronize int func() { . }
The word is 'synchronized', isn't it?
3. Frequent use of (type) something in code snippets instead of
cast(type) something. Shouldn't you be setting an example by using the
D syntax that follows the context-free grammar principle?
I'd also be inclined to add this rule to the D style.
4. Last time I looked, several code snippets also used type *var instead
of type* var, also contrary to the D style and semantics. I forget
where though.
5. expression.html
AddExpression:
MulExpression
MulExpression + MulExpression
MulExpression - MulExpression
MulExpression ~ MulExpression
et al.
As much as you've told us that a + b + c could be evaluated either as (a
+ b) + c or a + (b + c), what you're saying here is that a + b + c is
invalid syntax. A possible solution is define the grammar as in C,
keeping optimisation of precedence as part of semantic analysis. (Is
this how DMD actually works at the moment?)
Of course this complication doesn't apply to boolean operators, for which
OrOrExpression:
AndAndExpression
AndAndExpression || AndAndExpression
can clearly be fixed to
OrOrExpression:
AndAndExpression
AndAndExpression || OrOrExpression
and similarly AndAndExpression, without any semantic analysis overhead.
6. While we're still talking about the BNF on expression.html, the
cast(type) notation is completely missing from it.
7. Not sure if this is an error, but UnaryExpression down to
PrimaryExpression looks a bit odd.
UnaryExpression:
( Expression )
Shouldn't this be a PrimaryExpression?
PrimaryExpression:
Type . Identifier
Shouldn't this be a PostfixExpression? And doesn't it conflict with
PostfixExpression . Identifier either way?
8. "Casting pointers to non-pointers and vice versa is not allowed in D."
Is this a lie, or a misbug in DMD? It lets me cast an integer to a
pointer, which is actually necessary in Windows API programming.
(Unless _everything_ in this department can be done with a union....)
9. "There is no else clause for a debug statement, as debug statements should add code, not subtract code."
DMD lets me do this too. A possible application is to change output that's in the regular version to be more detailed in debugging builds.
Stewart.
--
My e-mail is valid but not my primary mailbox. Please keep replies on
on the 'group where everyone may benefit.
|