From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Make regexp handling more regular Date: Wed, 02 Dec 2020 12:17:12 -0500 Message-ID: References: <87lfeg60iy.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15709"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 02 18:18:27 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 1kkVlq-0003xp-TA for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 18:18:26 +0100 Original-Received: from localhost ([::1]:33820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkVlp-0002kQ-VX for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 12:18:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkVkm-0002E7-0t for emacs-devel@gnu.org; Wed, 02 Dec 2020 12:17:20 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9269) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkVkj-0006om-GJ for emacs-devel@gnu.org; Wed, 02 Dec 2020 12:17:18 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id EE40980E46; Wed, 2 Dec 2020 12:17:15 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7243F801E9; Wed, 2 Dec 2020 12:17:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1606929433; bh=UBcWu/nqoVHT31BL2hqdQFyKcaMqa4JakUD8Lk2/mDY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ijYTdleaCqas/WYwQRGe7pJOj6tzVoIjysVkWyTgtontJdgAqrEGdD57jaiGChueT 5/BmyUcC/mR5KsRxNS8gNOYl80uvf/TqAMKVyvYQ7lvVZcYXPBZece+g4p8sMCxmLb t3/IDI7EkK3kA5C5enw7p2t0jP42m6cz4b8yKkz7UXR+E4nmw15P6aSzSncpr3GoPe upt5dqxHvOJxFO/1SnkV3pYVE2iJC38re78ieuluHbmP54k2M5U7i9v5TYBMYg1wWE SV0AqO/W5dzWp7Q0RC+WM4nlYg75NQqIGurTmBXv8g5PkagCUlCOn3VEAlVXH0R5q1 Wgw8JAglZojBQ== Original-Received: from alfajor (69-165-136-52.dsl.teksavvy.com [69.165.136.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4545E120264; Wed, 2 Dec 2020 12:17:13 -0500 (EST) In-Reply-To: <87lfeg60iy.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 02 Dec 2020 10:05:25 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:260183 Archived-At: > Naming is, of course, the most difficult problem here. 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: (re-match REGEXP &optional OBJECT START END) (re-search REGEXP &optional OBJECT START END) [ the first being like `looking-at` (i.e. an "anchored" match). ] I'd also suggest to make those functions accept other arguments than strings for REGEXP, i.e. to make them into generic functions. Stefan