CTFE Status 2

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 8 17:25:45 PDT 2017


On Saturday, 8 April 2017 at 19:03:52 UTC, crimaniak wrote:
> On Saturday, 8 April 2017 at 09:14:17 UTC, Stefan Koch wrote:
>> This is a question for D.Learn.
>> please post there.
> Yes, I did it already and know, it is not possible for now: 
> https://forum.dlang.org/post/crkxlbtfhsplxfilakrk@forum.dlang.org
>
> This is exact reason why I asked, how hard _to implement_ it. I 
> asked you, because UDF constructor executed in CTFE, and you 
> can give the most competent answer, because you are working on 
> it.
>
>> Also the question is to terse, I do not know what you are 
>> asking.
>
>   How hard to implement something like special keyword 
> __SYMBOL__, which will be alias for Foo (or string with fully 
> qualified name of Foo) in example in my initial letter, in the 
> scope of udf constructor.

This is not related to the ctfe subsystem.

Therefore take my answer with a grain of salt.
I assume that what you want will quite expensive in terms of 
compiler performance.
Also it would require a language change.
A facility as you want it would need to modify the constructor 
behind the scenes, either by adding a hidden template parameter 
to the constructor.
I general I would be weary about adding this facility.
Though right now I cannot see any wired corner-cases, I think 
that you are going to run into trouble with this.
Particularly when forward-references are involved.


More information about the Digitalmars-d mailing list