Is `alias this` a mistake?

TheGag96 thegag96 at gmail.com
Thu Aug 5 11:46:00 UTC 2021


On Tuesday, 3 August 2021 at 15:52:07 UTC, NonNull wrote:
> Here, further down, I just saw Walter indicate his opinion that 
> `alias this` is a mistake. Any thoughts?
>
> https://news.ycombinator.com/item?id=28029184

This is just surprising to me. I think `alias this` is a pretty 
cool thing... I use it within a mixin template (among stuff other 
stuff) in order to roll my own implementation of inheritance for 
entities in my game engine. Might be a bit goofy, but it does 
work pretty well for my hobbyist purposes, at least. How else are 
we going to get any kind of smooth "subtyping" with structs?

For what it's worth, the Jai language [is lifting the idea 
wholesale](https://youtu.be/MXNkQ5L4pLo) with its `using` syntax. 
I think it has support for more than one of them as well.

If it's not a good idea today, how can we make it one?


More information about the Digitalmars-d mailing list