xn--m6e

From Esolang
Jump to navigation Jump to search

xn--m6e is an esolang created by User:Yayimhere, based on Funciton, as well as trees.

Syntax

xn--m6e uses a tree. The most basic piece of syntax are node's, which are written as:

╔═╩═╗
║ x ║
╚═╦═╝

or when ending a tree:

╔═╩═╗
║ x ║
╚═══╝

now what comes after the node/how is it connected to others? well, for connecting it to only on node, connect as following:

╔═╩═╗
║ x ║
╚═╦═╝
╔═╩═╗
║ y ║
╚═╦═╝

now for splitting into two:

   ╚═╦═╝
  ╔══╩══╗
╔═╩═╗ ╔═╩═╗
║ x ║ ║ y ║
╚═╦═╝ ╚═╦═╝

and for splitting into more:

            ╚═╦═╝
  ╔═════╦═════╩═════╦═════╗
╔═╩═╗ ╔═╩═╗       ╔═╩═╗ ╔═╩═╗

as you can see, (and ) is used for splitting into more. For merging back into a node, then the above structures are used, but flipped upside down.

Every tree starts with first its variable name, and then the starting parent node, written as:

╔═══╗
║ n ║
╚═╦═╝
╔═╩═╗
║ x ║
╚═╦═╝

in which n is the name. Note that the name is some binary string, meanwhile the nodes themselves are only single binary digits(unless its z variable reference). There is a single special construct called the reader, which goes on a single level of the tree. simply, it surrounds the nodes, like:

╔     ╗
┃ ... ┃
╚     ╝

note that multiple trees can be in a program, each on their own line, and separated by a single empty line.

Semantics

A program starts execution of the program at the first tree. it goes through every layer of the tree each iteration. in the case of a variable reference, the given tree is replaced in. When merging into the nodes after it, when they are going into more nodes, the left and rightmost nodes are always connected to the others. In the case where it connects into less, the left and right are used to go into the new ones. The same process is reversed when going from the tree into a variable

Readers never move with the rest of the tree. When there's only single binary values, then the variable with the corresponding binary string as a name is referenced, and added to the end of the program, with the same process for connecting.

Variables are explicitly allowed to be recursive(though not directly, a variable must reference itself through another one).

Note that readers are also copied with a variable.