unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>,
	9222@debbugs.gnu.org, Reuben Thomas <rrt@sc3d.org>
Subject: bug#9222: 23.3.50; "void" is not "typeless" (but thanks for the koan!)
Date: Mon, 14 Oct 2019 18:08:38 +0200	[thread overview]
Message-ID: <CADwFkm=SokkH4c5G91jvBLPzvLjLTjBW2VjC5jb-RHXKbhGJTQ@mail.gmail.com> (raw)
In-Reply-To: <87sjpkc5zm.fsf@sc3d.org>

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





  parent reply	other threads:[~2019-10-14 16:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02 13:12 bug#9222: 23.3.50; "void" is not "typeless" (but thanks for the koan!) Reuben Thomas
2011-09-11  1:59 ` Lars Magne Ingebrigtsen
2011-09-11  3:25   ` Stefan Monnier
2011-09-11  3:30     ` Lars Magne Ingebrigtsen
2011-09-11  4:56       ` Stefan Monnier
2011-09-11  8:13         ` Reuben Thomas
2011-09-11  8:45           ` Andreas Schwab
2011-09-11 14:38             ` Drew Adams
2011-09-12 12:39           ` Stefan Monnier
2019-10-14 16:08 ` Stefan Kangas [this message]
2019-10-14 19:01   ` Stefan Monnier
2019-10-14 19:38     ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkm=SokkH4c5G91jvBLPzvLjLTjBW2VjC5jb-RHXKbhGJTQ@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=9222@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rrt@sc3d.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).