Flag proposal

Ary Manzana ary at esperanto.org.ar
Mon Jun 13 23:56:09 PDT 2011


On 6/14/11 1:38 PM, so wrote:
> On Tue, 14 Jun 2011 09:33:54 +0300, Ary Manzana <ary at esperanto.org.ar>
> wrote:
>
>> On 6/14/11 12:58 PM, so wrote:
>>> On Tue, 14 Jun 2011 08:32:59 +0300, Nick Sabalausky <a at a.a> wrote:
>>>
>>>> I think Ary's suggestion is very simple and easy to understand. Hybrid
>>>> calls
>>>> are *only* confusing when an unnamed parameter comes after a named one.
>>>
>>> An example to it.
>>>
>>> fun(int a, int b, int c, int d)
>>>
>>> Say we want to name only c:
>>>
>>> fun(2, 3, 1, c:5)
>> // error: c assigned twice
>>
>> Remember, the third argument is positional so it's assigned to c. Then
>> you are trying to assign c again. It's an error.
>
> Sorry i don't understand, what should i do?

You can't only name c. You can name arguments from the end to the beginning:

fun(2, 3, 1, d: 99)
fun(2, 3, c: 98, d:99)
fun(2, 3, d: 98, c:99)
fun(2, c: 97, b: 98, d:99)
etc.


More information about the Digitalmars-d mailing list