From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Make regexp handling more regular Date: Wed, 2 Dec 2020 12:45:23 -0500 Message-ID: References: <87lfeg60iy.fsf@gnus.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36572"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 02 18:47:56 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kkWEO-0009Rw-Rk for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 18:47:56 +0100 Original-Received: from localhost ([::1]:43034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkWEN-0003Em-TG for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 12:47:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkWC2-0001pm-Cy for emacs-devel@gnu.org; Wed, 02 Dec 2020 12:45:31 -0500 Original-Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]:43930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkWBy-0003MH-0g for emacs-devel@gnu.org; Wed, 02 Dec 2020 12:45:30 -0500 Original-Received: by mail-qv1-xf31.google.com with SMTP id y11so1087256qvu.10 for ; Wed, 02 Dec 2020 09:45:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eWKIj+vO2GDjrgIa/YZjJ9QQvhKRf7h9dgsyx5PUuLg=; b=sgqmgypAu7fFSlYNS8xfHnGIs//h4WClQn9SOcoVSPUcf/dGJDhrPqNqmWZFH8pvIO 5n70ml8E8VcJ74OY/gciPzuhL5iXcr5pIqKK7P2x3CIzl1h45Ys9NUKXr3famHNNpvco 7zWeAL78Ld/JDgCZqcFcEEcBsLZo19/2CNxEOgTLKRyDLOIrTHSHeP6hFWB9/jKxtWz2 X2pkJNFVFDO5PPZJWR0/PB6fTa0MuZXnEYemMIMncTlXr1V03iAO0YyTZuytnNOpB9PR jvljlwUysHWhakh3YyBP3C1Zo7fP14iR/cUfkqQfnsxQCtmoUlG2YF3vmk2psJwpqp1c jeUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eWKIj+vO2GDjrgIa/YZjJ9QQvhKRf7h9dgsyx5PUuLg=; b=ASvxdjGqGlOHlJub+SabUcZcark/YwJXK7Vgg6FDqRDeRlk2lSKvtiOB+VM3bvTcpJ sTZiP+oF2M7ZjOS2Mhc+qEOfWU17z0o2b6hUqo5Xa7+gq5kftbycBRC4msPcOlTM43Z+ UGGTbX5h/nP8Ua/8oUeuLSkGJoTCy+lw4vkUaI51ZQLFNRHNICuNyI9pWX5rZ7K+83Ts eFDxW0rptSIpl7AxIABpdc0y+aqAFyJrYEMHGJmKRMO5XLrknhNMXNE+gvrUsGkzu14K JvWmWA8LFtMQmiKPkaMywAzaOkLHbF7lYb32eTm0ci1sbJR5Lt8orJ9h9RL6HahQa5jz Mung== X-Gm-Message-State: AOAM531KN/9Ouzm0vSGOyzFRh1fqRNn6zVi9iN8S6cphN76raWs8CLyn 9VIlazh3VAuSrlwTY8kN9Zw= X-Google-Smtp-Source: ABdhPJyPSgC1DVVVCRg5PAW7V++Ay3Cceevk5Vpt7VTZAIOJoYgLafVpd/IR7P9jAC39oWq2TL4x6A== X-Received: by 2002:a05:6214:6a2:: with SMTP id s2mr3716331qvz.58.1606931124915; Wed, 02 Dec 2020 09:45:24 -0800 (PST) Original-Received: from ?IPv6:2601:98a:4200:9210:7d9e:df38:6f63:bc31? ([2601:98a:4200:9210:7d9e:df38:6f63:bc31]) by smtp.gmail.com with ESMTPSA id r18sm2388586qtp.89.2020.12.02.09.45.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Dec 2020 09:45:24 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3654.20.0.2.21) Received-SPF: pass client-ip=2607:f8b0:4864:20::f31; envelope-from=casouri@gmail.com; helo=mail-qv1-xf31.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:260185 Archived-At: > On Dec 2, 2020, at 12:17 PM, Stefan Monnier = wrote: >=20 >> Naming is, of course, the most difficult problem here. >=20 > I agree that it might be worth looking at what other languages do. > But we could also just follow "traditional regexp" libraries's > suggestions for naming and go with something like: >=20 > (re-match REGEXP &optional OBJECT START END) > (re-search REGEXP &optional OBJECT START END) >=20 > [ the first being like `looking-at` (i.e. an "anchored" match). ] Whatever the name is, we should make sure they don=E2=80=99t introduce = even more confusion on top of the already confusing names. re-search-forward re-search-backward re-search re-match It=E2=80=99s hard to see what each function does from a glance, IMO. = That=E2=80=99s not counting string regexp functions. >=20 > I'd also suggest to make those functions accept other arguments than > strings for REGEXP, i.e. to make them into generic functions. It would be cool if these functions accept rx forms. Yuan=