From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Unused value of error-free function warning (was: Predicate for true lists) Date: Tue, 09 Apr 2019 21:08:38 +0100 Message-ID: <87ftqr9c1l.fsf_-_@tcd.ie> References: <87fu3vdjjk.fsf@tcd.ie> <87bmcqhhsf.fsf@tcd.ie> <87in6xgtpb.fsf@tcd.ie> <2af892df-26cb-60b2-4fd8-067fcb3d32e9@cs.ucla.edu> <87r2kh9uwx.fsf@tcd.ie> <83h8lcnbxb.fsf@gnu.org> <87sh4s9poo.fsf@tcd.ie> <87k1q49p0i.fsf@tcd.ie> <87efgbbq2p.fsf@tcd.ie> <87a7gz8hp2.fsf@tcd.ie> <87mukzb173.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="80357"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 09 22:10:40 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDx4p-000Ko8-Dm for ged-emacs-devel@m.gmane.org; Tue, 09 Apr 2019 22:10:39 +0200 Original-Received: from localhost ([127.0.0.1]:48510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDx4o-00019r-9d for ged-emacs-devel@m.gmane.org; Tue, 09 Apr 2019 16:10:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDx32-0000bB-Vs for emacs-devel@gnu.org; Tue, 09 Apr 2019 16:08:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDx31-0007Ni-VZ for emacs-devel@gnu.org; Tue, 09 Apr 2019 16:08:49 -0400 Original-Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:44476) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDx31-0007Lr-Hl for emacs-devel@gnu.org; Tue, 09 Apr 2019 16:08:47 -0400 Original-Received: by mail-ed1-x534.google.com with SMTP id d11so16112062edp.11 for ; Tue, 09 Apr 2019 13:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ZDoFfojYpdqDh9bjzVllZ+5PCcUjkwowOGsBeFQfyFs=; b=EXBYBKk4CiF42nhsdZGrENY5+FEFXri7gRX+OlWtiASL02T2ZXFwi+dv0kNLr2Vwn7 w6yuI2+htMJAGtTwshSTbEwBvn5I8C+SdK8k1jonFarrzdJk70N60TonLciQpbRNdpf6 KLE7cDMz1OBBC4YAu5oG01gV/LipnXjgWasup2H8AL6DJMjPSW6uGR4Z42VMsZsZr256 P97ZIWFZhB0iAlwSC9yEN2ZKLV6om2AZLg3/oyu16t4QdwEo19s9NwQqURU//mJYO8GJ u2O4/xSOgkeU/Q6EIEzLD9/ILKrmxBqX0RswhveAUK4xV9hmysWvKSfTqhtaIXi05+Kw Y7Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ZDoFfojYpdqDh9bjzVllZ+5PCcUjkwowOGsBeFQfyFs=; b=Hkq3u9CFMEBIq2a/ot71byRXiV4V85cDPAAT3KvTTYm61ltOHsmPfVNrboSheRDiVA 6+C1L8v6F9Z4ROoPu3ZQHYivKBwfHydp792ByiuzVz+L0kNwqQJVKBS4EyYzjRzzQnR8 FUyggWPXLkMzx0PmtR51pROFrZ6arRsDr95QpeIkpvp5/HyJ3QUX6bLWLj+O6Pmj+AfL G9q9Z8vzVUBPsHeRlMmBVB0HH8pJ/QhfhtAY/yb/HEoXX/5vXUh186ERXEWUEtbT8Cj/ JF8e25h2zfvP5P9x5dwEqm72AO/smvzNYXM/zCuBjYz91qjeWExJ6iz29zBlmjWUX5AC pgBQ== X-Gm-Message-State: APjAAAVllMe2Js14LJLPW0H5YjyQT0tEGwqqYAET7M8jA1gSWD3w3bNC VFxudCDvKHVe7fBKzta1jEL1cw== X-Google-Smtp-Source: APXvYqzhY9qIUi6WUaU1o6MXIEBwCYADhN3DgsytxZsOZAz4IXrJF+3wcbbompnVmy/uw8Dl3ERxUA== X-Received: by 2002:a50:a4c3:: with SMTP id x3mr24846809edb.190.1554840524328; Tue, 09 Apr 2019 13:08:44 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:f786:805d:f4ab:1006]) by smtp.gmail.com with ESMTPSA id t14sm537522ejq.76.2019.04.09.13.08.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Apr 2019 13:08:43 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Tue, 9 Apr 2019 12:32:16 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::534 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:235177 Archived-At: Stefan Monnier writes: >> --- a/src/fns.c >> +++ b/src/fns.c >> @@ -5326,6 +5326,12 @@ syms_of_fns (void) >> DEFSYM (Qcursor_in_echo_area, "cursor-in-echo-area"); >> DEFSYM (Qwidget_type, "widget-type"); >> >> + DEFSYM (Qpure, "pure"); >> + DEFSYM (Qside_effect_free, "side-effect-free"); >> + DEFSYM (Qproper_list_p, "proper-list-p"); >> + Fput (Qproper_list_p, Qpure, Qt); >> + Fput (Qproper_list_p, Qside_effect_free, Qt); > > I think you can set the side-effect-free property to `error-free`, which > is stronger. If error-free functions are even more restricted than other side-effect-free ones, then why does the former class not raise a warning in byte-optimize-form-code-walker when their return value remains unused? For example, compare: (byte-compile '(progn (list) t)) ;; => t with: (byte-compile '(progn (+) t)) ;; => t (Warning: value returned from (+) is unused) I understand that dead error-free expressions are just deleted, but shouldn't the user be warned of this? Or is that what "error-free" stands for? -- Basil