MPSL Release Notes
==================

2.54
----

 - New features:
    - The ad-hoc compiler now accepts source code with
      utf-8 characters without problems.
    - New function chomp().
    - The INC array can be NULL to use load() with direct paths.
    - New function index(). It's only meant as a special construction
      to be used with map() to get the indexes of an iterator, so that
      constructions like iterable->map(sub (v, i) { i; } ); can be
      written as iterable->map(index) to get the same results.
 - Important changes:
    - The hmap() function has been renamed to omap().

2.53
----

 - New features:
    - New function feof().
    - The ad-hoc compiler now takes into account files
      starting with #!.

2.52
----

 - New features:
    - Constant folding can be disabled by setting the variable
      `MPSL.constant_fold' to 0.
 - Dropped features: support for the ~, ~=, ++, -- and range
   operators have been deleted from the classic compiler.
 - Bug fixes:
    - Some memory leaks.

2.51
----

 - New features:
    - This release has the ad-hoc compiler (a-mpsl) as the default.
    - The * operator now allows multiplication for number * number,
      string * number and array * number.
    - The - operator now allows substraction for number - number,
      array - array, array - object, object - array and
      object - object.
    - Division and module opcodes generate a "Division by zero"
      MPSL error instead of just crashing the program.

2.30
----

 - New features:
    - New functions bitand(), bitor() and bitxor(). The associated
      operators no longer work.
    - New functions bitshl() and bitshr(), replacing the << and >>
      operators.
    - New function pow() (power), replacing the ** operator.
    - New API function mpsl_constant_fold().
    - The time() function now also contains fractional time.
    - New operator $, like an inverse call to fmt() (for example,
      255 $ "%x" returns "ff").
    - New function escape(), to escape a range of characters
      in a string.
 - Changes:
    - The ||= operator has been changed to |=.
 - Internal changes:
    - Next major version will include an ad-hoc compiler, that
      will replace the current flex+yacc one. They will coexist
      and be switchable during some versions. Some internal
      changes has been necessary, but should not be noticeable.
    - Some executor opcodes has been changed (again, should not
      be noticeable).
 - Dropped features:
    - The ** operator is no longer supported.
    - The &, |, ^, &=, |= and ^= are no longer supported.
    - The >>, <<, >>= and <<= operators are no longer supported.
    - The strftime() function no longer exists, as it can
      done with fmt() and sprintf().
    - The hsize() function no longer exists, use count().
    - The hdel() function no longer exists, use del().
    - The adel() function no longer exists, use del().
 - Bug fixes:
    - Fixed return value for unlink() and rename() (-1 on errors).

2.27
----

 - License change: released into the public domain.
 - New features:
    - The + operator can be used for concatenating strings, arrays
      and objects. This makes the ~ operator redundant.
    - The comparison operators ==, !=, <, >, <= and >= can now
      be used to compare all types, not only numbers.
    - The random() function now accepts arrays as arguments and
      NULL, to return a number from 0.0 to 1.0 (not included).
    - New function regcomp(), to compile regexes.
    - New function count(), to return the number of elements
      of any type.
    - New conversion functions integer(), real() and string().
    - The print() function now prints a space between arguments
      and always print an end of line.
    - New function set(), to be used with applicable every type.
    - New function del(), to be used with applicable every type.
 - Other changes:
    - The old "scalar" type is now "string".
    - The file_eol() function has been renamed to eol().
 - Dropped features:
    - The functions is_array() and is_hash() no longer exist. Use
      type().

2.25
----

 - New features:
    - A new foreach (v, i, a) construction, that iterates `a'
      setting `v' and `i' with each value and index.
    - New function type(), that returns the type of a value as a string.
    - New function get(), that returns an element of a set (like using []).
    - New function file_eol(), that returns the EOL sequence detected in
      previous call to read().
    - New function bool().
    - Now map() can iterate scalars (i.e. integers), arrays, hashes or files.
      The filter can be undefined, so the values are returned untouched.
    - In map(), filters that are strings are assumed to be regexps.
    - The write() function now returns the fd instead of a byte count.
    - New API function mpsl_find_in_embedded_tar().
 - Other changes:
   - The version numbering has changed from X.X.X to X.XXX (real number).

