Re: new egg: matchertext
HernĂ¡n Ibarra Mejia via Chicken-users <[email protected]> Sat, 27 Jun 2026 10:23:13 +0100
| Newsgroups | gmane.lisp.scheme.chicken |
|---|---|
| Message-ID | <[email protected]> |
Hello, On Sat Jun 27, 2026 at 8:36 AM BST, John Cowan wrote: > 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. Certainly, but while code is not always matchertext, a lot of it is. > As an alternative, C++11 raw string syntax has no such limitations: it us= es > customized delimiters that can enclose completely arbitrary strings subje= ct > to the rule that the delimiter can't appear in the delimited string, so i= t > 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) suc= h > 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. To add another alternative, check out my other egg `raw`, which supports a custom prefix character, substitution of expressions, smart indentation, am= ong other things. Its syntax is based on that of SRFI-109. For more general string formatting, I am currently working on implementing SRFI-165 and SRFI-166 in CHICKEN. Cheers, Hern=C3=A1n