From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: Should undefined behavior be encouraged in Emacs? Date: Mon, 03 Oct 2011 16:29:12 +0900 Message-ID: <87ehyu1qk7.fsf@uwakimon.sk.tsukuba.ac.jp> References: <4E89124D.8070405@cs.ucla.edu> <4E895885.5060201@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1317626975 24132 80.91.229.12 (3 Oct 2011 07:29:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 3 Oct 2011 07:29:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas =?iso-8859-1?Q?R=F6hler?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 03 09:29:31 2011 Return-path: Envelope-to: ged-emacs-devel@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 1RAcxu-0007QI-Rq for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2011 09:29:30 +0200 Original-Received: from localhost ([::1]:53293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAcxu-0004Ke-Fq for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2011 03:29:30 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAcxs-0004KX-CF for emacs-devel@gnu.org; Mon, 03 Oct 2011 03:29:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAcxq-0001CH-UD for emacs-devel@gnu.org; Mon, 03 Oct 2011 03:29:28 -0400 Original-Received: from mgmt2.sk.tsukuba.ac.jp ([130.158.97.224]:53981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAcxq-0001Az-G4 for emacs-devel@gnu.org; Mon, 03 Oct 2011 03:29:26 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mgmt2.sk.tsukuba.ac.jp (Postfix) with ESMTP id 3F411970667; Mon, 3 Oct 2011 16:29:13 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 2E5301A26E2; Mon, 3 Oct 2011 16:29:13 +0900 (JST) In-Reply-To: <4E895885.5060201@online.de> X-Mailer: VM 8.2.0a1 under 21.5 (beta31) "ginger" 6c76f5b7e2e3 XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 130.158.97.224 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:144534 Archived-At: Andreas R=F6hler writes: > Am 03.10.2011 05:11, schrieb Stefan Monnier: > >> The argument given for undefined behavior is that it simplifies > >> maintenance of Emacs internals. > > > > I like to keep some corner of the behavior undefined, when I think > > that user code that depends on such details is undesirable (e.g. return > > values of primitives which are only called for side-effects). > my bet: undefined behavior sources bugs, makes maintenance difficult. >=20 > Design at the user level certainly deserves a separate approach. It's up= =20 > to implement convenient error-handling than rather than undefined behavi= or. I don't know about convenient error-*handling*, but if Stefan wants to prevent people from using the value of primitives called only for side-effects, he can always provide "convenient error generation" by having such primitives return Qunbound (or whatever it's called in Emacs sources: the special uninterned symbol placed in the value slot of an uninitialized symbol). ;-) ** 100