Skip to content

0.5.6

Choose a tag to compare

@Alligator Alligator released this 16 Aug 00:10
· 190 commits to main since this release

New Features

  • Arrays can be indexed with negative numbers, to count backwards from the end of the array (06b59fa)
  • Added a new is operator for type checking (86afa55)
    • e.g. if (myValue is bool) print 'bool';
    • Valid type names are string, bool, number, array, object, function, regex and unknown
  • Added an array.sort() method (a084958)
    • If the array contains only numbers, it will be sorted numerically. If it contains anything that isn't a number, all values are converted to strings before sorting

Bugfixes

  • Implicitly creating an array containing an object now works (d0be3e4, 82d7722)
    • e.g. a[0].thing = 2 where a is not defined
  • Array literals, object literals and function calls now copy primitives by value, instead of by reference (26c0305)
  • Stop array.pop() and array.popfirst() panicking on empty arrays (b0ef491)
  • num() now returns null instead of panicking if it can't parse a number (b0ef491)
  • Stopped the cli panicking if it's run with no arguments (912ed03)