A nice way to step into 2012

Timon Gehr timon.gehr at gmx.ch
Sun Jan 1 04:37:24 PST 2012


On 01/01/2012 08:17 AM, Don wrote:
> On 31.12.2011 16:26, Timon Gehr wrote:
>> On 12/31/2011 12:13 PM, Don wrote:
>>> On 31.12.2011 02:27, so wrote:
>>>> On Sat, 31 Dec 2011 02:40:24 +0200, Don <nospam at nospam.com> wrote:
>>>>
>>>>> I think: there are cases when named parameters are beneficial. There
>>>>> are cases where they are detrimental.
>>>>> Is it possible to get the first, without the second, and without much
>>>>> complexity?
>>>>
>>>> If we keep rules simple as possible i think it is possible.
>>>> For that we need our own rules i think, remembering all those rules
>>>> suggested here
>>>> i can understand why people have issues with them.
>>>>
>>>>> (I'm thinking of something like, a colon before the parameter name
>>>>> means the name is part of the API).
>>>>
>>>> This i don't like, we shouldn't change anything on API side.
>>>> All they need to know is that their parameter names (if they provid
>>>> one)
>>>> might be used in NPs.
>>>> Otherwise it would complicate both implementation and usability.
>>>
>>> But it is IMPOSSIBLE to not provide them.
>>
>> It is possible:
>>
>> void foo(int, float, double, string);
>
> Only if you create and hand-edit a .di file.
> And that won't even work for templates.
>

void foo(T...)(T _);

Then you have to manually reproduce overloading rules inside the 
template body. But you are right. There is no satisfactory solution.

>>
>> But then it is impossible to have an implementation around for CTFE.
>



More information about the Digitalmars-d mailing list