Discussion Thread: DIP 1041--Attributes for Higher-Order Functions--Community Review Round 1

Paul Backus snarwin at gmail.com
Thu Apr 15 01:15:34 UTC 2021


On Wednesday, 14 April 2021 at 23:51:33 UTC, deadalnix wrote:
> On Wednesday, 14 April 2021 at 22:23:38 UTC, Timon Gehr wrote:
>> For example, above, the semantics of `T[]` and `T delegate(S)` 
>> are not fully compositional, because they have special cases 
>> for `T = void`.
>>
>
> How is void delegate(S) a spcial case?
>
> Great post, BTW.

You can't use `void` as a type on its own, but you *can* use it 
in certain specific contexts, like `void delegate(S)` and 
`void[]`. Those specific contexts are special cases: they're not 
derived from any general rule, but have to be spelled out 
explicitly in the language spec. (For example, 
https://dlang.org/spec/arrays.html#void_arrays)


More information about the Digitalmars-d mailing list