Editions Ideas

Meta jared771 at gmail.com
Wed Mar 11 18:01:50 UTC 2026


On Wednesday, 11 March 2026 at 09:27:30 UTC, monkyyy wrote:
> On Wednesday, 11 March 2026 at 04:47:38 UTC, Meta wrote:
>> On Wednesday, 24 December 2025 at 14:06:47 UTC, Timon Gehr 
>> wrote:
>>> On 12/23/25 01:29, 6622 wrote:
>>>> 
>>>> I support removing the multiple inheritance, it snuck into 
>>>> the language unintentionally.
>>>
>>> a) It's not actually multiple inheritance.
>>> b) TDPL documents that there can be more than one `alias 
>>> this`.
>>>
>>> This is not any more complicated than allowing more than one 
>>> module to be imported...
>>
>> Is there any reason you can't put free functions in a module 
>> and import them inside a struct to sort of simulate this? You 
>> could even have a weird form of "inheritance" by publicly 
>> importing one module into another.
>
> Youd need something that gives access to the data, if it just 
> knows who's calling it thats just introspection with extra 
> steps; functions need to process data to do something without 
> being a haskell io monad.
>
> I'm not aware of any such pattern that can get access to `this` 
> or context or something

There is __traits(parent) and __traits(child), but I'm not sure 
they would work in this case. But there's also opDispatch, which 
definitely would. At that point though, it's not really worth the 
effort.


More information about the Digitalmars-d mailing list