From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Reuben Thomas <rrt@sc3d.org>
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>, 9222@debbugs.gnu.org
Subject: bug#9222: 23.3.50; "void" is not "typeless" (but thanks for the koan!)
Date: Mon, 12 Sep 2011 08:39:10 -0400 [thread overview]
Message-ID: <jwvfwk2q6wp.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAOnWdojyckZEjX5Pmpi-2GfghWN9qbtoSkLDNpg1w9buozk=uw@mail.gmail.com> (Reuben Thomas's message of "Sun, 11 Sep 2011 09:13:00 +0100")
>> It's still not typeless: it's just that the type you get gives you no
>> information about the data.
> Moreover, in C, in which types are not first-class objects, no type
> has a type, so every type is a typeless type.
Actually, you don't need types to be "first class objects" for them to
have a type. From type theory's point of view, C types all have the
same type, which you could call "Type" or * or ω, i.e. the type
of types. It's also often called a kind.
To be more precise, in C you could consider "struct" as a type-level
function which takes a descriptor and returns a type. And "{ int a,b;
char c; }" would then be a structure-descriptor. I.e.:
struct has type "StructureDescriptor -> Type"
{ int a,b; char c; } has type "StructureDescriptor"
From that point of view "struct" is a valid expression in the type
language, but it does not describe a set of values: only types who
have type "Type" describe values.
> I agree, BTW, that "unit type" is a better description of void than my
> original "empty type".
From a theoretical point of view, yes, but most people are unfamiliar
with "unit type" and its name doesn't lend itself to a good intuitive
understanding of it.
Stefan
next prev parent reply other threads:[~2011-09-12 12:39 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 [this message]
2019-10-14 16:08 ` Stefan Kangas
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvfwk2q6wp.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=9222@debbugs.gnu.org \
--cc=larsi@gnus.org \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.