The full docs are located in the /docs
folder. A mini version of the docs are located below
This is the print function in the lang. Here is an example:
sendMessage("Hello, World!")
Varibles can hold all kinds of values such as numbers, booleans, strings, etc. Opperations such as addition are supported as well. Here is an example of doing an oppeation in a varible
propose num1 = 5 + 5
That code would set the varible num1
to 10
.
All varibles are global and do not have any local scope. To change the value of a varible, you must use the some syntax to declare it. Here is an example if I wanted to re-define the value of num1
to 3.14159
propose num1 = 3.14159
Functions is a block of code that can be ran through out the program. In this lang functions support aguments and return statments. Here is an example of a function to add 2 numbers together and return the sum.
ysws add(num1, num2) {
propose sum = num1 + num2
return sum
}
This lang has error handling similer in concept to try...catch statments in other langs. The main diffrence is that in this lang only one statment is supported for the code to run and the "catch code" per statment.
Here is an example where a function is called with the incorrect number of params
ysws func() {
sendMessage("This is a function")
}
proposal(func("Hello"), sendMessage("The function call errored"))