welcome@transmuton.space             TRANSMUTON             Programming Language

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

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     #>  the sum of two variables
a+ b      #>  positive counter variable (number) "a" and variable "b"



(a + b)  !==  (a+b)             #>  sign   !==   is comparison operator "not equal"



(a, b, c, d)  ==  (a b c d)     #>  "comma" is not mandatory sign



sum(a b)        #>  "sum function" with 2 variables (aka vars) "a" and "b"
sum (a b)       #>  var "sum" and "tuple" (type of list) with vars "a" and "b"

sum(a b)  !==  sum (a b)



.if a > b
  x = 5         #>  indented statement          #>  block code
  y = 10        #>  indented statement          #>  block code
.elif a < b
  x = 8         #>  indented statement          #>  block code
   y = 11       #>  ERROR indented statement    #>  block code
.else
  x = 0         #>  indented statement          #>  block code

          

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           #>  "Single Line Statement" aka "Liner"
sum(a b)        #>  "liner"



if(x > b)       #>  "Flow Line Statement" aka "Floliner"
  x = 8         #>  "Block Line Statement" aka "Blockliner"     #>  part of the "Blocode"
  y = 3         #>  "blockliner"                                #>  ---------||----------



.if x > b           #>  "floliner"                              #>  "flosec" part      #>  "flocode" part
  x = 8             #>  "blockliner"    #>  "blocode" part      #>  ------||-----      #>  ------||------
  y = 3             #>  -----||-----    #>  ------||------      #>  ------||-----      #>  ------||------
  z = .sum x y      #>  -----||-----    #>  ------||------      #>  ------||-----      #>  ------||------
.elif x < b           #>  "floliner"                              #>  "flosec" part    #>  ------||------
  x = 100 * 25        #>  "blockliner"    #>  "blocode" part      #>  ------||-----    #>  ------||------
  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 + \      #>  all 3 lines of code 
1 + 3 + \             #>  represent
  8 + 100             #> "Multiliner"

          

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 ;;                           ##  "statementer"
                                                    made of 2 "liners"    with "enders"    ##


if(a > b) .. x = 5 ; y = 3 ; z = 11 ;;      ##  "flosecliner"
                                                    made of "floliner" and 3 "blockliners" with "endis" and "ender"

                                                 also "flocodliner"
                                                 also "statementer"     ##


(.if a > b .. x = 5) . (.elif a < b .. x = 3 ; y = 11) . (.else .. x = 0) ;;   #>  "flocodliner", also "statementer"

          

x = 2 ;; y = 8                               #>  "statementer" without last "ender"
z += 5


if(a > b) .. x = 5 ; y = 3 ; z = 11 ;        #>  ------||----- also "flosecliner" with last "endi"
print(x y z)


.if a > b .. x = 5 ; y = 3 ; z = 11          #>  ------||----- without last "endi" or "ender"
.print x y z


fi(a > b) .. x = 5 ;;         #>  "statementer" also "flosecliner" with "ender"
.fi a > b .. x = 5 ;          #>  ----------------||------------------- "endi"
.fi a > b .. x = 5            #>  ----------------||-------------- without "endi" or "ender"


(.if a > b .. x = 5) . (.elif a < b .. x = 3 ; y = 11) . (.else .. x = 0)   ##  "flocodliner", also "statementer"
                                                                                 without "ender"    ##



(.fi a > b .. x = 5) . (.elfi a < b .. x = 3 ; y = 11) . (.else .. x = 0)    #>  "flowcodeliner", also "statementer"

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



    ##
        "flosecliner" can be written in parentheses, resulting in no need to use last "endi" or even "ender".

        By the way  .fi .elfi  are the opposite of  .if .elif
           .fi    ==  "if statement is NOT TRUE, then do the following"
           .elfi  ==  "if CURRENT statement is NOT TRUE, then do the following"

        It is recommended to use:
           if-elif-else
           fi-lefi-lese    (as opposite of "if-elif-else")
    ##

          

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"
          

#>  Calling a function - examples with numbers


x = 3
y = 5


sum(x y)            #>  result is 8
.sum x y            #>  ----||-----
(x y)..sum()        #>  ----||-----
x y | sum()         #>  ----||-----
x y | .sum          #>  ----||-----

          

#>  Calling a function - examples with strings


word = " Hello   "


strip(word)         #>  word == "Hello"
.strip word         #>  -------||------
word..strip()       #>  -------||------
word | strip()      #>  -------||------
word | .strip       #>  -------||------

          

Calling an Object Entity


The "Object Entity" is called with a "single dot" aka "dot".
          

#>  Calling an "Object Entity"


car.color           #>  entity: "color"   == "object state"      ==  "object property"
car.drive()         #>  entity: "drive()" == "object behaviour"  ==  "object method"

          

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()      #>  var "x" chained with "sqrt method" of the "math object"

math.sqrt(x)  ==  x..math.sqrt()

          

Chain functionalities on a variable


Chain functionalities on a var as many times as you like,
                                                         with "chain".
          

#>  Chain functionalities on a string-var


word = " Hello   "
word..strip()..upper()           #>  word == "HELLO"



#>  You can also do this as:

upper(strip(word))               #>  word == "HELLO"

word | strip() | upper()         #>  ------||-------
strip(word) | upper()            #>  ------||-------

word | .strip | .upper           #>  ------||-------
.strip word | .upper             #>  ------||-------

          

#>  Chain functionalities on a number-var


x = -9
x..abs()..math.sqrt()            #>  x == 3



#>  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".
          

#>  Rodding to RariVar "x"

1.2 + 3.4 | x => (&.)x                #> result is 4.0      #> legible and clear

1.2 + 3.4 | x => (.&)x                #> result is 0.6      #> -------||--------



#>  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)>                         #> -----||------      #> too unclear

(.&)(1.2 + 3.4)                       #> -----||------      #> somewhat unclear

          

#>  Rodding to RariVar "y"

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.
  \ \
          

#>  PassNOP example


color = "blue"


.if color == "blue"
  \ \                               #>  executes without error and does nothing
.elif color == "green"
  \ \
.elif color == "red"
  .print "The color is red."
.else
  .print "Not defined!"

          

#>  PassNOP example


color = "blue"


.if   color == "blue"   ..  \ \     #>  executes without error and does nothing
.elif color == "green"  ..  \ \
.elif color == "red"    ..  .print "The color is red."
.else                   ..  .print "Not defined!"