Thoughts on versioning

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 26 02:03:11 UTC 2021


On 10/25/21 9:59 PM, Ali Çehreli wrote:
> On 10/25/21 6:19 PM, Andrei Alexandrescu wrote:
> 
>  > template mismatch(alias the_std)
>  > {
>  >      import the_std.typecons : Tuple, tuple;
> [...]
>  > }
> [...]
>  > About the last point: currently the language does allow passing a
>  > package name as an alias, but trying to import the_std.typecons ignores
>  > any alias definition and opens the hardcoded path "the_std/typcons.d".
> 
> Sorry to stray from the main point but I needed that missing feature in 
> the past: "This is a string template parameter but I don't want to use a 
> string at call site." (Similar to how non-string uses of opDispatch are 
> presented as strings.)
> 
> For example, Flag!"foo" does not look good. Instead, I want to say 
> Flag!foo.

Walter and I discussed this a long time ago, several times, under the 
proposal "new alias":

template Flag(new alias name) { ... }

If a template takes a "new alias" it means it takes an alias that does 
not refer to anything that currently exists. Inside the template the 
alias can be used to introduce a name or as a string.





More information about the Digitalmars-d mailing list