[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9222: 23.3.50; "void" is not "typeless" (but thanks for the koan!)

From: Stefan Monnier
Subject: bug#9222: 23.3.50; "void" is not "typeless" (but thanks for the koan!)
Date: Sat, 10 Sep 2011 23:25:10 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> In semantic/bovine/c-by.el there’s the following description:
>> ("void" summary "Built in typeless type: void")
>> Cute, but inaccurate: void is a type alright. I suggest changing
>> “typeless type” to “empty type”.
> I don't quite think that "empty type" is more meaningful than "typeless
> type".  At least to me, "typeless type" makes more sense, even if it is
> somewhat humorous.

I beg to disagree: to a large extent, a type can be thought of as a set
of values.  So a type can be empty (meaning that there is no value of
that type).  But a "typeless type" is rather meaningless (in type
theory, types have themselves a type, so for example "1" has type "Int"
and "Int" has type "Type", but then a type can't be "typeless" since the
"definition" of a type is then basically "has type Type").


PS: Of course, in C the "void" type is more like the "unit" type than
like the empty type, i.e. a type with a single value which hence doesn't
carry any information.  E.g. a function that returns a type void can
return, tho its return value carries no information ("it returns
nothing") whereas a function that returns the empty type is a function
that will never return (since there is no value in the empty type, the
function can never return a value of the right type).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]