© Tyl Software Foundation 2019-2021
▶ TYL SYMBOLIZER
Tyl Symbolizer turns regular ASCII characters combinations into special UNICODE
symbols, thus enabling Tyl code to be free from regular programming keywords.
Tyl software does not use keywords. Instead of keywords, you write
combinations of one or more ASCII characters, referred to as the code,
and the symbolizer is turning them into special symbols, referred to as
the symbol, that represent a programmatic value or functionality.
Say we want to add a
Code/Symbol to Functionality Mapping
Functionality
Code
Symbol
Say we want to add a
compare
function, that compares two numbers, we can
write:
compare num1 num2:
The colon character ':', is Tyl code for a function declaration. Then when
running the code, Tyl Symbolizer will replace the above code with:
compare num1 num2 »
The symbol '»' is Tyl function symbol. You can use it also in your Tyl
code.
Now we want to compare the numbers and return 1 if
The ternary statement:
Now we want to compare the numbers and return 1 if
num1
is greater than or
equal to num2
, else return 1. We can use the ternary operator that is composed
of a question mark and of the backslash character '\' ,the else code.
The ternary statement:
num1 >= num2 ? 1 \ -1
Tyl Symbolizer will replace the above code with:
num1 >= num2 ? 1 ⇋ -1
The symbol '⇋' is Tyl else symbol. You can write code or symbol,
because the system will always turn codes into symbols.
The full
The full
compare
function:
compare num1 num2 » num1 >= num2 ? 1 ⇋ -1
So if you want to write a Compare Test program, write:
go:
result1 compare 1 2
result2 compare 2 1
print result1
print result2
compare num1 num2: num1 >= num2? 1 \ -1
When running the program, the code will be replaced with this symbolized code:
go »
result1 compare 1 2
result2 compare 2 1
print result1
print result2
compare num1 num2 » num1 >= num2 ? 1 ⇋ -1
Under the hood, Tyl Symbolizer is also responsible for inserting spaces before
and after symbols.