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

deadalnix deadalnix at gmail.com
Thu Apr 15 13:33:37 UTC 2021


On Thursday, 15 April 2021 at 01:15:34 UTC, Paul Backus wrote:
> 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)

idk, it seems to be that not being able to declare a void 
variable is the special case. There are expression in D of type 
void, and they compose like the rest of it.



More information about the Digitalmars-d mailing list