From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#9222: 23.3.50; "void" is not "typeless" (but thanks for the koan!) Date: Sun, 11 Sep 2011 00:56:51 -0400 Message-ID: References: <87sjpkc5zm.fsf@sc3d.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1315717078 26422 80.91.229.12 (11 Sep 2011 04:57:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2011 04:57:58 +0000 (UTC) Cc: Reuben Thomas , 9222@debbugs.gnu.org To: Lars Magne Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 11 06:57:54 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R2c78-0008Tv-0Z for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2011 06:57:54 +0200 Original-Received: from localhost ([::1]:55698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2c77-0000Dz-Dq for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2011 00:57:53 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2c74-0000Dj-Ed for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2011 00:57:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R2c73-0006uy-0K for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2011 00:57:50 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2c72-0006un-UY for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2011 00:57:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R2cB8-0000l1-3I; Sun, 11 Sep 2011 01:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2011 05:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9222 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9222-submit@debbugs.gnu.org id=B9222.13157172682839 (code B ref 9222); Sun, 11 Sep 2011 05:02:02 +0000 Original-Received: (at 9222) by debbugs.gnu.org; 11 Sep 2011 05:01:08 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R2cAF-0000jk-PE for submit@debbugs.gnu.org; Sun, 11 Sep 2011 01:01:07 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R2cAE-0000jb-5I for 9222@debbugs.gnu.org; Sun, 11 Sep 2011 01:01:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhcGANs+bE5FxK3+/2dsb2JhbABBoVsDhjp5gVIBAQQBViMFCws0EhQYDSSICrQJhm4EoDKEQw X-IronPort-AV: E=Sophos;i="4.68,363,1312171200"; d="scan'208";a="135624052" Original-Received: from 69-196-173-254.dsl.teksavvy.com (HELO ceviche.home) ([69.196.173.254]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 11 Sep 2011 00:56:51 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 2E0E0663AA; Sun, 11 Sep 2011 00:56:51 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sun, 11 Sep 2011 05:30:24 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 11 Sep 2011 01:02:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50849 Archived-At: > 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. :-) That still fits within the definition of "unit type" to me: basically the unit type is the type of everything (the set that contains all possible values), and for that reason the type gives no information about the value and you can't do anything with a value of that type because you don't even know if it's an int or a struct so you can't even begin to choose which kinds of operations might be applicable. Again, in type theory, the void (aka empty) type is encoded typically as "forall t . t" which means something like "this object has type t, no matter what that t is" (kind of like the intersection of all types) whereas the unit type is encoded as "exist t . t" which can be read as "all I can say is that this object does have a type" (kind of like the union of all types). > So calling "void" a "typeless type" makes some sense. At least to me -- > in a C context. It's still not typeless: it's just that the type you get gives you no information about the data. Stefan