Hi Noah, Noah Lavine <noah.b.lav...@gmail.com> skribis:
> It looks to me like the last thing needed before the peg branch can be > used is to change some of the S-expression representations of the > components. Here are the five that I think need changing, taken from > the manual, with suggested replacements. This looks like interesting stuff! The syntactic changes you propose all make sense to me, FWIW. [...] > There's something I'm still a little unsure about, though. It's > possible to get deeply nested S-expressions, like '(+ (and (* "a") > "b")). Since +, * and ? only ever take one argument, it is possible to > shorten such a list by letting people merge those elements into the > next item, like this: '(+ and (* "a") "b"). I would rather keep it simple and avoid shortcuts that may end up being confusing. A more general question about PEG: how do you bind a variable to the result of a pattern? For instance, if you want the result of (* "a") to be bound to variable X–just like (match '(1 2 3) ((a _ ...) a)) binds A to 1. Thanks, Ludo’.