Manifest constants - why not 'alias' ?

Bill Baxter dnewsgroup at billbaxter.com
Thu Dec 6 22:28:19 PST 2007


Robert Fraser wrote:
> mandel wrote:
>> On Thu, 06 Dec 2007 21:07:18 -0800, Walter Bright wrote:
>>
>>> David Gileadi wrote:
>>>> FWIW, alias makes the most sense to me out of the current crop of
>>>> suggestions.  To me it says that wherever I see the alias, it will be
>>>> replaced with whatever value the alias is for.  That seems to describe
>>>> manifest constants exactly.
>>> Since there's already:
>>>
>>>     alias X Y;
>>>
>>> it would seem confusing to add:
>>>
>>>     alias Y = X;
>>
>> I know it was asked before for sure,
>> but could someone point out why not just use:
>>
>> alias Y 42;
>> alias Z "abc";
>> alias X [1,2,3];
> 
> No type safety.

And the above is also backwards from current alias syntax.  The newly 
defined thing goes on the right, not the left.

--bb



More information about the Digitalmars-d mailing list