Manifest constants (was const again)

Oskar Linde oskar.lindeREM at OVEgmail.com
Fri Dec 7 12:26:11 PST 2007


Janice Caron wrote:
> On 12/7/07, Oskar Linde <oskar.lindeREM at ovegmail.com> wrote:
>> Like others, I propose that manifest constants use the alias keyword.
>> Alias is perfect for this. Since they don't occupy storage, they could
>> thus also be polysemous values in the future.
>>
>> alias str = "str";
> 
> I'm uncomfortable with having
> 
>     alias dest = source;
> 
> in one circumstance, but
> 
>     alias source dest;
> 
> in others. I would find that confusing.

Then just make the two forms equivalent and maybe depreciate the second 
one with time.

alias pi = 3.14;
alias toString = to!(string);

Why would this be a problem?

-- 
Oskar



More information about the Digitalmars-d mailing list