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: Tue, 25 Jul 2017 10:16:33 -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 1500992514 21247 195.159.176.226 (25 Jul 2017 14:21:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Jul 2017 14:21:54 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 25 16:21:45 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 1da0iV-0004w6-Ri for ged-emacs-devel@m.gmane.org; Tue, 25 Jul 2017 16:21:43 +0200 Original-Received: from localhost ([::1]:32841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da0iZ-0001Ov-Mn for ged-emacs-devel@m.gmane.org; Tue, 25 Jul 2017 10:21:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da0h6-0000yd-54 for emacs-devel@gnu.org; Tue, 25 Jul 2017 10:20:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da0h2-0006ho-Vj for emacs-devel@gnu.org; Tue, 25 Jul 2017 10:20:16 -0400 Original-Received: from [195.159.176.226] (port=56998 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1da0h2-0006gc-Ob for emacs-devel@gnu.org; Tue, 25 Jul 2017 10:20:12 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1da0gt-0008NS-Dd for emacs-devel@gnu.org; Tue, 25 Jul 2017 16:20:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 15 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:m9G3f3h18IpdwHYAfAcwEdrynmI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:217023 Archived-At: >> I was curious about what other functions might be pure and could be >> added to this list. While I seem to have guessed correctly on some, >> I am perplexed why adding string-to-char breaks things: > Strings are not immutable. I agree that string-to-char is not a pure function, according to my understanding of the meaning of "pure" in such a context. Yet, I can't see why it leads to that error (AFAIK the purity is only used in order to either get rid of the code when the result is not used (which is OK for string-to-char), or to pre-evaluate the result when all args are constants, which should be OK unless the function is called with an immediate string that is later modified, which seems rather unlikely). Stefan