Div
Div, named after divided and the divine comedy, is an Esoteric Programming Language created by User:Yayimhere, based mainly on string prefixes, and An Odd Rewriting System, specifically in the concept of "Definitions".
Syntax
A program is in the form:
[Datastring]<Ab:Def1><Hc:Def2>...
the data string is stored within the square brackets, then are the set of pairs, and their definition. The pair is on the left of the colon. There must be one for all pairs of uppercase and lowercase characters(that appear in, or will ever appear in, the data string). The definitions may be any string made up of any characters that is, or ever will be in the data string. Note that in the pairs, the capital letter comes first. always.
Prefixes
Div "divides" a string into Prefix-Tagged pairs. These are divided by doing capital letters, then lowercase. The lowercase part is the tagged part, and the capital part is the prefix. Whenever the data string changes, this division is "redone".
Semantics
The program starts by finding every Prefix-Tagged pairs definition string. This is found for some pair S, by the following process:
- Create an empty string. This will become the definition at some point.
- Find the pair of characters that have index 0 in the prefix, and in the tagged, and append that pairs definition to the string
- Then do this for index 1, index 2, ect... until the "minimum end"(end of either the prefix or the tagged, whichever is closer to the start), and then the rest of the string that was left out is appended to the end.
then the definition replaces the Prefix-Tagged pair, and this happens for all of them. This keeps looping until the string has only capital, or non capital letters.
Examples
[Ab]<Ab:Abb>