dst = src rather than src dst

Russell Lewis webmaster at villagersonline.com
Wed Sep 5 13:58:27 PDT 2007


Bill Baxter wrote:
> Robert Fraser wrote:
>> Russell Lewis Wrote:
>>
>>> Let's take this one step further.  Let's say that this is a typedef:
>>>      typedef dst = src.dup;
>>> while this is an alias:
>>>      typedef dst = src;
>>
>> Please no!
> 
> On second thought, let's take a step back again.
> And forward
> and back...
> and then we're cha-cha-ing!

Yeah, I felt the same way when the syntax first occurred to me: "EEK! 
RUN!"  But it's growing on me.  There is a certain elegance to the idea 
that a type is a compile-time variable, and that an alias is copying the 
(reference to) the type, while a typedef is creating a new type with the 
same contents (that is, the same semantics) as the old.

But I still shudder when I see it. :)



More information about the Digitalmars-d mailing list