Is AliasAssign Now Official?

Dylan Graham dylan.graham2000 at gmail.com
Thu Aug 19 07:02:32 UTC 2021


On Thursday, 19 August 2021 at 06:23:52 UTC, surlymoor wrote:
> While reading through the spec to resolve some impressive 
> idiocy of mine, I noticed that [alias mutability (given some 
> constraints) is officially part of 
> D](https://dlang.org/spec/declaration.html#AliasAssign). 
> Previously, I knew this to be an experimental feature, and its 
> seemingly most salient benefit is that of a more readable 
> alternative to recursive templates. This is nice, but shouldn't 
> a DIP have been required for its inclusion outside of the 
> preview switch? Might I and others use it knowing that it won't 
> be rescinded in future versions of the frontend?

If it's now official documentation, I assume that it'd need to go 
through a deprecation process to properly remove it, so it should 
be safe to use.

In regards to its inclusion into the language, I found 
justification in [this 
PR](https://github.com/dlang/dmd/pull/11846):

> I'm trying to convince myself that this is removal of 
> surprising limitations, as opposed to a large change. On the 
> face of it, allowing reassignment of alias names is in keeping 
> with the rest of D (mutability is the default). So I could 
> imagine how we can consider that as removing a limitation. 
> [link](https://github.com/dlang/dmd/pull/11846#issuecomment-706615742)

However, there was a bit of push back:
> It would be great if we could stop putting experimental stuff 
> straight into the language.
There's nothing wrong with iterative design and experimental 
features, but they should be opt-in, behind a preview switch. 
[link](https://github.com/dlang/dmd/pull/11846#issuecomment-745501942)

I'm not picking sides on how this should have been approached, 
just trying to provide some context for this discussion.


More information about the Digitalmars-d mailing list