welcome@transmuton.space             TRANSMUTON             Programming Language

About Comments Range Syntax Detacher Merger Swaper Digipulation Comparons Logicons Bitwisons Conditons

Merger


"Merger" is an arithmetic and special operator for merging two or more items into one.
There must be at least one left and right space around the "Merger" .
Point (dot) is actually "Merger" .

If two integers are merged into one float, two "Mergers" are used . .
but you can also merge them with a dot, without using "Mergers".

If two floats are merged into one float, one "Merger" is used .
   - digits before the "decimal point" are merged into "integer part"    (from left to right)
   - digits behind the "decimal point" are merged into "fractional part" (from left to right)

"Merger" can be used to merge "Flosecliners" to a single "Flocodliner",
where only one condition will be met.
          

#>  Merging 2 integers "a" and "b"


a = 123
b = 456


a . b    ==    123 . 456        ==     123456
a . . b  ==    123 . . 456      ==     123.456
a.b      ==    123.456          ==     123.456


b . a    ==    456 . 123        ==     456123
b . . a  ==    456 . . 123      ==     456.123
b.a      ==    456.123          ==     456.123

          

#>  Merging 3 integers "x", "y" and "z"


x = 123
y = 456
z = 789


x . y . z   ==   123 . 456 . 789   ==   123456789
z . x . y   ==   789 . 123 . 456   ==   789123456
y . x . z   ==   456 . 123 . 789   ==   456123789

          

#>  Merging two floats "x" and "y"


x = 12.34
y = 56.78


x . y   ==   12.34 . 56.78   ==   1256.3478
y . x   ==   56.78 . 12.34   ==   5612.7834

          

#>  Merging 3 floats "x", "y" and "z"


x = 1.2
y = 3.4
z = 5.6


x . y . z   ==   1.2 . 3.4 . 5.6   ==   135.246
z . y . x   ==   5.6 . 3.4 . 1.2   ==   531.642

          

#>  Merging 2 strings "c" and "d"


c = "trans"
d = "muton"


c . d    ==    "trans" . "muton"    ==    "transmuton"
d . c    ==    "muton" . "trans"    ==    "mutontrans"

          

#>  Merging strings


hello = "Hello"
world = "World"


hello . " " . world . "!"        ==  "Hello World!"


f"{hello} {world}!"              ==  "Hello World!"


"{} {}!"..format(hello world)    ==  "Hello World!"

          

#>  Merging 2 lists


e = [1 2 3]
f = [4 5 6]


e . f    ==    [1 2 3] . [4 5 6]    ==    [1 2 3 4 5 6]
f . e    ==    [4 5 6] . [1 2 3]    ==    [4 5 6 1 2 3]

          

#>  Merging integers with variations


a = 123
b = 456


x =  a . . b          #>  a . . b  ==  a.b
x == 123.456


<x  ==  a
x>  ==  b


<x . x>     ==   123 . 456     ==   123456


x> . <x     ==   456 . 123     ==   456123
x> . . <x   ==   456 . . 123   ==   456.123

          

#>  Merging 3 "Flosecliners"
#>    first  flosecliner         (.if a > b .. x = 5)
#>      second flosecliner         (.elif a < b .. x = 3 ; y = 11)
#>        third  flosecliner         (.else .. x = 0)


a = 1
b = 2
x = y = 0         #>  x == y == 0



(.if a > b .. x = 5) . (.elif a < b .. x = 3 ; y = 11) . (.else .. x = 0)

#>  x == 3
#>  y == 11




(.fi a > b .. x = 5) . (.lefi a < b .. x = 3 ; y = 11) . (.lese .. x = 0)

#>  x == 5
#>  y == 0