Uphill

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 1 23:32:42 PDT 2015


On Tuesday, 2 June 2015 at 05:58:43 UTC, Ola Fosheim Grøstad 
wrote:
> On Monday, 1 June 2015 at 18:54:18 UTC, Jonathan M Davis wrote:
>> It sounds to me like you're too against macros for your own 
>> good. Sure, they suck, but that's just life with C++ unless 
>> you want to make life harder for yourself. Simply wishing that 
>> the
>
> But it doesn't make my C++ life harder, it makes my C++ life 
> better. I don't need them, where I would use macros in C, I can 
> usually make do with a constexpr or a template and get type 
> safety and more readable code.
>
> But I hope you see my point that __FILE__ and __LINE__ would be 
> better done with introspection, also in D? Such "magic cookies" 
> are signs of a lack of orthogonality.
>
> (And it can be done as hidden registers/parameters in the 
> language implementation so that you can have separate 
> compilation and compile time evaluation of introspection where 
> possible.)

D's semantics for __FILE__ and __LINE__ are so much better than 
C++'s. I sorely miss D's semantics for them whenever I'm in C++. 
Having them get the values from the call site rather than the 
declaration site is so much more useful that it's not even funny.

- Jonathan M Davis


More information about the Digitalmars-d mailing list