Whitespace, Lines and Indentation
Whitespace characters such as "spaces" and "tabs" are NOT ignored in Transmuton,
so pay attention when you use them.
Transmuton uses "Line Indentation" to indicate a block of code for:
- class definitions
- function -----|-----
- flow control
The number of spaces in the indentation in front of the "statement" is variable,
but all "statements" within the block must be indented the same amount.
There is a syntax that allows different code indents,
and it will be explained in another section.
a + b
a+ b
(a + b) !== (a+b)
(a, b, c, d) == (a b c d)
sum(a b)
sum (a b)
sum(a b) !== sum (a b)
.if a > b
x = 5
y = 10
.elif a < b
x = 8
y = 11
.else
x = 0
Single Line Statement, Flow Line Statement, Block Line Statement,
Control Structure, Flow Section, and Block of Code
"Single Line Statement" aka "liner" is the code on the same line.
If "liner" is the first line of "Control Structure" also "Control Flow" ("Conditional Flow" or "Repetitive Flow"),
it is "Flow Line Statement" aka "Floliner".
If "liner" is part of a "Block of Code",
it is "Block Line Statement" aka "Blockliner".
"Block of Code" aka "Blocod" represent indented "Blockliners" under the current "Floliner".
"Flow Section" aka "Flosection" aka "Flosec" is group of one "Floliner" and its "Blockliners".
"Control Structure" (Control Flow) aka "Flocod" is made of "Flosecs".
x = 5
sum(a b)
if(x > b)
x = 8
y = 3
.if x > b
x = 8
y = 3
z = .sum x y
.elif x < b
x = 100 * 25
y = 200 / 5
z = .avg x y
Multi Line Statement
"Multi Line Statement" aka "Multiliner" is actually a "Single Line Statement" written on multiple lines using sign \ .
There must be whitespace characters around sign \ .
sum = 5 + 10 + \
1 + 3 + \
8 + 100
Multiple Statements on a Single Line
"Multiple Statements on a Single Line" aka "Statementer" is actually more "liners",
or "floliners" with "blockliners" on a single line, using ; or ;; .
"One semicolon" ; aka "Endi" represent the end of one "blockliner".
Two semicolons ;; aka "Ender" represent the end of the current "blocod", or current "liner".
; "endi"
;; "ender"
If "Flocod" is written in one line, it is called "Flocodliner".
"Flocodliner" is also "Statementer".
If "Flosec" is written in one line, it is called "Flosecliner".
"Flosecliner" is also "Statementer".
x = 2 ;; y = 8 ;;
if(a > b) .. x = 5 ; y = 3 ; z = 11 ;;
(.if a > b .. x = 5) . (.elif a < b .. x = 3 ; y = 11) . (.else .. x = 0) ;;
x = 2 ;; y = 8
z += 5
if(a > b) .. x = 5 ; y = 3 ; z = 11 ;
print(x y z)
.if a > b .. x = 5 ; y = 3 ; z = 11
.print x y z
fi(a > b) .. x = 5 ;;
.fi a > b .. x = 5 ;
.fi a > b .. x = 5
(.if a > b .. x = 5) . (.elif a < b .. x = 3 ; y = 11) . (.else .. x = 0)
(.fi a > b .. x = 5) . (.elfi a < b .. x = 3 ; y = 11) . (.else .. x = 0)
(.fi a > b .. x = 5) . (.lefi a < b .. x = 3 ; y = 11) . (.lese .. x = 0)
Calling a function
The function can be called as:
- packed #> sum(x y)
- dotted #> .sum x y
- chained #> (x y)..sum()
- rodded #> x y | .sum #> x y | sum()
And therefor we have:
- "Packed Function" aka "Pack-func" aka "pack-fu"
- "Dotted ---||---" -|- "Dot-func" -|- "dot-fu"
- "Chained ---||---" -|- "Chain-func" -|- "chain-fu"
- "Rodded ---||---" -|- "Rod-func" -|- "rod-fu"
x = 3
y = 5
sum(x y)
.sum x y
(x y)..sum()
x y | sum()
x y | .sum
word = " Hello "
strip(word)
.strip word
word..strip()
word | strip()
word | .strip
Calling an Object Entity
The "Object Entity" is called with a "single dot" aka "dot".
car.color
car.drive()
Calling an Object Method on a variable
Calling the method of the object on the var is done by connecting them with "two consecutive dots".
"Two consecutive dots" aka "chain".
x = 5
x..math.sqrt()
math.sqrt(x) == x..math.sqrt()
Chain functionalities on a variable
Chain functionalities on a var as many times as you like,
with "chain".
word = " Hello "
word..strip()..upper()
upper(strip(word))
word | strip() | upper()
strip(word) | upper()
word | .strip | .upper
.strip word | .upper
x = -9
x..abs()..math.sqrt()
#> You can also do this as:
math.sqrt(abs(x))
x | abs() | math.sqrt()
abs(x) | math.sqrt()
x | .abs | math.sqrt()
.abs x | math.sqrt()
Coding into a Temporary Variable (rodding to raryvar)
"Temporary Variable" aka "RaryVar" (raryvar).
If there is a need to simplify the expression into one temporary var,
in order to implement different functionalities, and to shorten the code,
then we use "Coding into a Temporary Var" aka "Rodding to RaryVar".
1.2 + 3.4 | x => (&.)x
1.2 + 3.4 | x => (.&)x
#> You can aslo do this as:
1.2 + 3.4 | x => PoRiDetach(x)
1.2 + 3.4 | x => poridetach(x)
1.2 + 3.4 | x => .PoRiDetach x
1.2 + 3.4 | x => .poridetach x
1.2 + 3.4 | x => .x>
.(1.2 + 3.4)>
(.&)(1.2 + 3.4)
1.2 + 3.4 | y => .print f"Integer part is: {<y} and Fractional part is: {.y>}"
---------------------------||-----------------------------------------: {(.&)y}"
Pass Statement
"Pass Statement" aka "PassNOP" aka "passnop".
(NOP == no operation).
"PassNOP" is a placeholder for future "Blocod".
It's a "Null Statement" where "Empty Code" is not allowed, such as:
- function definitions
- class -----|-----
- if statements
- loops
This means that the developer knows the structure of his "Sorcod" (source code),
but has yet to develop the "Blocod" where he previously placed the "PassNOP".
The difference between a "Comment" and the "PassNOP"
is that while the interpreter ignores the "Comment" entirely,
"PassNOP" is executed (not ignored) without errors.
"PassNOP" is indicated by two separate consecutive backslashes,
which have a blank space on either side.
\ \
color = "blue"
.if color == "blue"
\ \
.elif color == "green"
\ \
.elif color == "red"
.print "The color is red."
.else
.print "Not defined!"
color = "blue"
.if color == "blue" .. \ \
.elif color == "green" .. \ \
.elif color == "red" .. .print "The color is red."
.else .. .print "Not defined!"