Skip to content

0.6.0

Choose a tag to compare

@well-in-that-case well-in-that-case released this 06 Apr 18:34
· 2231 commits to main since this release
  • Added <constexpr> attribute to force locals to be compile-time constants
  • Added $expr syntax for compile-time evaluation of select functions
  • Added export [NAME=VALUE | function | class] syntax
  • Added named arguments (name=value in 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 when statement

Enums:

  • Added ENUM.ENUMERATOR syntax for named enums
    • Added ENUM CLASS NAME ... syntax to force usage of this syntax
  • 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 NAME which sets __parent property and metatable with __index
    • Added static function NAME for use within table constructor/class definition (equal to NAME = function)
  • Added 'parent' expression
    • parent.PROP -> self.__parent.PROP
    • parent:METHOD(...) -> self.__parent.METHOD(self, ...)
  • Added TABLE instanceof METATABLE operator

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_EXPORT so '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.