From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: master a6b5985: Avoid duplicated character classes in rx Date: Tue, 3 Dec 2019 16:08:23 +0100 Message-ID: References: <20191203142243.9552.27513@vcs0.savannah.gnu.org> <20191203142246.0615C20A2B@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ae431b0598ce133e" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="101711"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs developers , =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 03 16:10:25 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ic9on-000QF9-49 for ged-emacs-devel@m.gmane.org; Tue, 03 Dec 2019 16:10:25 +0100 Original-Received: from localhost ([::1]:55028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ic9oe-00021v-Gd for ged-emacs-devel@m.gmane.org; Tue, 03 Dec 2019 10:10:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43136) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ic9nm-00020P-Em for emacs-devel@gnu.org; Tue, 03 Dec 2019 10:09:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ic9ne-0005oI-2e for emacs-devel@gnu.org; Tue, 03 Dec 2019 10:09:16 -0500 Original-Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]:46171) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ic9nc-0005Lz-QG for emacs-devel@gnu.org; Tue, 03 Dec 2019 10:09:13 -0500 Original-Received: by mail-qt1-x82f.google.com with SMTP id 38so4007981qtb.13 for ; Tue, 03 Dec 2019 07:09:07 -0800 (PST) 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=pGREC9OuyhV2LZGRWcIwVXtxFaAGBtP7tTDPPJhB1CM=; b=HNKPCjt54Uoy7O8RiAQw2vSwWdh+nI5BdgNw3vZiVMjUHhiKZHei4EZuoOu+2/Spyj 1FiWMpTQ95m6k3Vp4+h06WgGrrhnLJr+uDm9ZB57C8Vi4bDeEAdy+MVj/v1thCAi/XKY MvbZohtJqSU7BaHHQobESIM0RPGomL9/Rrqy5qGRvbL/jTcXZGHXBr9Jlmric2SnStv1 5NRIC19nQ3rt9nFT3SAcjJM01cgGPUyg2u7RCzk3DABWWOpHYLQzyCW8GZAaD4HkudVO z5cKwwMPuwJcEmQSdXsl6xrNAoekU96pEUB62Ek9AIUeSkdYaTXXSDatR+F5uJQg8AL3 Dprg== 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=pGREC9OuyhV2LZGRWcIwVXtxFaAGBtP7tTDPPJhB1CM=; b=SRU7sVRI7cnCebsOZql1OqrjBrE/9Gi5DQVRe55UHXL9EEmEnQYofTC2g8XOfqdJXb 2Wk0d8hK60PLgWnhBGiF4gdbdL6odsCQbpUOTf43VVtD05xZlhpLQJHH04PBguEvCBYt VFQh1dX2eHA9l5yg9dflxH+Ex1U96vPMwlpY1jPEP/z8dvoE5CbsPuDM9u0vQDfQZ8vb NV9nUSOlkztexstqdMxjJVjasY1k++nNZXTwEf+dbblbEP3v4ezqhCN+ZWa+OYzFynix KgoEu7568HB0angJdHOzyWPV5E0SGSGbpDQd+WtT+mfhazmfijFTgLKwmPcdzjJ5ZYfa lVpg== X-Gm-Message-State: APjAAAX2piiv1eH4uQu+FpiqoQ3fQtopW2PC+3iKJ5+z8Ycm/wxjIpcj gxd8rzs7OHXpp6ezwVhHTcrQZpGGAibUOMQyi8s1Ew== X-Google-Smtp-Source: APXvYqyQ4aIwF9QGp/zAe9u45XiTbP/pGpF31vlEk7kuHADiCom0tZ0BvaDFcFh0Ib3c+HFf0b+vMjpBZKRCnbCa8Gg= X-Received: by 2002:aed:20c3:: with SMTP id 61mr5545596qtb.392.1575385744420; Tue, 03 Dec 2019 07:09:04 -0800 (PST) In-Reply-To: <20191203142246.0615C20A2B@vcs0.savannah.gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:243044 Archived-At: --000000000000ae431b0598ce133e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Dec 3, 2019 at 3:23 PM Mattias Engdeg=C3=A5rd wrote: > ((and (symbolp arg) > (let ((class (cdr (assq arg rx--char-classes)))) > - (and class (push class classes))))) > + (and class > + (or (memq class classes) > + (push class classes)))))) This (which is a branch of a `cond') relies in the fact that (push ELEMENT LISTNAME) returns the new LISTNAME. Which isn't really documented. It's sort-of-documented because push's docstring says that it is "morally equivalent to (setf place (cons newelt place)", and the elisp manual says that it is "equivalent to (setq ...)" or that it "does th= e equivalent of (setf ...)". Shouldn't we say it in its docstring? (BTW, push's args are called ELEMENT and LISTNAME in the manual, NEWELT and PLACE in the code. Frankly, I think they should be ELEMENT and PLACE in both cases.) --000000000000ae431b0598ce133e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Dec 3, 2019 at 3:23 PM Ma= ttias Engdeg=C3=A5rd <mattiase@savannah.gnu.org> wrote:

> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0((and (symbolp arg)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((class (cdr (assq arg rx--char-classes))))=
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(and class (push class classes)))))
> + =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(and class
> + =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (or (memq class classes)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (push class = classes))))))

This (which= is a branch of a `cond') relies in the fact that=C2=A0(push ELEMENT LI= STNAME)
returns the new LISTNAME.=

Which isn't really documented. It's sort-of-document= ed because push's docstring
s= ays=C2=A0that it is "mora= lly equivalent to (setf place (cons newelt place)", and the
elisp=C2=A0manual says that it is "equivalent to (setq= ...)" or that it "does the
equivalent=C2=A0of (setf ...)".

Shou= ldn't we say it in its docstring?

(BTW, push's args a= re called ELEMENT and LISTNAME in the manual, NEWELT and PLACE
=
in the code. Frankly, I think they should be = ELEMENT and PLACE in both cases.)

--000000000000ae431b0598ce133e--