dip: __HERE__ special token

Alexandru Ermicioi alexandru.ermicioi at gmail.com
Sun Apr 10 21:50:59 UTC 2022


On Sunday, 10 April 2022 at 19:10:31 UTC, monkyyy wrote:
> ```
> int ignored;
> int referenced;
> void main(){
>     alias foo=referenced;
>     struct bar{}
>     alias faz=sometemplate!int;
>     alias firstcopy=__HERE__;//foo,bar,faz
>     int baz;
>     alias secondcopy=__HERE__;//foo,bar,faz,firstcopy,baz
> }
> ```
>
> https://github.com/crazymonkyyy/DIPs/blob/master/DIPs/1NNN-MKY.md
>
> A special token for convenience while meta programming

Tuples in D right now autoexpand, making the expectation in 
secondcopy wrong. The result would be just, 
foo,bar,faz,foo,bar,faz,baz.

Still, whats the use case of this functionality?


More information about the Digitalmars-d mailing list