Proposal: __traits(getComment, symbol)

Eugene Wissner belka at caraus.de
Wed Aug 28 10:04:09 UTC 2019


On Wednesday, 28 August 2019 at 10:00:07 UTC, Per Nordlöw wrote:
> On Wednesday, 28 August 2019 at 09:04:06 UTC, Eugene Wissner 
> wrote:
>> I think the languages that have "comment reflection", use this 
>> instead of custom attributes. In PHP for example
>>
>> /**
>>  * @ORM\Entity(...)
>>  */
>> class MyEntity { ... }
>>
>>
>> Because there are no attributes. Why can't you just use UDAs 
>> instead of comments?
>
> We must also take into account differences in compilation time 
> and memory for alternative solutions, in this case __traits vs 
> UDAs.

UDAs are already supported. If you want to read the comments at 
compile-time, as a next step you want to parse them, validate the 
types and content, generate and write some output...


More information about the Digitalmars-d mailing list