Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== matchertext [[toc:]] == Description ''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). To learn more, see Ford's [[https://bford.info/pub/lang/matchertext/|introductory blog post]], and his [[https://arxiv.org/abs/2212.14129|more substantial paper]]. Briefly (quote from the blog post), The pragmatic essence of the matchertext idea is simple. First, we define six particular ASCII characters as matchers: namely the open and close parentheses (), the square brackets [], and the curly braces {}. We call these characters matchers because their traditional, already-ubiquitous purpose is to be used in matching pairs to surround and delimit other text. Now we define matchertext as any plain text string conforming to one additional rule or “syntactic discipline”: namely that matchers must match, throughout any matchertext string, without exception. Nesting is allowed, but must use corresponding matchers. For example, the string ‘([{foo}])’ is valid matchertext, but strings like ‘(foo’, ‘bar}’, or ‘(]’ are not matchertext. The matchertext egg extends the Scheme language to be able to host matchertext in string literals. == Syntax <syntax>#m{MATCHERTEXT}</syntax> This is a string literal, where {{MATCHERTEXT}} is valid matchertext; no need to escape any characters as long as matchers match. == Examples To run the examples, don't forget to <enscript highlight="scheme"> (import matchertext) </enscript> === Simple usage <enscript highlight="scheme"> (string=? "hello, world" #m{hello, world}) ; #t </enscript> <enscript highlight="scheme"> (string=? "#[{(##)}]\\\\(\\)[]#[{\"}]" #m{#[{(##)}]\\(\)[]#[{"}]}) ; #t </enscript> Let's try to print the code of the above example. <enscript highlight="scheme"> (display #m{(string=? "#[{(##)}]\\\\(\\)[]#[{\"}]" #m{#[{(##)}]\\(\)[]#[{"}]}) ; #t}) </enscript> == Author [[/users/hernan-ibarra-mejia|Hernán Ibarra Mejia]] == Repository Development happens in [[https://git.sr.ht/~nagbu/matchertext|SourceHut]]. == Requirements None (but testing requires the [[test|test egg]]). == Version history ; 1.0 : Initial release. == License [[https://git.sr.ht/~nagbu/matchertext/blob/main/COPYING|GPLv3]].
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 6 by 1?