From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: pure-fns in byte-opt.el Date: Tue, 25 Jul 2017 20:57:58 +0000 Message-ID: References: <20170725020650.GA12601@holos.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1140fababb7c2905552a9639" X-Trace: blaine.gmane.org 1501016334 3571 195.159.176.226 (25 Jul 2017 20:58:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Jul 2017 20:58:54 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 25 22:58:51 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 1da6uf-0000HJ-VL for ged-emacs-devel@m.gmane.org; Tue, 25 Jul 2017 22:58:42 +0200 Original-Received: from localhost ([::1]:34588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da6ul-00068z-NZ for ged-emacs-devel@m.gmane.org; Tue, 25 Jul 2017 16:58:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da6uC-00068h-ON for emacs-devel@gnu.org; Tue, 25 Jul 2017 16:58:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da6uB-0004rD-RE for emacs-devel@gnu.org; Tue, 25 Jul 2017 16:58:12 -0400 Original-Received: from mail-oi0-x232.google.com ([2607:f8b0:4003:c06::232]:36544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1da6uB-0004qg-MC for emacs-devel@gnu.org; Tue, 25 Jul 2017 16:58:11 -0400 Original-Received: by mail-oi0-x232.google.com with SMTP id g131so64038983oic.3 for ; Tue, 25 Jul 2017 13:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Xn0QiCzHNbNERVOwp5JdrRNA0/4FyijmmHNwIK2LBd0=; b=IbBB/kmlZOHT+Tg10FP8bD2BLxbIQ3sjVPr8sffeeyz4tUYN9/vU1F5OQt4pWv7Tub MWI70Um6iHR4JWDjvNc2y/lzOLuNW4XBXUFx4Hai4gEksDclbeUxXRUj2sv9QBT8FwCX ptqRjn2Gb9Pk+ch8BT/XAfiDHlk/xA3d4tBH3jW1IA3qMCfvJhI/k4bYEQVjNpHmY/Wf P4oPePF04etBpEscE0oukIBrEHedykXaMXCxLTle6f/mGCOCaZOhi8HEidMSy6RMSh3g pXUy9y3w/xr1tnAFbSW9MGRbTCt5ToPB9uivC72enQvrH3KvyI7PEfMOMOnryvLVfdF0 ASYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Xn0QiCzHNbNERVOwp5JdrRNA0/4FyijmmHNwIK2LBd0=; b=Ojob4rTc6ZsxehsON5pmGsYJI6WHPVeQmpfn5z3hIikVll+fAm9V/HRqa8paRZcj6G /W36meyReBunhGDC9Y/WNaT/abK+v9sdLtswFvewNMiF5GjCXeEfyhdUebhF4lj8GxGm PBVUQuna4AITl7KTM4PNUf79bPdrLv1wt65AzZafHXbO46VzBcLLarsNeNOeDyJ3ZMHP QVmY0s99FWNEDJPvIoyQmKyyjBhQSBqeoaaqiyTXEmnWmAZpqTdGyX0cHbWiHH4m9lsw 8fA5/FVbtn/G5DGbrm3+iZa8vRr9ITJ2Wqb+5PLmMFv3K5tgX1/pbgfl7xvhGkX3z+6w 8BhA== X-Gm-Message-State: AIVw1121Wouq1G2itrsN92hIvBw+EHqCs4Kr2z1hgh8JzJp7yVxywAes lewSrWd73PMpZ0g0kTS68Q/8brzTHA== X-Received: by 10.202.104.38 with SMTP id d38mr8883322oic.53.1501016289408; Tue, 25 Jul 2017 13:58:09 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::232 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:217026 Archived-At: --001a1140fababb7c2905552a9639 Content-Type: text/plain; charset="UTF-8" Stefan Monnier schrieb am Di., 25. Juli 2017 um 16:21 Uhr: > >> 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. Why? Its return value clearly only depends on its argument, and it doesn't change any global state. It's the poster child of a pure function! --001a1140fababb7c2905552a9639 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Stefan= Monnier <monnier@iro.umontr= eal.ca> schrieb am Di., 25. Juli 2017 um 16:21=C2=A0Uhr:
>> I was curious about what other functi= ons might be pure and could be
>> added to this list.=C2=A0 While I seem to have guessed correctly o= n 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.

Why? Its return value clearly only depends on its = argument, and it doesn't change any global state. It's the poster c= hild of a pure function!
--001a1140fababb7c2905552a9639--