Draft proposal for mixin template intermediary storage

Timon Gehr timon.gehr at gmx.ch
Tue Dec 27 23:02:39 UTC 2022


On 12/26/22 20:19, bauss wrote:
> On Sunday, 25 December 2022 at 21:52:29 UTC, Timon Gehr wrote:
>> On 12/20/22 18:26, Max Samukha wrote:
>>> On Tuesday, 20 December 2022 at 17:08:47 UTC, rikki cattermole wrote:
>>>> I think you have caught on to something that I played a little bit 
>>>> during BeerConf.
>>>>
>>>> We need to make the compiler 'forget' certain template 
>>>> instantiations and with that, to not directly expose them outside of 
>>>> a mixin template body would be a good semantic to it.
>>>>
>>>> I refer to them as a type function, because its a meta-function that 
>>>> operates on types. Its not quite types as first-class, but more of a 
>>>> reference to something in the AST that is a type.
>>>>
>>>> It could be a possible solution to deadalnix's data structure 
>>>> problem with storage classes like const if it has the right hook.
>>>
>>> What happened to __local from 
>>> https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1010.md?
>>
>> This is what happened to it:
>> https://github.com/dlang/dmd/commit/bac3426f9881e4a591df229423475efc6c3e0918
>>
>> In context:
>> https://github.com/tgehr/dmd/commits/static-foreach
> 
> But why was it removed?

Because it was just an experiment and not part of the scope of the DIP. 
(I just proposed everything that was obvious to not give any attack 
surface.) I am in particular not sure about the syntax `__local`. We can 
add such a feature back easily, it's around 10 lines of code that need 
to be restored, but I don't know how exactly it should look.


More information about the Digitalmars-d mailing list