When you tell a story, try to have point! "Dumb and dumber"
This folder contains some interesting examples of the new syntagma language, which is built on top of the Pep & Nom system. Syntagma scripts tend to be much more succinct than their nom equivalent.
json text data
forth code. This includes operator
precedence, right associativity of powers, bracket precedence
and implicit multiplication between symbols or number and symbol.
echo 'aabbaabb' | igma 'A:[a]+;B:[b]+;del; quad=A B A B /$1==$3 and $2==$4/;'
Xml is a context sensitive language. L = {ww} is the copy language, but I
don’t think that syntagma or nom can do this unless there is some delimiter
between the 2 words. For example
word:[:alpha:]+; # a sequence of alphabetic chars is a word
del; # ignore everything else
Lang = word word /$1==$2/ ;
# condition syntax /../ only reduce if first word is the same as second
But this only works if there is a non-alphabetic character between the
2 words, because otherwise, they will be parsed as a single word.
Actually, there is a swap get trick for reversing the input
on the tape, which might just work.
L = {a(n)b(n)}
We can do this in nom using the character counter. eg
[a]+{ @1 := "$char"; reset $char; A:*; }
[b]+{ @1 := "$char"; reset $char; B:*; }
delete; # ignore all other characters.
L= A B /$1==$2/;