"with" should be deprecated with extreme prejudice

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun May 17 20:18:35 PDT 2009


BCS wrote:
> Hello Andrei,
> 
>> BCS wrote:
>>
>>> Hello Andrei,
>>>
>>>> dsimcha wrote:
>>>>
>>>>> Absolutely not.  It's far too useful as syntactic sugar when
>>>>> working heavily with plain old data structs, and saves a lot of
>>>>> tedious repetition of the struct instance name.
>>>>>
>>>> Make it a member function! If you don't have access to the struct,
>>>> use "s." as the prefix! I can't believe that's stopping you from
>>>> getting work done!
>>>>
>>> I don't follow.
>>>
>> "s." is hardly any typing.
> 
> wrong bit, I should have cut more:
> 
>> Make it a member function!
> 
> ?

In a member function there's no need to prefix each member.

Andrei



More information about the Digitalmars-d mailing list