Skip to content

Dosato v0.5

Compare
Choose a tag to compare
@Robotnik08 Robotnik08 released this 12 Nov 19:20
· 141 commits to main since this release
f03dcbc

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 the as 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. The as 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.