2.2.4
-----

 - New features:
    - Each component of the INC variable (where the path to programs
      is stored) can be executable.

2.2.3
-----

 - New features:
    - New function getcwd().
    - New function reverse().

2.2.2
-----

 - New features:
    - The ~ operator is no longer limited to concatenating strings,
      but can be used to join all kinds of data values (like the
      one from MPSL 3.x).
    - New operator ||= (so that `a ||= 2' is equivalent to
      `a = a || 2'.
    - New operator ~= (so `a ~= b' is the same as `a = a ~ b').
    - New function slice().

2.2.1
-----

 - New features:
    - New function rename().
 - Bugfixes:
    - Error in random().

2.2.0
-----

 - New features:
    - By the new() operator and the usage of the -> operator as
      a method call, it helps implementing simple object-oriented
      programming.
    - join() can also join arrays.
    - New keyword `global', to define global variables.
    - The map() and grep() functions also accept a hash as their
      first argument.
    - New function hmap(), to map an array or hash to another hash.

2.1.0
-----

 - New features:
    - New TCP/IP socket client support via the connect() function.
    - The push() functions accepts a variable number of elements
      to be pushed into the array (not only one).
    - New function tr(), to transliterate strings.
    - New function strftime() (like C library's one).

2.0.1
-----

 - New features:
    - An abbreviated way of defining hashes (ala JavaScript).
 - Bugfixes:
    - Several fixes to for() construction: fixed incorrect
      calling order and for (;;) is accepted for infinite loops.

2.0.0
-----

 - A new C-like for() control flow construction.
 - Updated to match MPDM refactoring (no more sweeping /
   garbage collection).
 - New multithreading support:
    - A function can be prefixed with & (ampersand) to execute
      it in a new thread; the new thread handler is returned.
    - Support for mutex values.
    - Support for semaphore values.
 - Any function argument not explicitly declared and
   sent as argument in the function call is stored
   in the local array _ (underscore).
 - The adel() function no longer returns the deleted element.
 - mpsl_compile_file() now has an additional argument
   holding the source file search path.
 - The following functions had had their arguments swapped:
    - split().
    - join().
    - sscanf().
    - map().
    - grep().
    - regex().
    - sregex().

1.0.9
-----

 * New syntax for _inverse_ calling functions; the new
   construction `val1->func(val2)' is equivalent
   to `func(val1, val2)'. This way, chained function
   calls where the first argument of one is the return
   of the other are much easier to write and understand.
 * Numbers prefixed by `0b' are accepted as binary numbers
   and `sprintf()' accepts `%b' to print them.
 * New operands >> and << (bit shifting).
 * New operands &=, |= and ^=, <<= and >>=.
 * New operand ** (power).
 * New function `random()'.
 * New trapping functionality.

1.0.8
-----

 * New function `sscanf()'.
 * New function `compile()', to compile a string of MPSL code
   to an executable value.
 * New function `bincall()', to create an executable value
   given a pointer to binary code.
 * The `mpsl' executable now ignores the first line of an MPSL
   script if it starts with #!.
 * Real numbers can be expressed in scientific notation.

1.0.7
-----

 * The `write()' allows a variable argument of values to write.
 * Values are dumped as MPSL instead of MPDM's low-level format.
 * New function `chdir()'.

1.0.6
-----

 * Fixed a strange but annoying bug regarding local variables
   losing their values in anonymous subroutines.

1.0.5
-----

 * New `g' flag in regex().
 * Fix backslash parsing in strings.

1.0.4
-----

 * The iterator variable in foreach() is _always_ created
   as a local variable inside the block. Also, the old
   construction foreach(local v, ...) issues a warning,
   as it's redundant.

1.0.3
-----

 * Anonymous subroutines now run inside a block frame
   instead of a subroutine frame. This way, they can have
   access to local variables defined in the subroutine
   they are called from. So, for example, if you run
   map() inside a subroutine, its anonymous code block
   can access the local variables defined there.
 * getenv() doesn't crash if the environment variable
   does not exist.

1.0.2
-----

 * Small internal refactoring regarding subroutine and
   block frames. Frame creation code has been unified,
   so block frames don't crash when a NULL local symbol
   table is sent as argument, and can have arguments.
   This change is not visible from outside; only a step
   towards closing bug #1107.
