[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 Kangas |
Subject: |
bug#9222: 23.3.50; "void" is not "typeless" (but thanks for the koan!) |
Date: |
Mon, 14 Oct 2019 18:08:38 +0200 |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> 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").
>
>
> Stefan
>
>
> 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).
This still says "typeless type" 8 years later, which makes no sense to
me either.
Since the C "void" type does not map perfectly to neither the unit
type nor the empty type, and also has the added confusion that "void*"
pointers are quite different from functions with return type "void",
perhaps we should just change it to:
"Built in type: void"
That should avoid any confusion, yet be clear enough for any C programmer.
What do you think?
Best regards,
Stefan Kangas
- bug#9222: 23.3.50; "void" is not "typeless" (but thanks for the koan!),
Stefan Kangas <=