Dosato v0.5
Dosato Version 0.5
This major version of dosato is not compatible with code written in previous versions. The following changes have been made:
- The
=>
operator in a for loop has been replaced with theas
keyword.
New Features
- Closure support has been added to the language. Closures can be created by using the
=>
keyword in combination with arguments, a type, and a body.
make add = int (a, b) => {
return a + b
}
More information on closures can be found in the documentation.
- The
as
keyword has been added to the language. Theas
keyword is used in for loops to iterate over a range of numbers.
make i = 0
do sayln(i) for range(0, 10) as i
- Console mode has been added to the language. This mode allows for the user to input data into the program.
dosato -c
This will open the dosato interpreter in console mode. You can type dosato code directly into the console and run it by pressing enter.
Press \
and then enter to put a new line in the console.
- Negative array indices are now supported. You can now access elements in an array using negative indices.
make arr = [1, 2, 3, 4, 5]
do sayln(arr#-1) // prints 5
Fixed Bugs
- Unary operators has too high precedence. This has been fixed.
- The Carrage return character is now considered a whitespace character.