Follow-up post explaining research rationale

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Sun May 15 04:30:20 PDT 2016


On Sunday, 15 May 2016 at 11:04:22 UTC, Timon Gehr wrote:
> That's mostly due to the amount of semantic special casing, 
> it's not just narrow syntax concerns. E.g. 'void' is a "type" 
> that is claimed to have no values, but functions returning void 
> can still terminate normally.

It may have values, but you cannot access them. A pointer to void 
is roughly the same as the identity-capability «Tag» in Pony 
(http://tutorial.ponylang.org/capabilities/reference-capabilities.html). So void is a "view" on an object that only may give access to the identity, but not the content: «I know of your existence, but not what you are».

In C it is not uncommon to cast variables to void, in order to 
silence "unused variable" warnings... Basically saying "I am 
using this, but not accessing it"...



More information about the Digitalmars-d mailing list