Re: new egg: matchertext
John Cowan via Chicken-users <[email protected]> Sat, 27 Jun 2026 03:36:10 -0400
| Newsgroups | gmane.lisp.scheme.chicken |
|---|---|
| Message-ID | <CAD2gp_QtTroLvU0nPEnrEQstmsJKH211gs_QgnL2cMbWpm8DVw@mail.gmail.com> |
--0000000000004185af06553748aa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Note that this design does not allow arbitrary syntaxes for either the embedding or the embedded languages: only languages with paired parentheses, brackets, and braces can participate. Thus for example shell syntax, which uses unpaired ")" in case statements, will not work. As an alternative, C++11 raw string syntax has no such limitations: it uses customized delimiters that can enclose completely arbitrary strings subject to the rule that the delimiter can't appear in the delimited string, so it is always possible to choose a delimiter given a string to be delimited. The C++ variant of this syntax is R(X)str(X), where str is the string to be delimited and X is any sequence of characters (excluding right paren) such that (X) does not appear in str. A Schemish variant of this is #"X"str"X", defined in SRFI 267, where X excludes quote. Note that X can be empty if "" does not appear in str. On Fri, Jun 26, 2026, 4:19=E2=80=AFPM Hern=C3=A1n Ibarra Mejia via Chicken-= users < [email protected]> wrote: > matchertext is a "syntactic discipline" that allows for cross-language > embedding > of source code. It was invented by Bryan Ford (who also invented parsing > expression grammars and packrat parsing). > > The matchertext egg extends the Scheme language to be able to host > matchertext > in string literals. > > - release-info: > https://git.sr.ht/~nagbu/matchertext/blob/main/matchertext.release-info > - docs: https://wiki.call-cc.org/eggref/5/matchertext > > Thanks for adding it to the coop. > > Cheers, > Hern=C3=A1n > > --0000000000004185af06553748aa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">Note that this design does not allow arbitrary syntaxes f= or either the embedding or the embedded languages: only languages with pair= ed parentheses, brackets, and braces can participate. Thus for example shel= l syntax, which uses unpaired ")" in case statements, will not wo= rk.<div dir=3D"auto"><br></div><div dir=3D"auto">As an alternative, C++11 r= aw string syntax has no such limitations: it uses customized delimiters tha= t can enclose completely arbitrary strings subject to the rule that the del= imiter can't appear in the delimited string, so it is always possible t= o choose a delimiter given a string to be delimited.</div><div dir=3D"auto"= ><br></div><div dir=3D"auto">The C++ variant of this syntax is R(X)str(X), = where str is the string to be delimited and X is any sequence of characters= (excluding right paren) such that (X) does not appear in str. A Schemish v= ariant of this is #"X"str"X", defined in SRFI 267, wher= e X excludes quote. Note that X can be empty if "" does not appea= r in str.</div></div><br><div class=3D"gmail_quote gmail_quote_container"><= div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jun 26, 2026, 4:19=E2=80=AFPM = Hern=C3=A1n Ibarra Mejia via Chicken-users <<a href=3D"mailto:chicken-us= [email protected]">[email protected]</a>> wrote:<br></div><blockquot= e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol= id;padding-left:1ex">matchertext is a "syntactic discipline" that= allows for cross-language embedding<br> of source code. It was invented by Bryan Ford (who also invented parsing<br= > expression grammars and packrat parsing).<br> <br> The matchertext egg extends the Scheme language to be able to host matchert= ext<br> in string literals.<br> <br> - release-info: <a href=3D"https://git.sr.ht/~nagbu/matchertext/blob/main/m= atchertext.release-info" rel=3D"noreferrer noreferrer" target=3D"_blank">ht= tps://git.sr.ht/~nagbu/matchertext/blob/main/matchertext.release-info</a><b= r> - docs: <a href=3D"https://wiki.call-cc.org/eggref/5/matchertext" rel=3D"no= referrer noreferrer" target=3D"_blank">https://wiki.call-cc.org/eggref/5/ma= tchertext</a><br> <br> Thanks for adding it to the coop.<br> <br> Cheers,<br> Hern=C3=A1n<br> <br> </blockquote></div> --0000000000004185af06553748aa--