Discussion Thread: DIP 1037--Add Unary Operator ...--Community Review Round 1

Manu turkeyman at gmail.com
Wed Oct 28 11:52:01 UTC 2020


Your example `void c(int...)` mangles as `void c(int)`, and it's also
callable only with a single int arg.
Under my DIP, `d` as you show will perform an identity map, which yields
`void d(int)`, so the result is identical.
I explored for ambiguities to the extent of my imagination but I didn't
find any. The is() expression was where I was most concerned about
ambiguities.

On Wed, Oct 28, 2020 at 9:44 PM Manu <turkeyman at gmail.com> wrote:

> On Wed, Oct 28, 2020 at 9:05 PM Jacob Carlborg via Digitalmars-d <
> digitalmars-d at puremagic.com> wrote:
>
>> On Tuesday, 27 October 2020 at 10:54:07 UTC, Mike Parker wrote:
>> > This is the discussion thread for the first round of Community
>> > Review of DIP 1037, "Add Unary Operator ...":
>> >
>> >
>> https://github.com/dlang/DIPs/blob/ba81eec84ddf0aeeb2cb652743b292455ec8c62a/DIPs/DIP1037.md
>>
>> Is there a risk of causing some form of ambiguity with variadic
>> functions? For example:
>>
>> void a(int[] a ...);
>> void b(int[]...);
>> void c(int...);
>>
>> alias A = AliasSeq!(int);
>> void d(A...);
>>
>> I didn't know `c` was legal, but apparently it is (and therefor
>> `d` as well).
>>
>
> What does `c` mean?
> Is it possible that c and d are identical things here, even with my DIP in
> place?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20201028/78160d7b/attachment.htm>


More information about the Digitalmars-d mailing list