Proposal: __traits(getComment, symbol)

FeepingCreature feepingcreature at gmail.com
Thu Aug 29 05:37:40 UTC 2019


On Wednesday, 28 August 2019 at 09:44:10 UTC, Mike Franklin wrote:
> In general, I'm in favor of adding any compiler information to 
> the `__traits` system.  This one is particularly interesting 
> though.
>
> I once gave a talk at DConf explaining how I copy and pasted 
> register table from a datasheet into an application, and had it 
> spit out D code.  I later ported the code to D 
> (https://github.com/JinShil/stm32_datasheet_to_d).  With your 
> proposal, I could just paste the text from the datasheet into 
> my DDoc comment and have D generate the code for me.  Chuckle, 
> Chuckle.
>
> Now think what people more "creative" than I could come up 
> with.  :-)
>
> I'm not sure if it would be good practice.
>
> Mike

I personally feel that with string mixin, CTFE, import() and now 
UDAs, we have already given the programmer entirely sufficient 
lengths of rope to hang themselves in whichever way they desire. 
Adding another length of rope to create an exciting new way to 
cause self-harm will not at this point increase the death and 
injury rate an appreciable amount.

That ship has sailed, made landfall in the Americas, and is 
currently on the return trip.


More information about the Digitalmars-d mailing list