From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.devel Subject: Re: Make peg.el a built-in library? Date: Fri, 01 Oct 2021 10:14:31 +0200 Message-ID: <87wnmxgo0o.fsf@gmail.com> References: <875yvtbbn3.fsf@ericabrahamsen.net> <83wno8u3uz.fsf@gnu.org> <87v93s9q4n.fsf@ericabrahamsen.net> <875yvafjr9.fsf@ericabrahamsen.net> <878rzdreem.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38885"; 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: Adam Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 01 10:16:26 2021 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 1mWDiS-0009qt-I6 for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Oct 2021 10:16:24 +0200 Original-Received: from localhost ([::1]:45058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWDiR-0005wc-BG for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Oct 2021 04:16:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWDgk-0004bd-RT for emacs-devel@gnu.org; Fri, 01 Oct 2021 04:14:38 -0400 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:55172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWDgj-0006iA-59 for emacs-devel@gnu.org; Fri, 01 Oct 2021 04:14:38 -0400 Original-Received: by mail-wm1-x32c.google.com with SMTP id s24so6582318wmh.4 for ; Fri, 01 Oct 2021 01:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=VptdAoUjVH4uLiIT9QplXieaiAb70hUrXVlUVfSXzWY=; b=c0nKobsc5DkFETov35/Ohvrd4qi1RkrpnfRQVFqzZN0yiquhaZ/TpaTpLDiCFqd1Dj Hn5p5kr0OtoB/13EY3dvg7Xzl+/cnFol1+LSaWRTLYoRi/LKsy/lUZSI6CCsQLvIZWWD nscuD9maLmEOFCvBB3jXtuf7bPJgJYN2RfZoGgcCHoc8qy1g33kQ4z0evqWWLshcjWJd +T3ugFoxOwxLEPE8fCgp1RV3RpsjsWL11CS2XKJhP5YR/g5fm6OLlqezPQXK9QZ7Hw3z Ct4URDb5KpLivcYZ83KB4Yd5BPuV1+tTEebarAcDf/4hXR6CyQKtIQ3B+dSHsKcJUVh5 CpoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=VptdAoUjVH4uLiIT9QplXieaiAb70hUrXVlUVfSXzWY=; b=ZBSJf3rlbFQSFXQk7lJ3t93kS1gY4645FFDhu3MyrP/0CpL7+4rQZJr9XiulLxfgDO oIWcYro3UEKaEDAl/AhCDTm+YnZVvdB77KKxJQTfUXFINoPKKzKR8cCCMPpYZCjRxhCp FJM/ClS+67c90SyyEPbd06o26hhxI4iyAQSthxZmCI3sXnAl6lDjIog3MruQDkbeswlW mLQMJ270EmIqHg0JviGOJbxAXfggx7g+oTWUGTICGqW+/X6U8HCl5OU3wOnR1TxSvSDj weJAyRC/Nf/XC/9VD9Zc8EteII1NoFfV3T/+ltFhr8TRFJWNRTuR6QcALWlgajKMSgU2 p4xg== X-Gm-Message-State: AOAM531Y5pz4V0It5BQyfju6dO+fOabAj/cmVomNLmlHoJufmKRdwR6W QeJqclOOcrQyX0OOtTRscrhGUUOzGEw= X-Google-Smtp-Source: ABdhPJxpfBaw7T+OtuF6hNBMiU8vdPmJ5LGJdNfhYOGj3ZaJ31pO4MjwyOGunUcvDcH5NiznJFzt/Q== X-Received: by 2002:a1c:7d17:: with SMTP id y23mr3136278wmc.23.1633076073174; Fri, 01 Oct 2021 01:14:33 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::2f72]) by smtp.gmail.com with ESMTPSA id h9sm51892wrw.46.2021.10.01.01.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 01:14:32 -0700 (PDT) In-Reply-To: <878rzdreem.fsf@alphapapa.net> (Adam Porter's message of "Thu, 30 Sep 2021 15:34:25 -0500") Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=arstoffel@gmail.com; helo=mail-wm1-x32c.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:275965 Archived-At: On Thu, 30 Sep 2021 at 15:34, Adam Porter wrote: > In org-ql, the PEX is redefined at load time and/or run time, being > derived from search keywords that are defined by the package and > possibly by the user. So the PEX can't be defined in advance, at > compile time. So having to use `with-peg-rules' means having to use > `eval'. > > That's why it would be nice to have a `peg' function that could be > called with a PEX form, to return a function that could be stored in a > variable and later be called with a string argument, that would parse > the string with the PEG. Sort of like Python's re.compile. FWIW, in my use of PEGs (which is outside of Emacs, in a code analyzer/language server for TeX), such on-the-fly generation of parsers is used all the time as well.