From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: pure-fns in byte-opt.el Date: Mon, 25 Sep 2017 20:25:25 -0400 Message-ID: References: <20170725020650.GA12601@holos.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1506385575 14390 195.159.176.226 (26 Sep 2017 00:26:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Sep 2017 00:26:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 26 02:26:11 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwdhR-0003Hs-St for ged-emacs-devel@m.gmane.org; Tue, 26 Sep 2017 02:26:10 +0200 Original-Received: from localhost ([::1]:44997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwdhZ-0001xy-1G for ged-emacs-devel@m.gmane.org; Mon, 25 Sep 2017 20:26:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwdgr-0001xh-M9 for emacs-devel@gnu.org; Mon, 25 Sep 2017 20:25:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwdgq-00040K-S5 for emacs-devel@gnu.org; Mon, 25 Sep 2017 20:25:33 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:40331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwdgm-0003qW-2Z; Mon, 25 Sep 2017 20:25:28 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v8Q0PP8u027815; Mon, 25 Sep 2017 20:25:25 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 2BAC966271; Mon, 25 Sep 2017 20:25:25 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Mon, 25 Sep 2017 18:06:07 -0400") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6123=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6123> : inlines <6090> : streams <1764610> : uri <2506560> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:218792 Archived-At: >> pure: like side-effect-free but additionally, the function always >> returns the same value when called with the same arguments, so the >> compiler can precompute the call if it knows the arguments. > It may be necessary to define "same" more precisely. > Does it mean equal? eq? Both/neither? The compiler doesn't test it in any way (it only has the known arguments, and no "others" to compare it with). I guess `equal` is closer to what typically happens, but I don't think this precision is of any use. The only *real* definition is the last part: "the compiler can precompute the call if it knows the arguments" (where "can" should probably be replaced with "may", actually). Stefan