__FILE__ and __LINE__ in case of import expression

Adam D. Ruppe destructionator at gmail.com
Fri Aug 21 22:34:49 UTC 2020


On Friday, 21 August 2020 at 22:12:48 UTC, Steven Schveighoffer 
wrote:
> Who does that though?

An incompetent coder:

http://dpldocs.info/experimental-docs/source/arsd.cgi.d.html#L5713
http://dpldocs.info/experimental-docs/source/arsd.cgi.d.html#L5943
http://dpldocs.info/experimental-docs/source/arsd.cgi.d.html#L6018
http://dpldocs.info/experimental-docs/source/arsd.cgi.d.html#L6058

I actually do kinda a lot. It is kinda useful for adding 
declarations with mixed in names (the whole declaration must be 
mixed in even if the only unique part is the name), or the first 
instance there is to version out features where the compiler's 
parser worked (I maintain compatibility with 2+ year old 
compilers too and if the parser changes, version alone will not 
work).

> And honestly, if it says the source is "mixin-50, line 1", I 
> think people will get it.

I could probably live with that too, but the status quo is pretty 
useful as-is.


More information about the Digitalmars-d-learn mailing list