lurker <[email protected]> wrote:
Why am I using this language?
There is absolutely no need to use D. In fact some (most?) of us wish
that you wouldn't.
This answer isn't for you because you implicitly seem to disagree with
everything, but here it goes: Designing new keywords is a complicated
task. Walter follows a so called parser oriented thinking - what's easy
to implement in the parser (the low hanging fruit), seems to be the best
solution. If you need other kind of changes to the language, you need to
carefully take into consideration (Herb Sutter like C++ thinking) all
kinds of aspects such as legacy concerns (C compatibility), namespace
issues (__keywords and @keywords nicely create new namespaces and don't
conflict with user symbols like variables). I can't even possibly
imagine why would anyone (except you) want to use their own keywords. It
sounds like a new treacherous way to invite dangerous macros to the
language.
Well, the @tribute syntax has been touted as an extensible property
system, where users may possibly throw their own into the mix, and
create systems for checking their validity.
The reservation of the word macro without giving an implementation is a
conscious decision to disable all kinds of over-expressive macros in
forthcoming versions of the language.
What? The macro keyword has been reserved because future version of D
are likely to have an AST macro system, and it would be unfortunate if
everyone was already using that symbol in their code.
Providing customized @keywords for 3rd party tools seems like mocking
the damn good state of the art meta-programming system D has.
I believe, but am not sure, that user-defined @tributes would require
an AST macro system, so that e.g. transitive @tributes may be enforced.
This is not something D's current MP capabilities cover.
If I could design D, I'd use @ in front of every keyword to avoid
namespace collisions with user symbols.
@module foo;
@safe:
@import std.stdio;
@class Bar {
@private:
@static @property @pure @immutable Bar myBar( ) {
@try {
@if ( baz @in qux ) {
} @else {
}
} @catch {
}
}
}
Really?
Note: it may be that your post was all irony, in which case it was
a bit hard to decipher.
--
Simen