📄️ Break Statement
This keyword accepts an optional integral argument which tells it how many levels of enclosing loops it should break. The default value is 1, thus breaking out of the current loop.
📄️ Compiler Warnings
Pluto offers optional compiler warnings for certain misbehaviors.
📄️ Continue Statement
Continue statements, like break, are meant to be used in loops. They skip the current iteration of the loop.
📄️ Default Arguments
During a function declaration, parameters can now declare their own default value.
📄️ For-As Loop
When you only want to iterate over the values of a table, you can use Pluto's for-as syntax.
📄️ Named Varargs
If you have a function that takes varargs and you want them in a table, you'd have to do something like this:
📄️ Numeral Parsing
Pluto makes two small changes to numeral parsing.
📄️ String Indexing
You can index strings for their characters now, which is cleaner & 3x faster than using string.sub. String indexing only occurs when you index with an integer, either positive or negative. Positive integers index from the start of the string, and negative integers index from the end.
📄️ String Interpolation
String interpolation is a simple alternative syntax to concatenation.
📄️ Switch Blocks
Switch blocks consists of the following new keywords:
📄️ Ternary Expressions
Ternary expressions behave identical as to how they would in C. They introduce no new keywords.
📄️ Type Hinting
Type-hinting looks like this:
📄️ Compile-Time Evaluation
Pluto's parser provides some powerful constructs which allow you to write code that will never be seen at runtime.
📄️ Destructuring
Destructuring is a better way to assign local variables from expressions that return a table.
📄️ Enumerations
Pluto adds the following syntax:
📄️ Explicit Globals
The optional global keyword can be used to explicitly declare global variables.
📄️ In Expressions
The in operator has been extended to support string searches and table searches. For these purposes, it's the fastest possible solution.
📄️ Lambda Expressions
Lambda expressions are an alternative way of writing anonymous functions.
📄️ Named Arguments
Instead of positional arguments, you can use the names of arguments you want to set:
📄️ Nodiscard Functions
Functions can be declared nodiscard, causing a warning to be raised when the return value is discarded:
📄️ Safe Navigation
For Member Access
📄️ Table Freezing
Tables can now be frozen at their current state to forbid any future modification. This action is irreversible and permanent for the lifespan of the table.
📄️ Try-Catch Statement
Pluto provides a more intuitive way to handle errors than pcall and xpcall.
📄️ Object-Oriented Programming
Pluto makes a plethora of improvements when it comes to object-oriented programming.