Const sucks

Nathan Reed nathaniel.reed at gmail.com
Mon Sep 10 13:08:14 PDT 2007


Carlos Santander wrote:
> Walter Bright escribió:
>> o  So, we still need a method to declare a constant that will not 
>> consume memory. We'll co-opt the future macro syntax for that:
>>
>>     macro x = 3;
>>     macro s = "hello";
> 
> Am I the only one who doesn't like this syntax? I guess it kinda makes 
> sense, but I just don't like how it looks.
> 

Seems to me like this unnecessarily departs from the macro syntax 
introduced at the conference:

macro foo(e) { e = 3; }

(On the other hand, in one of them the macro is for an expression while 
in the other one it's a sequence of declarations/statements.  So maybe 
it is reasonable to have the different syntax.)

Thanks,
Nathan Reed



More information about the Digitalmars-d mailing list