From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.bugs
Subject: bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?
Date: Mon, 10 Aug 2020 15:42:48 +0200
Message-ID:
References: <3A9CC2A3-8307-47B2-8D80-795C0AF020E1@acm.org>
<0433A879-C98D-4B1A-B85C-A15DA9289099@acm.org>
<1621669100.2102667.1593639091621@mail.yahoo.com>
<33C2E2C8-16A6-47A9-B3A4-8A5F43648E04@acm.org>
<51FE77F3-CA05-459A-9601-9E1EEBC1E2FE@acm.org>
<1213DD41-01F9-4605-8D32-D750B6CE2B35@acm.org>
<81F989D1-3CC4-450B-89D6-E9C16F766277@acm.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="20571"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= ,
Paul Eggert , Andrea Corallo ,
42147@debbugs.gnu.org
To: Stefan Monnier
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 10 15:49:24 2020
Return-path:
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.92)
(envelope-from )
id 1k58B1-0005FE-5K
for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Aug 2020 15:49:23 +0200
Original-Received: from localhost ([::1]:49300 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1k58B0-0000O1-7a
for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Aug 2020 09:49:22 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51188)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1k585r-0004x1-Af
for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 09:44:03 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43]:51673)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1k585r-00022U-18
for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 09:44:03 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1k585q-0004D3-Vd
for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 09:44:02 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Mon, 10 Aug 2020 13:44:02 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 42147
X-GNU-PR-Package: emacs
Original-Received: via spool by 42147-submit@debbugs.gnu.org id=B42147.159706698716086
(code B ref 42147); Mon, 10 Aug 2020 13:44:02 +0000
Original-Received: (at 42147) by debbugs.gnu.org; 10 Aug 2020 13:43:07 +0000
Original-Received: from localhost ([127.0.0.1]:34982 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1k584x-0004BN-72
for submit@debbugs.gnu.org; Mon, 10 Aug 2020 09:43:07 -0400
Original-Received: from mail-oo1-f66.google.com ([209.85.161.66]:43271)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1k584w-0004Au-3V
for 42147@debbugs.gnu.org; Mon, 10 Aug 2020 09:43:06 -0400
Original-Received: by mail-oo1-f66.google.com with SMTP id z10so1883056ooi.10
for <42147@debbugs.gnu.org>; Mon, 10 Aug 2020 06:43:06 -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
:cc; bh=+Rf0SBEY8pLvAjUaJm0c1wU3QZABpFMNOni6wHgHZgw=;
b=mefA3W1pM3bDbCHOZ2hTvHXT4PhPody0EGcI6B+My1hR18nQfpOBTHH1JieQUxUwK1
mkQugX/5Be55I/JjP3v57cVuz71IdMkXNA56DfxVmNWN7oZa9moP/bllETEAim5NHOwr
NNS6p0yhGID8H18e1FZ/PXBzpndepJiTe3poW+gV6FMm/DsvyiRLJWPhA8P5pXspi7Pb
Rclifn0PpKJ27XEPk4xSI9UMRzHORX4bsDpUWjSnXnRHWzNSfdtX0oHOMKj7Q7PYEr/d
fQuOuPpew+WAuwvQNpABYmAEdppz5MLhG/2uA6QpNSgQQi4pa8Sa9fGnlsLvvClSO845
unNA==
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:cc;
bh=+Rf0SBEY8pLvAjUaJm0c1wU3QZABpFMNOni6wHgHZgw=;
b=jBwZb9di4suyUPhXFxFhIJbUyPyhQyv5+CIHXXj25qmxHK4Wsb721cM8ooWApL8tfp
HZRxxcnTdn2MDlhLmxSQIQrZIY+wzrDmhKx27WzKQbpvUB0rLAfV6OXrlzxAb2IB3p+0
sw1KUzKznll/cX6NPKti+dKXLOwsL4YP/mExkh7CRi/raW5TQCrBgYiow6Wvr1o1EyG6
Cj5hqPm3eZ7vws0rSE9kBNNink8aMMVpMvmtcLpca5SCL38gjDBf30kNJJrSoVCGOW4Z
MgmYEGyRDylc+q5WMtGTIJRmNlFGqg8tPJrdD2AWOoflb7+NsR7X8UHfxX4kgUtvVokN
BADA==
X-Gm-Message-State: AOAM530w6EtRwT/rrgl/Hmvc36Heq15l/Oc+bZXMzILWw3EZhPkMZc1V
kIkGjTqMQ9vIAzRMwc46InM4jermbdRYHetYAAo=
X-Google-Smtp-Source: ABdhPJzGS7tQyvSG6lz2ISbdk/83ALLvPkaIyvElAiN0d7Psx9zQvk7pWn1ziP3RfxGiRRnc3zfiLGiHm+w8oaOySLA=
X-Received: by 2002:a4a:9c0f:: with SMTP id y15mr893183ooj.81.1597066980389;
Mon, 10 Aug 2020 06:43:00 -0700 (PDT)
In-Reply-To:
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
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-mx.org@gnu.org
Original-Sender: "bug-gnu-emacs"
Xref: news.gmane.io gmane.emacs.bugs:184515
Archived-At:
Am Mi., 29. Juli 2020 um 22:39 Uhr schrieb Stefan Monnier
:
>
> > Regarding package-get-version: perhaps we should drop the 'pure' property
> > and just let callers wrap it in eval-when-compile?
>
> I'd rather not: the benefit is too subtle, I'd expect most users won't
> know/bother to use `eval-when-compile` around it even though I'd expect
> a vast majority of the uses can benefit from compile-time evaluation.
> In contrast the cases where the impurity will get in the way
> should be rare.
Arguments relating to probabilities ("most users", "vast majority",
"rare") don't really apply here, as the discussion is about
correctness. A pure function must be pure 100% of the time, no
exceptions allowed. `package-get-version' can't possibly be pure: it
doesn't take any argument, so if it were pure, it would have to return
a constant in the mathematical sense.