[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make peg.el a built-in library?

From: Eric Abrahamsen
Subject: Re: Make peg.el a built-in library?
Date: Fri, 01 Oct 2021 11:40:47 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 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'.
> If the grammar changes radically at run time, based on external/user
> data there's probably no better way than via `eval` or similar (`load`,
> `byte-compile`, you name it).

Can you explain why a function plus some sort of pre-compilation step
won't work? Maybe if I just tried to write the patch I would naturally
see the problem, but theoretically I don't get it...

> But if the changes are sufficiently limited (e.g. have an (or "foo"
> "bar" ....) with a variable set of strings that can match), then we can
> do better.
> E.g. we could have a PEX of the form (re FORM) where FORM can be any
> ELisp expression that returns a regular expression.

I suppose the `call' pex you mentioned up-thread could also ease things
a bit.

I'll hold off on the documentation patch until we know whether any code
will change.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]