new DIP47: Outlining member functions of aggregates

Iain Buclaw ibuclaw at ubuntu.com
Sat Sep 7 23:46:59 PDT 2013


On 8 September 2013 07:14, dennis luehring <dl.soluz at gmx.net> wrote:
> Am 08.09.2013 07:48, schrieb Iain Buclaw:
>>
>> On Sep 8, 2013 5:55 AM, "dennis luehring" <dl.soluz at gmx.net> wrote:
>>>
>>>
>>> Am 07.09.2013 19:00, schrieb Walter Bright:
>>>
>>>> Outlining of member functions is the practice of placing the declaration
>>
>> of a
>>>>
>>>> member function in the struct/class/union, and placing the definition of
>>
>> it at
>>>>
>>>> global scope in the module or even in another module.
>>>>
>>>> http://wiki.dlang.org/DIP47
>>>>
>>>
>>>
>>> "Parameter names need not match."
>>>
>>> please don't do this - that will nearly kill any easy way of finding the
>>
>> implementation,
>>
>> That depends on your coding style and is not necessarily true.  Eg: I put
>> function names at the start of the line.
>>
>> int
>> foo_bar ()
>> {
>> }
>>
>> So all global functions are easily grep'able ('^foo_bar').
>>
>> Same thing is also done with C++ outlined members ('^Class::foo_bar') and
>> I
>> could see myself adopting the same for D aggregate methods too.
>>
>> Regards
>>
>
> im talking about "Parameter names need not match."
> so it will become hard to find the same overload of a method if someone else
> writes int a, int b in declaration and int pa, int pb in implementation -
> and the only benefit is beeing compatible with c/c++ - that will introduce
> another point in all D-coding-style guides around the world not to rename
> parameter in implementation

I was talking about "Parameter names need not match" too... I disagree
that mismatched parameter names makes things hard to find, and by way
of example, I just search for the function.  I never say "right, I
need to find this implementation" and grep for the parameter list in
the declaration...

Regards
-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the Digitalmars-d mailing list