On 7/1/13 7:35 PM, JS wrote:
On Tuesday, 2 July 2013 at 02:15:09 UTC, Andrei Alexandrescu wrote:
On 7/1/13 6:29 PM, JS wrote:
Would would be nice is an experimental version of D where would could
easily extend the language to try out such concepts to see if they truly
are useful and how difficult to implement. e.g., I could attempt to add
said "feature", it could be merged with the experimental compiler, those
interested can download the compiler and test the feature out... all
without negatively affecting D directly. If such features could be
implemented dynamically then it would probably be pretty powerful.
I don't think such a feature would make it in D, even if the
implementation cost was already sunken (i.e. an implementation was
already done and one pull request away).
Ascribing distinct objects to the same symbol is a very core feature
that affects and is affected by everything else. We'd design a lot of
D differently if that particular feature were desired, and now the
fundamentals of the design are long frozen. For a very simple example,
consider:
auto a = 2.5; // fine, a is double
...
a = 3;
No, not under what I am talking about. You can't downgrade a type, only
upgrade it. a = 3, a is still a float. Using the concept I am talking
about, your example does nothing new.
but reverse the numbers:
auto a = 3;
a = 2.5;
and a is now a float, and your logic then becomes correct EXCEPT a is
expanded, which is safe.
I really don't know how to make it any clearer but I'm not sure if
anyone understands what I'm talking about ;/
You can definitely assume you are being well understood. That's going to
break a lot of code because of e.g. calls to overloaded functions in
between changes of type.
Just drop this. Not only it won't make it into D, it's also not
particularly interesting.
Andrei