Re: Compile Time String processing
On Feb 27, 4:15 am, Walter Bright <wal...@digitalmars-nospamm.com>
On Feb 26, 3:39 am, Walter Bright <wal...@digitalmars-nospamm.com>
It's nice to have a motivating example in a closely related language,
especially since exported templates come 'for free' with imports instead
of taking years to implement <g>. Neither Java nor Modula-2 have
templates, so their examples are less compelling.
Since C++ utterly routed and destroyed Modula-2 about 18 years
ago, it'd be hard to get anyone to listen to a spiel about
adopting M2 features :-).
Well, Java adopted some of Modula-3's features, and you
occasionally hear calls for them to be adopted into C++
(finally, for example). (And of course, anyone who's actually
used Modula-2 still misses its modules in C++. Even after 20
The concept of modules has been around for a long time; Ada's
packages are very similar (and for many applications, Ada is
C++'s only concurrent). And it has been generally recognized
for a long time, even by people who are otherwise very pro-C++,
that textual inclusion is not really a good solution to the
problem; it can, with a lot of care on the part of the user, be
made to work, but that's about all that can be said for it.
As more of a meta-comment: I believe that one of your goals with
regards to D is that the language should be used. If so, then
it is normal, and IMHO necessary, that D doesn't invent totally
new concepts. Users need something stable, and to define
something stable that works, you need existing practice---that
people have actual experience with the feature. And I don't
think that D is widespread enough that it can be considered as
having "popularized" anything, either. Given these two points,
I don't think that D can be said to have played a large role in
the evolution of C++. It's sometimes nice to know that a
feature has been implemented in a language similar to C++, but
that's about it. And you have to define what is meant by
similar: is the compilation model of D closer to C++ or to Java?
(With regards to the compilation model, Ada is closer to C++
than is Java, and experience in Ada is more significant than
that in Java.)
That doesn't mean that D is necessarily irrelevant. Any
experience with a new feature, in any language, is relevant.
But it's certainly not the only, or even the main source for the
evolution of C++. It is, at most, just one additional data
I, for one, get rather tired of seeing this forum used as a
propaganda medium for D. There are cases where mentionning D is
perfectly relevant---if the question were, how could this
feature be implemented in C++, then a discussion of how you
implemented it in D (including discussion of how D is differs
from C++ in e.g. its definition of string literals) is relevant.
When the question is just: can this be done in C++, insisting on
the fact that it can be done in D, isn't. Note that this has
nothing to do with the qualities of D per se. This forum just
isn't the place for such blatant advocacy.
James Kanze (GABI Software) email:firstname.lastname@example.org
Conseils en informatique orient?e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S?mard, 78210 St.-Cyr-l'?cole, France, +33 (0)1 30 23 00 34
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]