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: Re: Predicate for true lists Date: Tue, 09 Apr 2019 21:12:49 +0100 Message-ID: <875zrn9bum.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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="89477"; 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:13:05 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 1hDx7B-000NA5-E5 for ged-emacs-devel@m.gmane.org; Tue, 09 Apr 2019 22:13:05 +0200 Original-Received: from localhost ([127.0.0.1]:48569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDx7A-0002u8-90 for ged-emacs-devel@m.gmane.org; Tue, 09 Apr 2019 16:13:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDx70-0002sm-RF for emacs-devel@gnu.org; Tue, 09 Apr 2019 16:12:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDx6z-0002Ad-Qz for emacs-devel@gnu.org; Tue, 09 Apr 2019 16:12:54 -0400 Original-Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:33846) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDx6z-00029r-9g for emacs-devel@gnu.org; Tue, 09 Apr 2019 16:12:53 -0400 Original-Received: by mail-ed1-x52c.google.com with SMTP id x14so16165887eds.1 for ; Tue, 09 Apr 2019 13:12:53 -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=oXGA72QhZQFcMWzMVOrwh2ZiqwO6OIhsxtbrLTkSCI4=; b=ktGMHEOBbveIR6c1IXIS0qyQNVW54GPF0JJxE0laEwcO7yvLyG1nTtEBM5rDj4jrMR Bbrfg4FblGwcNiYyQSXpepzQ5PKUCClkxyhZeP+8/Wdt/4DyAe9xmZi6nCBU5vX+z2sk tJom2hjbkOG/StehycFnQEybRyV8RiG2Qv9vv8h/uOTTxbcIjhCdFUp2oo+vyTRBtemw SP/fV6DobdGxqfVG+jnWeWKXyZeXfsOybSYaq9Xinr0p8a1DjU4uG/7nTmGfP6VL7L+Z SrW0hfKFdjDQl9Y2eUGZr+OwXqwLn4MbYgolwiC9txhjbwbDxeZzXa7wG7ZA11T4fO/h ssdg== 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=oXGA72QhZQFcMWzMVOrwh2ZiqwO6OIhsxtbrLTkSCI4=; b=k+hk+aOsQeyBFHm1g/oznyqR9ulMvN5N4TUuIVm+QYPWj/UVT13F6q6t/kpqKy38fN LG9AIA0GClnSo/Csp4sesIq+ZEOKbsqfwm+0zD10siRgrUnfFTHQ+yu/CCWs+zjy6Vcv N8+LOWID0i+eu1lxfzf8KZDyT0PRcXUkIfg+4OweqLYaB1GJOgorHtzLcwM+7pKyseiE t1M17Hpiw7p8xXUpV+kC5FjxQ8U8GEl4Ro64cyF0r3dvZ+ZpOWcuep1e2ldpahxG0qQX +QyNdled8vX2jgMjbkEGVDJT2Bmsg04CGzjXA4tkcGJGP1XJcpylqQmdpMWF66arKERY cNfQ== X-Gm-Message-State: APjAAAWwByF/mvXte5RKdWDZGBsv0pb7FBid+hcFIRZm0cqmUNoSP9fO KaDsDX6hiIKhWae01CuY7JAIvbNAU1EXyzz0 X-Google-Smtp-Source: APXvYqxW4LiAXkpWZIDHNCRj/Z3FIbceuUiXgqj6wJvB3sWdN/xqJ7d7ImcXLqgvurz6lb8JD2CoKQ== X-Received: by 2002:a17:906:e241:: with SMTP id gq1mr429673ejb.5.1554840771790; Tue, 09 Apr 2019 13:12:51 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:f786:805d:f4ab:1006]) by smtp.gmail.com with ESMTPSA id ga13sm6184897ejb.9.2019.04.09.13.12.50 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Apr 2019 13:12:50 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Tue, 9 Apr 2019 11:33:59 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::52c 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:235178 Archived-At: --=-=-= Content-Type: text/plain Stefan Monnier writes: >> @@ -1160,8 +1161,8 @@ byte-optimize-set >> make-list make-string make-symbol marker-buffer max member memq min >> minibuffer-selected-window minibuffer-window >> mod multibyte-char-to-unibyte next-window nth nthcdr number-to-string >> - parse-colon-path plist-get plist-member >> - prefix-numeric-value previous-window prin1-to-string propertize >> + parse-colon-path plist-get plist-member prefix-numeric-value >> + previous-window prin1-to-string proper-list-p propertize >> degrees-to-radians >> radians-to-degrees rassq rassoc read-from-string regexp-quote >> region-beginning region-end reverse round > > I think it'd be better to add a `side-effect-free` property rather than > add to this list. We should be moving away from having this list in > byte-opt.el since that info can also be used when byte-opt is not loaded. Should the Elisp manual be updated to reflect this? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Update-side-effect-free-primitive-docs.patch >From fd52e0b08866ecdb93088e539423ee8af6db2fa9 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 9 Apr 2019 20:55:25 +0100 Subject: [PATCH] Update side-effect-free primitive docs * doc/lispref/internals.texi (Writing Emacs Primitives): Describe currently preferred approach to marking built-in functions as side-effect-free. --- doc/lispref/internals.texi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 8ebe47d9ad..826818c380 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -1031,10 +1031,13 @@ Writing Emacs Primitives @file{lisp.h} contains the definitions for some important macros and functions. - If you define a function which is side-effect free, update the code -in @file{byte-opt.el} that binds @code{side-effect-free-fns} and -@code{side-effect-and-error-free-fns} so that the compiler optimizer -knows about it. + If you define a function which is side-effect free, give it a +non-@code{nil} @code{side-effect-free} declaration (@pxref{Declare +Form}) or function property (@pxref{Symbol Plists}) so that the +compiler optimizer knows about it. Alternatively, you can update the +code in @file{byte-opt.el} that binds @code{side-effect-free-fns} and +@code{side-effect-and-error-free-fns}, but this approach is less +modular and no longer encouraged. @node Writing Dynamic Modules @section Writing Dynamically-Loaded Modules -- 2.20.1 --=-=-= Content-Type: text/plain Thanks, -- Basil --=-=-=--