[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: Lars Magne Ingebrigtsen
Subject: bug#9222: 23.3.50; "void" is not "typeless" (but thanks for the koan!)
Date: Sun, 11 Sep 2011 05:30:24 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> 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).

I was thinking more of functions that take void* as a parameter.  What's
usually expressed by that is "here's some memory that we're not actually
telling you what the type of is explicitly", so it's (sort of) a pointer
to something typeless.  It's not a pointer to something of an empty
type.  :-)

So calling "void" a "typeless type" makes some sense.  At least to me --
in a C context.

(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/

reply via email to

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