From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Make regexp handling more regular Date: Wed, 2 Dec 2020 05:12:25 -0600 Message-ID: References: <87lfeg60iy.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3536"; mail-complaints-to="usenet@ciao.gmane.io" To: Lars Ingebrigtsen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 02 12:15: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 1kkQ72-0000ph-NW for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 12:15:56 +0100 Original-Received: from localhost ([::1]:49366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkQ71-0006qP-Ol for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 06:15:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkQ3h-0002vT-TR for emacs-devel@gnu.org; Wed, 02 Dec 2020 06:12:31 -0500 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:47087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkQ3f-0006K0-Tx for emacs-devel@gnu.org; Wed, 02 Dec 2020 06:12:29 -0500 Original-Received: by mail-pl1-x636.google.com with SMTP id v3so919596plz.13 for ; Wed, 02 Dec 2020 03:12:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to; bh=d/g1WXm1rKzBauMEOX4TwqBF1d3SAoZyz7N8gpN3snA=; b=BtMqVbE31A54ui1IzLYz1YfvWp/sOjrmsxM0+h+tvZ0xODMd1ezghp1yJfebL7yrzX nDN9ayLipYuf3RAQ1X+CRdu2igGAYpsafmJhFZArNnZTdmaEzgtklKFzakZ6UfvaH5jG QPtmrgJua8ENMh+xjCW6h3ivdSeuk+1HRy1RuwIQyD4+qHWhj9Tyakgc8KNREJ+l/at4 uH53iIl4CvfI+3v8y8gZ75RXXEn2icNBVX4HyYTkE+xbl2NSBOPNsDoqPHTvlK74KESC htGwmxaVaaseWKD4JaS1SKozqMNzpddovkPiTod4hNrPpwUon41Dvsb3Cxcb07rTgwCK 2Maw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to; bh=d/g1WXm1rKzBauMEOX4TwqBF1d3SAoZyz7N8gpN3snA=; b=taKr0SZhH8EaLuPPs1IkMuh0/k/FbbAowWe7OyqOXasy9yxR4kQIe9UrbmBsXL+JnI XWNrSssy4sT80kioIQ8WZovEWxElan+qoHcInctMAP7bFf5Rmm256R7R2ihTu3idhU8Y RXioFCTmJo/+EOC+nqLBK30icV/z7xVNLd+tWPOODLXbCMNDMVlcGcVyO2JTGl5iJfi/ t4gjEM+Cp7s+9shfVYNTKqZOij88Gbj6H1w/MlTtPYiD3bgj9EiREJJAk9G0rV2fbSYj C9dlCfIOtBKtbyWyOlfLazfW65vuuOBKuehyDVvXrO2nLQcUTYkbjyPSVwr5U7IczfQY +eEQ== X-Gm-Message-State: AOAM532E450q8qZo9o12lvRjpIbYhz4UtmUf66G/EB1+2ZIQxEGvNt8Z YrR0ogubFEN9oW5lUac0YLTUc//WkKjlOnspy4VRSuzn X-Google-Smtp-Source: ABdhPJxcMdAqEh8TO95OuSGH0khhEbE5/lESb/5ZMjqwnkaIx+opLmD5hYRbBSHv1L2mP7K7sKuUmxa+qbWkfDgCeJU= X-Received: by 2002:a17:90a:fb43:: with SMTP id iq3mr1952668pjb.175.1606907545844; Wed, 02 Dec 2020 03:12:25 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 2 Dec 2020 05:12:25 -0600 In-Reply-To: <87lfeg60iy.fsf@gnus.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=stefankangas@gmail.com; helo=mail-pl1-x636.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:260176 Archived-At: Lars Ingebrigtsen writes: > So my idle shower thought for the day is: Is there any reasonable path > forward that the Emacs Lisp language could take here? > > Well, we obviously can't alter functions like `string-match' and > `re-search-forward' -- they have well-defined semantics, and we can't > make them return a match object. But we could make a new set of > functions that are more, er, functional. I like the idea of adding an entirely new built-in API based on the current state of the art. I would begin such a project by looking into what other Lisps are doing, such as CL, Clojure, Guile and Racket. Why shouldn't Emacs Lisp be best-in-class? As for naming, how about just using a short prefix such as "re-"? AFAICT, we currently have only five functions using that prefix. Tangentially, I have always been wondering if its feasible to add a new regular expression type to `read' where you don't have to incessantly double quote all special characters. (One could take inspiration from Python, for example, which adds an "r" character to strings to turn them into regexps: r"regexp".)