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 18:27:38 +0100 Message-ID: <874l77ay2d.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> <8ba914d2c3c78dbcd6e1ff559b53808b.squirrel@dancol.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="182365"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: "Daniel Colascione" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 09 19:27:59 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 1hDuXJ-000l7U-9K for ged-emacs-devel@m.gmane.org; Tue, 09 Apr 2019 19:27:53 +0200 Original-Received: from localhost ([127.0.0.1]:46850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDuXI-0000kX-Al for ged-emacs-devel@m.gmane.org; Tue, 09 Apr 2019 13:27:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDuX8-0000jD-Fa for emacs-devel@gnu.org; Tue, 09 Apr 2019 13:27:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDuX7-00049j-DX for emacs-devel@gnu.org; Tue, 09 Apr 2019 13:27:42 -0400 Original-Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:33461) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDuX7-00049A-4u for emacs-devel@gnu.org; Tue, 09 Apr 2019 13:27:41 -0400 Original-Received: by mail-ed1-x535.google.com with SMTP id b8so2193786edq.0 for ; Tue, 09 Apr 2019 10:27:40 -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=GRt8aqKjGYU7xERCt9GlN6znLAVrsXs/mMw48uUQ7O4=; b=hxNS6PQV33GXjuslcxNHLJ0I74UESM2857uISTFj/X7zxvVlw9h5Z3xh1Fe6rkJH6w XFuDiRtDh3Raj1l9ba8wtVPPHwW4T6oJ86MK7i3dj04P2AXO+5hUJMKlJt2XfzeJlwcr Tg+T8f9BPwhPP6xaKFpWGaZ/rK/0u1JL1t+qHnNUZnJULLEewMC+nv+y8ShKeIvdgQZ1 oP35T5wLks5zvFwG4p5d1hs3NQQP7XWhz8/9Y2Xz3JYJGrxR0CFMVI27Aqz9GbGmHXA1 9Th6y1fpWsZ4wnlYFq/O49VoGNawrU1DCiAirvbKxZ3cokATNFkdShjodh0rRg0JK7Uv aZ3g== 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=GRt8aqKjGYU7xERCt9GlN6znLAVrsXs/mMw48uUQ7O4=; b=rNzTYTKz2LQU8fBMWro9N9ae4/E8TTIHUCrGeZBgtnuIQ4KApaopRPb530OBF+6ajp jLB3InRJpTCeg7Bc/XAs81pACTTq5l/76cTyAe+75UMmU+9xbJjjSK8AHSzXy94n0FLw KCKG9aIJcBrHPeA7SCEPCMLsY0UVxcB25wP5bVF7gfbE7DeUaTopP135q4bqjgqQ0/P5 BPzqm3oihcO/mPRHWo5pvl81yCmf/eeGySuakOEEZMB4N9OoKhoFnDPhf6YjIRzxgnYC nvwWffuhCgNBAvko/j1SuU+sDF1FVRgl4Swbip3lK/IdFf2XRGyZwh4Jajl/0631zYrN icXw== X-Gm-Message-State: APjAAAW/Pe5Azd029C0ZEGWN4MCk72+ojtFyRlZGsVYPg0dvhgeUU/ZC 6kvNOWI08X1Ds8XOLfegszcVFg== X-Google-Smtp-Source: APXvYqxm9MISnbKSowQGy5PupUOWylfnndUq3IBATu/jBlScL787ubBGpofsNMwJAd7/4ArSgI3o0A== X-Received: by 2002:a50:fa4b:: with SMTP id c11mr6021090edq.239.1554830859976; Tue, 09 Apr 2019 10:27:39 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:f786:805d:f4ab:1006]) by smtp.gmail.com with ESMTPSA id n3sm537121eja.70.2019.04.09.10.27.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Apr 2019 10:27:39 -0700 (PDT) In-Reply-To: <8ba914d2c3c78dbcd6e1ff559b53808b.squirrel@dancol.org> (Daniel Colascione's message of "Tue, 9 Apr 2019 09:54:48 -0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::535 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:235173 Archived-At: "Daniel Colascione" 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. Other than that, it looks OK (tho I personally find doing it >> in C to be too painful, so I prefer moving this kind of code to subr.el). >> >>> I also attach a second patch which moves the proper-list-p tests to the >>> correct file following the function's rewriting in C. WDYT? > > I'd also prefer to put new functionality in lisp when possible. We're > going to get a JIT one day, and when we do, lisp functionality may very > well end up *faster* than C stuff anyway due to specialization and > tracing. In the meantime, lisp performance is adequate, and if we can keep > the C core small, we should. The function proper-list-p was originally added to subr.el. My understanding is Paul moved it to fns.c not for a speedup, but so that other C code could use it[1]. [1: 200195e824]: Move proper-list-p to C 2018-07-24 16:08:09 -0700 https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=200195e824befa112459c0afbac7c94aea739573 -- Basil