0.6.0
·
2231 commits
to main
since this release
- Added
<constexpr>attribute to force locals to be compile-time constants - Added
$exprsyntax for compile-time evaluation of select functions - Added
export [NAME=VALUE | function | class]syntax - Added named arguments (
name=valuein funcargs) - Added named varargs (
...NAME), automatically puts the varargs into a table with the given name - A subset of Soup is now vendored with Pluto so standard library features that rely on it should now be more viable
- Removed deprecated "pluto_case" and "pluto_default" keywords
- Removed
whenstatement
Enums:
- Added
ENUM.ENUMERATORsyntax for named enums- Added
ENUM CLASS NAME ...syntax to force usage of this syntax
- Added
- Added enum reflection for named enums (
:names(),:values(),:kvmap(),:vkmap())
Object-oriented programming:
- Added
new TABLE(...)syntax (creates new table, sets TABLE as its metatable + __index, calls:__construct(...)if exists) - Added 'class' statement & expression (similar to table but without need for ',' or ';' after properties and functions)
- 'class' and 'local class' statements also support
extends NAMEwhich sets __parent property and metatable with __index - Added
static function NAMEfor use within table constructor/class definition (equal toNAME = function)
- 'class' and 'local class' statements also support
- Added 'parent' expression
parent.PROP->self.__parent.PROPparent:METHOD(...)->self.__parent.METHOD(self, ...)
- Added
TABLE instanceof METATABLEoperator
Type hints:
- Added 'int' & 'float' type hints (more restrictive than 'number')
- Added 'void' type hint for function return type
Standard library:
- Added utonumber, utostring, & string.uformat
- Added
instanceof(TABLE, METATABLE)
For integrators upgrading to Pluto 0.6.0:
- Consider defining
PLUTO_COMPATIBLE_NEW,PLUTO_COMPATIBLE_CLASS,PLUTO_COMPATIBLE_PARENT&PLUTO_COMPATIBLE_EXPORTso 'new', 'class', 'parent' & 'export' will not be reserved keywords just yet, instead 'pluto_new', 'pluto_class', 'pluto_parent' & 'pluto_export' can be used.
More detailed documentation can be found here.