What's new in Agena 2.36.2
Feb 6, 2023
- New `curry` transforms a function with multiple arguments into a sequence of single-argument functions, i.e. f(a, b, c, ...) becomes f(a)(b)(c)...
- `reduce` now accepts a new option, counter=true, which will assign an internal counter value, starting from one and incremented by one, to the last argument of the given function. This is 20 % faster than the existing _c=true option.
- `reduce` now supports folding, which means that the first value in a structure or strings is taken as the initialiser, with the new fold=true option. In this case you do not need to - and should not - pass an initialiser explicitly as the first argument.
- The new function `fold` works like `reduce` with the fold = true option.
- `skycrane.email` has been further improved and now also returns a reason why an address is invalid.
- Metamethods can now be assigned to procedures. This may be useful only with closures, which can be used to store data for faster access than is possible with tables, sequences or registers. Data stored in closures usually are called `upvalues`. Depending on the platform, the increase in speed when reading or writing upvalues is zero to nine percent, with generally less memory required.
- To store data in closures, use the `tuples.new` function.
- The `tuples` package provides functions and metamethods to work with tuples, see Chapter 10.12 of the Primer and Reference.
- If a procedure name is indexed with square brackets, the respective upvalues are returned if the procedure is a closure.
- Procedures now support the '__index', '__writeindex', '__tostring', '__in', '__notin', '__filled', '__empty', '__union', '__minus', '__intersect', '__eq', '__aeq', '__eeq' and '__size' metamethods.
New in Agena 2.24.2 (Jan 26, 2022)
- The following inverse hyperbolic functions have been added to the `dual` package: `dual.darcsinh`, `dual.darccosh`, `dual.darctanh`. Also added the logarithmic functions `dual.dlog2` and `dual.dlog10`.
- The new procedure `dual.erfcx` implements the scaled complementary error function for dual numbers.
- Added functions `dual.dlnplusone` and `dual.dexpminusone` to compute ln(x + 1) and exp(x) - 1, respectively.
- `dual.dhypot` has been implemented in C, making it 33 percent faster. The `dual' package functions `sin`, `cos`, `sinh` and `cosh` have also been tuned by 33 percent.
- The `dual` package functions `derf`, `derfc` and `dhypot` have been renamed to `dual.derf`, `dual.derfc` and `dual.dhypot`, respectively. Aliases have been provided to ensure backward compatibility.
- Tweaked `sin`, `sinc`, `cos`, `cosxx`, `tan`, `tanc`, `tanh`, `exp`, `antilog2`, `antilog10`, `root`, `proot`, `ipow`, `cbrt`, `gamma`, `cas` and `bea` for the complex domain. Also tweaked `calc.lambda`.
New in Agena 2.22.1 (Oct 26, 2020)
- `io.open` and `io.popen` could crash if given an invalid mode. This has been fixed.
- The new function `math.nextmultiple` returns the next multiple of an integer to the given integer base.
- Introduced unsigned 32-bit integers to the `numarray` package, to be created with the new function `numarray.uint32`. See also: `numarray.readuint32` in the Primer and Reference.
- `numarray.sort` can now sort all kinds of arrays.
- The new function `stats.numbpart` computes partition numbers.
- The new function `stats.bell` computes Bell numbers.
- To prevent segmentation faults, `numarry.resize`, `numarray.uchar`, `numarray.ushort`, `numarray.double`, `numarray.int32` and `numarray.uint32` can no longer create arrays of more than 2,147,483,647 elements.
- Corrected error message in `numarray.getbit`.
New in Agena 2.22.0 (Oct 2, 2020)
- The `++' and `--' increment and decrement operators can be used in statments
- Introduced a `no-operation` statement that does nothing
- `io.eof` has become 25 percent faster.
- The new function `io.ferror` checks the error indicator for a file.
- The new function `io.clearerror` clears the end-of-file and error indicators of a file.
- The new function `os.faccess` checks the read, write and execute permissions of a directory or file.
- The new function `environ.decpoint` returns the decimal point separator used in the current locale. It is an alternative to the expression `os.getlocale.decimal_point`, but is faster.
- `io.read` with the '*n' option can now also read hexadecimal numbers and numbers in scientific E notation. It can now also process floats that include the decimal point separator of the current locale that may be different from a dot.
- The new '*L' option to `io.read` reads the next line keeping the end-of-line character.
- `xpcall` now accepts optional function arguments.
- With pipes, `io.close` returns the exit code of the application run as a second result. Likewise, `io.pcall` returns the exit code, as well.
- `strings.repeat` accepts an optional delimiter and also protects against overflow or underflow.
- Added the '%f' frontier pattern. Please check Chapter 7.2.3 of the Primer and Reference for further details.
- Added 'x' hex escapes. See next example.
- The new escape sequence 'z' skips subsequent white-space characters, including line breaks; it is particularly useful to break and indent a long literal string into multiple lines without adding the newlines and spaces into the string contents.
- The C API function `lua_stringtonumber` could not be used as its definition was missing in the `agena.h` header file. This has been fixed.
- In Solaris, the `gdi` package could not be initialised. This has been fixed.
New in Agena 2.21.11 (Sep 23, 2020)
- The new function `strings.fuzzy` compares two strings case-insensitively and returns an estimate of their similarity as both an absolute and relative score.
- If you pass any second argument to `os.chdir`, the function will no longer issue an error. Instead, it will return `false` if the given path does not exist, or `fail` if you have no permission to enter the directory. Otherwise, the function will return `true` and commit the change of directory.
- All installers now put the scheme files in shareschemes and the icons in shareicons. They also install sample script files in sharescripting, including one that searches for a given file in a path. Start-up batch files for ArcaOS, eCS, OS/2, DOS and Windows are provided, as well.
- The Windows uninstaller did not delete the share folder. This has been fixed.
- Rewrote Appendix A4 on command-line usage & scripting.
- The ArcaOS - OS/2 edition now includes experimental versions of the `gdi` and `fractals` packages.
New in Agena 2.21.10 (Sep 23, 2020)
- `os.list` and thus also `os.whereis`, `os.findfiles`, `skycrane.fcopy` and `skycrane.move` could not recurse into subdirectories from root. This has been fixed.
- Likewise, `os.list` threw an error when trying to access a directory without proper permission. This has been fixed, as well.
- There are special cumulatative installers with the complete Agena edition for ArcaOS (OS/2), DOS and Windows. For all other operating systems, you will find the update in the Binaries/Agena 2.21.10 Sourceforge folder, file `agena-2.21.10-update1.zip`. Download it and check the instructions in the accompanying read.me file on how to install this library update.
- OS/2, eCS & ArcaOS: The installer is now created with WarpIN 1.0.24 under ArcaOS.
New in Agena 2.21.9 (Aug 26, 2020)
- Added a binding to the GNU Multiple Precision Floating-Point Reliable Library (MPFR). The binding unfortunately is not available on Mac OS X as it cannot be compiled there.
- Tuned `linalg.backsub`, `linalg.forsub` and `linalg.rref` by four percent.
- `calc.gtrap`, `calc.fminbr`, `calc.fmings`, `linalg.rref`, `linalg.backsub` and `linalg.forsub` have been tuned a little bit. If you want to change the precision of these functions, then you now have to call `envion.kernel` with the 'eps' key.
- The C API function `lua_setmetatabletoobject` has been extended to delete metatables and optionally user-defined types.
New in Agena 2.21.8 (Aug 18, 2020)
- The new function `math.rempio2` conducts argument reduction into the range -Pi/2 .. Pi/2, avoiding computational overhead.
- The new function `multiple` checks whether a number is a multiple of another number.
- `cot` and `csc` returned a very large or very small value instead of `undefined` if their argument was a multiple of Pi. This has been fixed.
- Likewise, `sec` now returns `undefined` if its argument is a multiple of Pi/2.
- `integral` can now evaluate complex numbers. If the real part is integral and the imaginary part is zero, then it returns `true` and `false` otherwise. Likewise, with a complex number, `float` returns `true` if its real part is non-integral and the imaginary part is zero.
- `environ.system` now returns the setting of the GNU C environment variable FLT_RADIX with the new 'floatradix' key. Its value usually is 2.
- You can get and set the current value of 'DoubleEps' with the new `environ.kernel/doubleeps` feature. `multiple`, `calc.bernoulli`, `calc.euler` and `calc.lambda` now query this real-time value instead of using a hard-coded one.
- `environ.kernel/eps` did not change the system variable "Eps" in the environment. This has been fixed.
- The C API function `agn_getepsilon` has been changed to a macro, speeding up access.
- The new C API macro `agn_getdblepsilon` returns the current value of "DoubleEps" as used in the environment.
- The new C API function `agn_setdblepsilon` sets the current value of "DoubleEps" for subsequent use in the environment.
New in Agena 2.21.7 (Aug 10, 2020)
- The new function `erfi` computes the imaginary error function erfi(z) = -I*erf(I*z) for real and complex z.
- The new function `pytha` computes the Pythagorean equation c^2 = a^2 + b^2, without undue underflow or overflow.
- Added two new value-based hashing functions for unsigned 4-byte integers, ported from Julia: `hashes.j32to32` and `hashes.jinteger`.
- With complex arguments `cosc` has become seven percent faster.
- In OS/2 and DOS, the `cis` operator has become 30 % faster with complex arguments.
- Extended mathematical test cases.
New in Agena 2.21.6 (Jul 27, 2020)
- `sinc` in the real domain has become more numerically stable near zero.
- For real and complex arguments, introduced the scaled complementary error function `erfcx`(x) = exp(x^2) * erfc(x) which can used instead of `erfc` to avoid arithmetic underflow.
- Added the new scaled Dawson integral function `calc.scaleddawson` which returns 2*calc.dawson(x)/sqrt(Pi).
- The new function `calc.w` computes the scaled complex complementary error function w(z) = exp(-z^2) * erfc(-I*z).
- The new function `math.relerror` computes the relative error function, handling case of `undefined` and `infinity`.
- Introduced the new conversion specifier `b` to `strings.format` to print binary values.
- In `strings.format`, the `a`, `A`, `q`, `Q` and `B` specifiers now recognise length indicators.
- The new C API function `agn_isfloat` checks whether a number is a non-integtral float.
New in Agena 2.21.5 (Jul 10, 2020)
- Implemented the new inverse (complimentary) error functions `inverf` and `inverfc`.
- The new function `stats.probit` computes the inverse of the cumulative distribution function of the standard normal distribution.
- The new function `stats.cdfnormald` implements the cumulative density function for the standard normal distribution.
- Standardised error messages of `stats.studentst`, `stats.chisquare`, `stats.fratio`, `stats.cauchy`, `stats.pdf`, `stats.ndf`, `stats.nde`, `stats.neighbours`, `stats.nearby`.
- `io.readfile`, `io.readlines`, `io.nlines`, `io.skiplines` and `io.infile` each have become 20 percent faster.
- When calling `calc.chebycoeffs`, the left border must now always be less than the right border.
- The new functions `os.isarm`, `os.isppc` and `os.isx86` check whether Agena is being run on an ARM, PPC, or x86 CPU, 32- or 64-bit.
- The `stats` package could not be initialised for the parser thought that an upvalue in a closure was a constant which it was not. This has been hot-fixed. As for now, if you try to change a constant in a closure, the parser will not issue an error any longer.
- Updated the Primer & Reference according to the suggestions of an unknown user, primarily the description of `strings.format`.
New in Agena 2.21.4 (Jul 5, 2020)
- The new function `copyadd` copies all elements in a table, sequence or register and any further arguments into a new structure.
- The new function `tables.getsizes` returns the estimated or actual number of elements currently stored in the array and hash part of a table.
- The new function `calc.curvature` determines the curvature of a real univariate or multivariate function at a given point.
- `calc.eulerdiff` can now compute second derivatives by passing the new `deriv = 2` option. The quality of the second derivatives are close to, but not as good as, those of `calc.xpdiff`. (The first derivatives of `eulerdiff` are still better than those of `xpdiff`.)
- `The new function `calc.gauleg` computes the integral of a univariate function using Gauss-Legendre integration. It is five times faster than `calc.integ` with comparable precision.
- The new function `calc.variance` returns an estimate on whether a univariate function changes slowly or rapidly on a given interval.
- The new function `calc.fmings` estimates the minimum location of a univariate function over a given range, using Golden section search only.
- Documented function `calc.fminbr` which estimates the minimum location of a univariate function over a given range, using Golden section search combined with parabolic interpolation.
- `calc.integ` has been improved in that with finite integrals, it switches to a second method if the first one fails.
- If `calc.arclen` could not find a solution at first, it will now automatically try an alternative to compute a result.
New in Agena 2.21.3 (Jun 30, 2020)
- The new `?-` token checks an expression and executes a one-line statement if it evaluates to `false`, `fail` or `null`.
- The new function `os.whereis` searches for a given file, link or directory in a directory, optionally including subdirectories.
- If a string included the substring '*/' or '/#', Agena crashed. This long-time bug has been fixed.
- On the interactive level, if you define one and the same constant multiple times in a body, for example `then` or `do` body, Agena will just print a one-time warning message and will change that constant. When executing a script file, however, Agena would quit execution with a proper error message. (This is due to the way the parser evaluates bodies on the command-line.)
New in Agena 2.21.2 (Jun 22, 2020)
- The C API function `lua_getfield` has become at least 10 percent faster, and `lua_gettable` 5 percent faster. They new also return the type pushed onto the stack. The tuning benefits some functions in the basic, `os`, `io`, `bags`, `linalg`, `llist`, `ulist` and `environ` libraries.
- `lua_toint32_t`, `lua_touint32_t`, `lua_tooff64_t`, `lua_tointegerx`, `lua_tounsignedx` have each been tuned by 40 percent. This speeds up functions in the `binio`, `calc`, `com`, `llist`, `ulist`, `memfile` and `numarray` packages.
- `agn_seqgetinumber`, `agn_reggetinumber` and `lua_seqrawgetinumber` have each been tuned by 4 percent, but the benfit to functions which use them (`calc`, `stats` and `numarray` packages) should be marginal.
- For source code consistency only, the C API functions `lua_settable` and `lua_setfield` have been updated to the Lua 5.4.0 RC 5 implementation, but there is no noticable performance gain.
- Fixed the problems with constants:
- If you try to change a constant by using the post-fix `++` or `--` increment and decrement operators, Agena now issues an error.
- When trying to assign a value to a constant in `if` or `while` conditions, e.g. `if f := 1 then ...` or `while f := 1 do ...`, an error will be issued, as well.
- `create` and `create local` statements can no longer overwrite constants.
- Constants should no longer be overwritten in interactive mode.
- Added the following C API functions, taken from Lua 5.4.0 RC 5, in some cases just for compatibility with future code that might be merged into Agena:
- `lua_absindex` converts an acceptable stack index into an absolute index.
- `lua_getiuservalue` pushes onto the stack the n-th user value associated with a userdata, reduced to always n = 1.
- `lua_newuserdatauv` is just a wrapper to lua_newuserdata.
- `lua_numbertointeger` is a mcro converting a float with an integral value to an integer.
- `lua_pushglobaltable` is a macro that pushes the global environment onto the stack.
- `lua_rawgetp` pushes a table value with the key a pointer to a lightuserdata.
- `lua_rawsetp` sets any value to a table with the key being a lightuserdata.
- `luaL_argexpected` checks whether a C condition is true.
- `luaL_addgsub` adds a string to the buffer, first replaces any occurrence of a pattern in the string to be added with another pattern.
- `luaL_getsubtable` pushes a subtable in a table to the stack, or adds a new empty subtable to the table and pushes the new subtable onto it.
- `luaL_setfuncs` registers all functions in a luaL_Reg array into the table on the top of the stack.
New in Agena 2.21.1 (Jun 22, 2020)
- The new function `tables.swap` swaps two elements in a table.
- The new function `tables.move`, taken from Lua 5.4, copies elements, either from one table to another table or shifts elements within the same table.
- The new function `environ.warn`, taken from Lua 5.4, emits a warning with a message. It is an alternative to `environ.infolevel`/`environ.userinfo` but does not allow to switch info messages on or off for an individual function.
- `environ.kernel` allows to query and set the warning mode.
- `strings.dump` may now be given a Boolean option, which controls whether debug information shall be stripped from the binary representation, to save space.
- Instead of passing a function to `zip`, you can now pass a string indicating an arithmetic operator to be used to zip together two structures. This is twice as fast with sequences and registers, and 50 % faster with tables.
- Besides numbers and strings, `memfile.charbuf` and `memfile.append` can now also add Booleans and `null` to a memory file without having to convert them to strings before, by calling `tostring`. You can now also specify an optional delimiter that separates each value to be added to the memory file, e.g. `memfile.append(m, 'a', 'b', 'c', delim = ';')` actually adds the string 'a;b;c;'.
- By passing a non-zero optional number, `memfile.dump` can now delete the given number of characters from the end of a memory file. In addition, error messages have been improved.
- The new system variable `environ.version` represents the Agena version as a float, contrary to `environ.release` which contains version information in a sequence.
- Updated the `utf8` package to the UTF8 library implemented in Lua 5.4.0 RC 4
- As the decoding functions in the `utf8` library do not accept surrogates as valid code points, an extra parameter `lax` in the functions makes them more permissive.
- In Agena, in error conditions, `null` is still being returned, instead of (Lua's) `fail`.
- With strings, `tonumber` and the C API functions `agn_tonumberx`, `lua_tonumber`, `lua_tointeger`, and `lua_isnumber` have become 40 % faster.
- `inc`, `dec`, `mul`, `div` and compound assignment statements like `+:=`, etc. could modify constants. This has been fixed. (Postfix `++` and `--` operators still do not check for constants und modify them.)
- The new C API function `agnL_getsetting` returns the integral representation for a given string in a list.
- The new C API function `luaL_checksetting` checks whether a string in the stack is part of a list.
- Added new C API functions, all taken from Lua 5.4
- `lua_rotate` rotates stack elements up- or downwards.
- `lua_copy` copies a stack element to a given poition, overwriting the existing one.
- `lua_compare` compares two stack values.
- `lua_arith` performs arithmetic on stack values.
- `lua_geti` pushes a table value onto the stack, for a given integral key.
- `lua_seti` sets a value into a table, for a given integral key.
- `lua_setwarnf` sets the system's warning status.
- `lua_getwarnf` retrieves the system's current warning status.
- `lua_warning` emits a warning, or can switch the warning system on or off.
- `lua_stringtonumber` converts a string to a number and pushes it onto the stack.
- `lua_isnone` checks whether a stack index is acceptable, but not valid.
- `lua_isyieldable` checks whether a coroutine can yield.
- The `com` package did not compile on some Linux platforms. This has been fixed.
- Updated the Agena Crash Course.
- As always, this release has been checked on x86 Linux (Raspian Stretch) to ensure there are no memory leaks.
New in Agena 2.21.0 (Jun 10, 2020)
- Added a general alternative to the `..` table field separator that indicates Agena not to issue an error if a `null` value shall be indexed: curly braces.
- Added the new pseudo type 'basic' which stands for a number, string, Boolean, or 'null' type. If given in a parameter list of a function, then Agena checks whether the respective argument is of one of the types mentioned before - if not, an error is issued. The new type can also be passed as the right operand to `::` and `:-`.
- `io.write` and `io.writeline` now accept null's as arguments - you do not have to convert them with `tostring` any longer before.
- The new function `tostringx` works like `tostring` but also formats structures, userdata and complex numbers the same way as the prettyprinter does, or in other words: it returns the argument as a string formatted the same way as the `print` function outputs it on screen. This is useful if you want to write structures or complex numbers to a file.
- The `memfile` package has now become an integral part of the interpreter and is no longer a plus package. Thus, you do not have to invoke it with the `import` statement any longer.
- If a userdata is part of a structure, the prettyprinter now fully prints userdata for which there is a __tostring metamethod, instead of just issuing 'userdata()'.
- The prettyprinter has been changed internally and now first collects all the data in memory before outputting it at the console.
- Error messages of `cis`, `notin`, `zero` and `nonzero` have been improved.
- The new C API function `lua_hasfield` checks whether a table includes a field and returns true (1) or false (0).
New in Agena 2.20.3 (May 21, 2020)
- Bug Fixes:
- `reduce` inadvertently deleted a user-defined global variable _c. This has been fixed.
- In ill-fated situations, factories written in C may have caused problems with the internal table that stores all constants, potentially causing segmentation faults. This has been fixed.
- Changes to the C API:
- Removed unused or obsolete C API functions agn_stackborders, agn_isvalidindex, agn_absindex, agn_calloc, agn_free, agn_rawgetifield, lua_seqrawget2, agn_regrawget2, agn_getseqlstring.
- Renamed C API function agn_datetosecs to agnL_datetosecs, and agn_pairgetinumbers to agnL_pairgetinumbers, agn_paircheckbooloption to agnL_paircheckbooloption.
- `lua_seqrawget` now needs a third argument which controls whether in case of a non-existent key `null` or an error will be issued.
- `agnL_geti` can now process pairs and strings.
- Removed various C API macros.
New in Agena 2.20.2 (May 19, 2020)
- The new function `calc.bernoulli` computes the n-th Bernoulli number Bn.
- The new function `calc.euler` computes the n-th Euler number En.
- The new function `calc.lambda` computes the Lambda function and its derivative of integral order.
- By passing any option to `debug.getlocals`, only an array of parameter and local variable names plus the number of parameters (first entries in the array) is returned.
- `debug.getinfo`, with the new 'V' option, returns a table with all parameters and locals of an Agena function.
- Where unfitting, functions do no longer print an indication of a given type in error messages.
- Removed all undocumented Lua 5.3.5 string buffer C API functions.
- Some few internal changes to the parser with no effect on functionality. Also documented almost all lcode.c functions.
- The new C API function agnL_geti returns the i'th entry in a table, register, sequence or numarray and pushes it onto the top of the stack.
- Improved the Primer and Reference as well as the Crash Course.
New in Agena 2.20.1 (May 7, 2020)
- The `::` and `:-` type check operators have been extended: If a user-defined type has been declared for an object, and if a basic type is passed to the operators as the right operand, they will now perform a check for the given basic type. Formerly, the operators in this situation always returned `false`. With registers, the `:-` operator now checks for user-defined types, as well.
- If an empty set has been passed to `::` or `:-` as the right operand, they now return an error.
- Added the new pseudo-type 'anything' which stands for any type, including 'null'. If given in a parameter list of a function, then Agena checks whether the corresponding argument, regardless of its type, even 'null', has been passed in a function call - if not, an error is issued. The idea has been taken from Maple. The new type can also be passed as the right operand to `::` and `:-`.
- Added the new pseudo-type 'listing' which identifies a table, sequence or set in the parameter list of a procedure. The new type can be passed as the right operand to `::` and `:-`, too.
- You can switch off all duplicates warnings (variables shadowed / declared multiple times) introduced with 2.20.0 by issueing: > environ.kernel(duplicates = false)
- See also the lib/agenaini.spl sample initialisation file which now includes preparations to switch off duplicate warnings and the new constants feature. (Uncomment the respective settings in paragraph `User-defined Initialisation of Kernel Settings` and rename the file to agena.ini if you like.)
- The `:-` operator ignored a given user-defined type and always returned `true`. Also, the `:-` operator returned a wrong result with userdata for which no user-defined type has been declared. Both issues have been fixed.
- Added new C API functions agn_getduplicates and agn_setduplicates to read current duplicates-shadowing setting and to switch warnings on or off.
- Added new C API function (lset.c) agnUS_setstr2set to insert a string (exactly: TString) into a set.
- Some features introduced with 2.20.0 had not been included in the change log and are now described here:
- Introduced the new function `pipeline` which maps one or more functions on a table, set, sequence, register or userdata, avoiding multiple internal copies of a structure if possible.
- Added new C API functions (lapi.c) agn_getconstants and agn_setconstants to switch the constants feature on or off.
- Added new C API function (lset.c) agnUS_delstr to easily and safely delete a string (exactly: TString) from a set.
New in Agena 2.20.0 (May 4, 2020)
- You can now declare constants. If you try to assign a new value to the constant later on in a session, the interpreter issues an error
- You can switch off this new feature completely with the following statement: environ.kernel(constants = false)
- Enumerations now automatically declare constants
- Added parser warnings for duplicate local variable declaration. The feature has originally been written by Domingo Alvarez Duarte for Lua 5.1. As with the new constants feature, only the parser has been modified so that you will not notice any performance decrease.
- `E`, `EulerGamma`, `Pi`, `Pi2`, `PiO2`, `PiO4`, `degrees`, `infinity`, `radians` and `undefined` have become constants. You cannot overwrite them any longer.
- The golden ratio `math.Phi` has been renamed to just `Phi`, a constant. An alias has been provided to ensure backward compatibility.
- `everyth` now also accepts two integers k, n and returns the Agena equivalent k % n = 0, a Boolean.
- The `if is` operator now accepts a trailing semicolon in `return` statements.
- `debug.getconstants` returns the internal set that stores global constants.
New in Agena 2.19.1 (Apr 21, 2020)
- Re-introduced Lua 5.1 function `ipairs` with extended functionality to iterate over structures, strings and userdata - such like bags, numarrays, ulists and llists, etc. - in a standardised fashion. Also re-introduced `pairs` to iterate dictionaries.
- With negative out-of-range indices, `numarray.subarray` and thus numarray's '__index' metamethod always returned the internal registry table. This has been fixed.
- Significantly improved Chapter 5.2.8 `for/in Loops over Procedures` in the Primer and Reference.
- Corrected Chapter 7.50 `com - Serial RS-232 Communication through COM Ports` of the Primer and Reference.
- Described all RS-232 `com` package functions in the Quick Reference.
- The new C API function agnL_getmetafield fetches the given metamethod and contrary to luaL_getmetafield also checks whether it is a procedure.
New in Agena 2.19.0 (Apr 16, 2020)
- A new major release with an important bug fix:
- The `while` statement now accepts a simple assignment as a condition. If an assignment is given in the `while` clause, its right-hand side is evaluated and stored to the left-hand side name. The result of the evaluation is then checked and either the loop body is executed or not.
- `if` and `case of` statements also support this new feature, and their optional `elif` and `of` clauses, as well.
- In `case` statements, the `else` clause may now be finished by the `esle` keyword. This new keyword is just a code beautifier, it has no functionality at all. `case` statements do not support the new assignment feature.
- The `case` statement did not correctly evaluate function calls like "case os.winver() of ..." and always executed the `else` part if it existed. This has been fixed.
- The `com` package has now been documented in the Primer and Reference.
- `case of` statements are described in Chapter 5.1.6 of the Primer and Reference.
- The Agena Crash Course has been updated.
- Fixed a table-of-contents issue in the Primer and Reference.
- As always, this release has been Valgrind-checked on x86 Linux to ensure there are no memory leaks.
New in Agena 2.18.2 (Apr 14, 2020)
- In UNIX, `io.maxopenfiles` can now also change the maximum number of open files.
- In Solaris, `os.cpuinfo` now returns information on the CPU installed, instead of just `fail`.
- The `numarray` package can now handle unsigned 2-byte integers (uint16_t's). To create an array of uint16_t's, call `numarray.ushort`. To read a file of uint16_t's, call `numarray.readushorts`.
- `environ.system` now returns the maximum value representable in an unsigned 2-byte integer in the new field 'maxushort', and the corresponding C type 'uint16_t'.
- `bytes.tobytes` and `bytes.tonumber` can now treat unsigned 2-byte integers.
- `math.ulp` now optionally returns the number of ULPs between two values.
- Introduced the new `com` package which allows to send and receive data through RS-232 COM ports. The package is still experimental but has been successfully tested in Windows using virtual COM ports. For an example and the documentation, please refer to the `com.c` source file.
- `select`, `selectremove` and `remove` could crash if given a wrong type to the right-hand side of the 'newarray' option. This has been fixed.
- Corrected error messages of `stack.insertd` and `stack.replaced`.
- The `memfile` package accidently was not included in the DOS version. This has been changed.
- Fixed a blank-page and page number issue with the Primer and Reference.
- Patched the sources to prevent compiler warnings in UNIX-like GCC environment, e.g. Mac OS X, Debian Stretch and DJGPP/DOS.
- Successfully compiled Agena in OS/2 with gcc 8.3.0. The interpreter, however, became 13 percent slower, so switched back to gcc 4.4.6.
- The new C macro `lua_rawsetstringchar` sets a C char integer value, converted to a string, into a table.
New in Agena 2.18.1 (Apr 6, 2020)
- `math.normalise` now computes the normalised value according to Sun Microsystems's implementation which is more precise. By passing any optional argument, the high 4-byte word of the normalised value is returned, too.
- The new function `math.mulsign` multiplies, not copies, its first argument with the sign of its second.
- The new function `skycrane.isemail` checks whether a string represents a valid E-mail address.
- The following functions now accept numarrays as input: `stats.colnorm`, `stats.cumsum`, `stats.deltalist`, `stats.fivenum`, `stats.fprod`, `stats.fsum`, `stats.ios`, `stats.iqmean`, `stats.issorted`, `stats.mad`, `stats.md`, `stats.meanmed`, `stats.median`, `stats.midrange`, `stats.minmax`, `stats.prange`, `stats.quartiles`, `stats.rownorm`, `stats.smallest`, `stats.sumdata`, `stats.sumdataln`, `stats.trimean`.
- Some mathematical baselib and `stats` functions have been tweaked a little bit.
- `os.cpuload` crashed on Windows XP. This has been fixed.
- In Windows 2000 and earlier, with more than 1024 MBytes of installed RAM, `os.memstate` returned wrong results. This has been fixed.
- On Windows XP and earlier, `strings.format` cannot process the %h and %H modifiers. The function now issues an error in these versions.
New in Agena 2.18.0 (Apr 6, 2020)
- General updates and changes:
- You can now add, subtract, multiply and divide numbers with `true` or `false`, where `true` in this context represents number 1 and `false` or `fail` number 0. Thus, you do not have to call `abs` any longer if you want to avoid the `if` operator, e.g. abs(x > 0)*x and (x > 0)*x are now equivalent expressions.
- Booleans can now be added, subtracted, multiplied and divided.
- Streamlined the order of parameters of `functional programming`-style procedures:
- `satisfy` can now be called as described in the Primer and Referencefirst pass the function, then the object, and after that optional function arguments.
- Likewise, `recurse` and `descend` now accept the function as the first argument, and the object as its second.
- The changes to `recurse`, `descend` and `satisfy` are all downward-compatible, so the arguments can alternatively still be given as in the past.
- The new function `math.ramp` gives x if x > 0 and 0 otherwise.
- The new function `math.unitstep` gives 0 for x < 0 and 1 otherwise.
- New `math.piecewiese` implements piecewise-continuous functions.
- The `notin` operator now supports metamethods for all structures plus userdata.
- numarray package:
- The `obj[a to b]` indexing method to retrieve table items, substrings, etc. can now also be applied on numarrays.
- Three new metamethods have been added to the `numarray` package:
- the `zero` operator can now check whether all alements in an array are zeros,
- the `nonzero` operator can now check whether all alements in an array are non-zeros,
- the `notin` operator can now check whether an elememt is not part of an array.
- The `__in` metamethod has been implemented in C instead of Agena.
- The new function `numarray.satisfy` checks whether all elements in an array satisfy a given condition.
- The new function `numarray.map` applies a function on each element of a numarray and returns a new numarray.
- The new function `numarray.convert` works like `numarray.map`, but processes in-place, just changing the contents of the given numarray.
- The new function `numarray.sort` sorts a double numarray in ascending order, in-place.
- `numarray.write` has been rewritten and consumes much less memory than before, avoiding out-of-memory errors with large arrays.
- Fixed error messages of `numarray.getitem`.
- The following `stats` functions can now process numarrays of type double`acf`, `acv`, `ad`, `amean`, `covar`, `durbinwatson`,
- `gini`, `hmean`, `meanvar`, `moment`, `standardise`.
- memfile package:
- The new function `memfile.map` maps a function on each character in a memfile, in-place.
- The new function `memfile.replicate` creates a copy of a memory file.
- The `notin` operator can now check whether an elememt is not part of a memory file.
- `memfile.substring` did not accept a negative stop value. This has been fixed.
- llist package:
- The `notin` operator can now check whether an elememt is not part of a llist or ulist.
- bags package:
- Added the new function `bags.getsize` to quickly determine the number of unique elements in a bag without the overhead of
- calling `bags.attrib`.
- Added support of `size`, `notin`, `empty` and `filled` metamethods.
New in Agena 2.17.8 (Mar 26, 2020)
- The `obj[a to b]` indexing method to retrieve table items, substrings, etc. can now also be applied on userdata.
- Introduced the new `memfile` package which simply collects substrings, i.e. combines them together. It is 20 times faster than simply concatening them iteratively with the `&` operator.
- `binio.open` can now open a file in append mode, by passing the 'a' option, so you no longer have to call `binio.toend` after `binio.open` to prevent overwriting the beginning of a file.
- If `numarray.write` wrote that entire contents of a numarray, it now automatically flushes all unwritten content to the file so that you do not have to call `binio.sync` manually any longer.
- Tuned all functions and operators that internally compare strings or internally determine string lenghts.
- Tweaked `strings.tobytes`.
- The sources are now being checked with Valgrind 3.15.0 for security leaks.
New in Agena 2.17.7 (Mar 20, 2020)
- In all editions, tweaked complex versions of `arccoth` and `cosc`. Also tuned `stats.chisquare`, `stats.fivenum`, `stats.fratio`, `stats.gsmm`, `stats.mad`, `stats.md`, `stats.meanmed`, `stats.median`, `stats.midrange`, `stats.normald`, `stats.smm`, `stats.studentst`, `stats.trimean`, `calc.fminbr`, `calc.gtrap`, `calc.limit`, `calc.savgol`.
- In DOS and OS/2, with complex arguments, tweaked `arcsin`, `arcsinh`, `arccos`, `arcsec`, `arctan`, `arctan2` and `erf`.
- Some source code cleansing. Note that on PowerPC Linux and Raspberry Pi, the sources currently do not compile.
New in Agena 2.17.6 (Mar 20, 2020)
- This edition implements changes in the OS/2 and DOS editions of Agena only.
- In OS/2 and DOS, the `recip` operator has been changed such that the imaginary unit can never be -0 (minus 0), thus preventing wrong results with inverse trigonometric functions in the complex domain.
- The implementation of `arccsc` in OS/2 and DOS has been changed back to the original one, thus boosting the function.
- The new C API function `agn_getcmplxparts` returns the real and imaginary parts of a complex number.
- The new C API macro `agn_pushcomplex` pushes a complex number onto the stack.
New in Agena 2.17.5 (Mar 12, 2020)
- A long existing bug has been found: in the complex domain, arcsin(z) returned `undefined` instead of a complex result if imag(z) = 0 and real(z) notin -1:1.
- This bug also affected the following operators and functions with complex arguments since they internally call `arcsin`
- arccos(z), if imag(z) = 0 and real(z) notin -1:1.
- arcsinh(z), if real(z) = 0 and imag(z) notin -1:1.
- arcsec(z) and arccsc(z), if imag(z) = 0 and real(z) in -1:1 (open interval).
- There were no such bugs if numeric, non-complex arguments have been given.
- All the bugs mentioned above have been fully fixed in the Solaris, Windows, Linux and Max OS X versions. The fixes in OS/2 and DOS, however, are preliminary since they do not completely solve the problem.
- The test cases have been extended and a glitch in a complex arithmetic validation procedure has been removed.
- Sometimes `os.cpuload` issued an error when it could not read out performance values. This has been changed: the function now just returns `fail`.
New in Agena 2.17.4 (Mar 10, 2020)
- In OS/2 and Windows, the new function `os.mousestate` returns information on the position of the attached mouse and on button clicks plus some operating system-dependent data.
- In OS/2, `os.mouse` also returns the number of mickeys, whether mouse data is in mickeys, the threshold, and row and column scaling factors.
- In OS/2 the new functions `os.getextlibpath` and `os.setextlibpath` query and set the paths to be searched before and after system LIBPATH, when tyring to locate DLLs.
- In OS/2, the new function `os.mouseflush` flushes the mouse queue.
- `bytes.peek` has been removed as it was more or less a duplicate of `bytes.tobytes`. On Big Endian systems, `bytes.tobytes` can now alternatively suppress automatic conversion to Little Endian representation by passing the new third option `false`.
- `bytes.tobytes` no longer is dependent on the setting of `environ.kernel/signedbits`: if you pass +4 as the seond argument, independent of the setting, the bytes of an unsigned 4-byte integer are returned. If you pass -4 as the seond argument, the first argument is assumed to be a signed 4-byte integer.
- In the real domain, `besselj`, `bessely` and `lngamma` have become 15 percent faster each, thus also speeding up `beta`, `math.lnfact` and `math.pochhammer`.
- In the real domain, `gamma` has become 35 percent faster, thus also benefiting `stats.studentst`, `stats.chisquare`.
- `bytes.tobinary` has been tuned by 20 percent.
- In OS/2 and Windows, `os.beep` autocorrects invalid frequencies that are not in the range 37 .. 32767 Hz as the underlying C API operating system functions would not work otherwise.
- `binomial` returned `undefined` instead of 0 if the difference of its arguments was a negative integer. This has been fixed. The function has also become ten percent faster with fractional arguments, and its C code now is fully portable.
- Added C API macro `lua_rawsetiboolean` to set a Boolean into a table at a given position.
New in Agena 2.17.3 (Mar 10, 2020)
- This edition primarily implements improvements to the OS/2, DOS and Windows versions of Agena. Thus, there are no non-`DOS-based` installers for download available.
- The formerly undocumented function `os.codepage` gets and sets the input and output codepage in OS/2, DOS and Windows.
- `os.curdir`, which returns the current working directory, has been re-introduced.
- `os.beep` no longer accepts negative frequencies and duration. In DOS, the tone can now be modulated with a given frequency and duration. Furthermore, in OS/2, DOS and Windows, the function also autocorrects invalid frequencies into the range 0 .. 32767 without issueing errors.
- In OS/2, DOS, Windows and Linux, `os.vga` now returns the number of rows and columns of the active console. In OS/2, the number of colours and pixel depth is also determined.
- `os.mousebuttons` has been deprecated and its functionality has been migrated to `os.mouse`. In OS/2 and DOS, `os.mouse` now returns the number of mouse buttons. An alias has been provided to ensure backward compatibility.
- `strings.tobytes` did not correctly treat the non-word aligned rest of a string. This has been fixed.
- The new function `bytes.peek` returns all bytes of a number and works for unsigned and signed 4-byte integers and 8-byte C doubles.
- Removed the undocumented keywords `mne`, `mneop`, `peek`, `poke`, `up`, and its associated functionality.
- Removed commented C code from the source files.
New in Agena 2.17.2 (Mar 10, 2020)
- This edition primarily implements improvements to the OS/2, DOS and Windows versions of Agena. Thus, there are no non-`DOS-based` installers this time.
- `os.drives` (available drive letters) and `os.drivestat` (info on file systems) now return drive information in both the OS/2 and DOS version of Agena.
- Agena for DOS now supports `os.realpath`.
- In DOS, `io.sync`, `binio.sync` and `ads.sync` now flush the write-behind disk caches, as well.
- `os.drives` now appends a colon to each drive letter.
- When being passed a 4-byte integer, `bytes.tobytes` now checks whether it is in signed or unsigned mode so that there are no accidental overflows. The description of the function in the Primer and Reference has been corrected, as well.
- `strings.tobytes` now alternatively splits a string into 4-byte unsigned integers instead of single bytes.
New in Agena 2.17.1 (Feb 16, 2020)
- The new function `math.xlnplusone` computes x - ln(1 + x) in a way that is accurate even if x is near zero.
- The new factory `os.iterate` creates a function that when called traverses a directory and optionally also returns the `file system` type (file, directory, link, etc.).
- The new function `hashes.interweave` splits a number into its higher and lower unsigned 4-byte words and applies one of the following binary operations: `or`, `and` or `xor`. Optionally, it also condcts mask, bit-shift and modulus operations.
- The integer division operator `` with non-complex numbers, and the `iqr` function have become six percent faster.
- With non-complex numbers, the `sign` and `signum` operators have become at least four percent faster.
- Removed glitches from both `os.list` and underlying `os.listcore` when passing an optional single `*` wildcard search pattern. Furthermore, on some operating systems unnecessary additional queries of file attributes are prevented, speeding up both functions.
- `utils.unhexlify` did not work. This has been fixed.
- `bytes.numwords` returned a wrong unbiased exponent with argument 0. This has been fixed.
- Hardened `strings.format`, `os.islocale` and `os.fcopy` against unexpected internal memory allocation errors.
- For at least the last six months, the portable version of Agena for Windows unfortunately included an `agena.ini` initialisation file that might have overwritten the user-created one. The file has now been removed from the ZIP distribution.
New in Agena 2.17.0 (Feb 3, 2020)
- The new binary `notin` operator checks whether an element is not part of a table, pair, set, sequence or register. With strings, it checks whether a substring is not part of a string. Thus, `notin` is the negation of the `in` operator, i.e.: not(x in y) = x notin y. It is ten percent faster than the `not`/`in` combination.
- The DOS version now includes the readline command-line feature, for much easier usage of the prompt.
- In the DOS version of Agena, `os.system` now returns a meaningful name instead of '??Unknow' with various DOS flavours different from MS-DOS.
- The `xml` package is now available in the DOS version.
- The new function `os.isdos` can detect various flavours of DOS and optionally also returns various internal version numbers.
- The new function `os.iswindows` checks whether the Windows edition of Agena is being run.
- In Windows, `os.fstat` now returns the compressed size of a file (new key 'compressed'), and the 8.3 DOS name of a file (new key 'dosname').
- `os.isUNIX` has been renamed to `os.isunix`. An alias has been provided to ensure backward compatibility.
- 'os.isANSI` has been renamed to `os.isansi`. An alias has been provided to ensure backward compatibility.
- Improved runtime behaviour of the test suite.
New in Agena 2.16.13 (Jan 27, 2020)
- Added the new function `math.issquare` which checks whether an integer is a perfect square.
- Added the new function `math.iscube` which checks whether an integer is a perfect cube.
- The new function `math.isfib` checks whether an integer is a Fibonacci number.
- The new function `math.lnabs` returns ln(abs(x)) for numeric or complex x. With complex numbers, takes care of underflows.
- The new `invsqrt` operator computes the inverse square root of a (complex) number.
- The new `squareadd` operator computes complex z^2 + c = fma(z, z, c), preventing round-off errors. It is as fast as the Agena expression z**2 + c.
- Fine-tuned internal string buffering functions used by the `replace` and `join` operators.
- Fine-tuned `sin`, `cos`, `sinc`, `tan`, `log2`, `dual` package `sin` and `cos` metamethods, `root`, `proot`, `cbrt`, `cosc`, `cerf`, `gamma`, `tanc`, `cas`, `strings.shannon`, `stats.sorted`, `stats.smm`, `stats.gsmm`, `stats.prange`, `stats.iqmean`, `stats.trimean`, `stats.quartiles`, `stats.fivenum` and `stats.winsor`.
- Added additional application information to the Windows installer.
New in Agena 2.16.12 (Jan 7, 2020)
- The new function `math.uexponent` returns the unbiased exponent of number x, i.e. returns math.exponent(x) - 1, except for x = 0, where the result is -1023.
- `math.fibinv` has been ported to C and has become twice as fast.
- `bytes.getunbiased` has now been patched in C. The slower 2.16.11 Update 2 patch written in Agena has been removed.
- Various functions of the `bytes` package no longer check whether their arguments are in range and thus do not issue any errors any longer. Thus, the strict changes introduced with the previous release have been completely rolled back.
- Use the new `bytes.isint32` function to check whether an integer is the 4-byte integer range. It returns `true` or `false`.
- Since Agena 2.16.5, `strings.find`, `strings.match`, `strings.isabbrev`, `strings.isending`, `strings.hits`, `strings.chomp`, `strings.gseparate` and `strings.advance` did not work efficiently with haystack strings of size 3 or less in case pattern matching was not necessary. The results, however, were correct. Also, on rare systems that do not store strings aligned along the 4 or 8 byte word boundary, the functions may have never returned or even crashed. Both issues have now been fixed.
- The `replace` operator has become ten percent faster.
- Many string search functions and operators have been tuned a little bit.
- The previously undocumented C API function `agn_stralloc` efficiently creates a string buffer of optimal size, aligned along the "long" boundary, and also automatically include terminating zeros.
- Removed undocumented Agena test functions written in C.
New in Agena 2.16.11 (Dec 30, 2019)
- Various functions of the `bytes` package now check whether their arguments are in range and issue an error otherwise.
- Renamed `bytes.gethighofdouble` to `bytes.numhigh`, `bytes.getlowofdouble` to `bytes.numlow`, and `bytes.getwordsofdouble` to `bytes.numwords`; also renamed `bytes.sethighofdouble` to `bytes.setnumhigh`, `bytes.setlowofdouble` to `bytes.setnumlow`, and `bytes.setwordsofdouble` to `bytes.setnumwords`. Aliases have been provided to ensure backward compatibility.
- `bytes.numwords` now also returns the unbiased exponent of its numeric argument as a third result.
- The new function `bytes.getunbiased` returns the unbiased exponent from a doublecast userdata a, equals math.exponent(bytes_gethigh(a)) - 1, except for bytes_gethigh(a) = 0, where it returns -1023.
- `os.remove` & `os.rmdir`: If you pass the new second argument `true`, then the function no longer issues an error if the file or directory to be deleted does not exist. Instead, the function returns `fail`.
- `os.move`: If you pass the new third argument `true`, then the function no longer issues an error if the file to be renamed does not exist or if the destination already exists. Instead, the function just returns `fail`. Also, by default and on all platforms (and if `true` is not given), the function now issues an error if the target destination already exists.
- In OS/2, `os.getenv` and `os.gettemppath` now query the generic `DosScanEnv` C API function instead of the one provided by GCC.
- In UNIX, `os.getenv` should have never worked or may have even caused segmentation faults. This has been fixed.
- In Windows, `os.gettemppath` now returns the path with slashes instead of backslashes.
- In the Windows edition, a potential memory leak during initialisation has been removed.
- The new C API functions agn_checkuint16_t and agn_checkuint32_t check whether their arguments fit into the range of the C uint16_t and uint32_t data types, respectively.
New in Agena 2.16.10 (Dec 5, 2019)
- The new function `os.gettemppath` retrieves the path of the directory designated for temporary files.
- The new function `io.maxopenfiles` returns the maximum number of open files allowed on your system, or sets (Windows only) the maximum number of files that are allowed to be opened simultaneously.
- `os.fcopy` now accepts a third optional argument, a Boolean, which indicates whether to simply overwrite existing files or issue an error. The default is `false`: issue an error.
- If a second argument is passed to `os.execute`, then the function executes an operating system command and returns its output as one string. (See also `io.pcall`.)
- Improved error messages of `io.lines`.
- `os.mkstemp` has been renamed to `io.mkstemp`. An alias has been provided to ensure backward compatibility.
- Corrected description of `os.mkstemp` in the Primer & Reference. Also updated Appendix A1 Operators.
- The new C API function `agnL_readlines` reads in a file or pipe and pushes its entire contents or output as a string onto the top of the stack.
- The new C API function `agnL_pexecute` executes an operating system command and puts the output - a string - onto the top of the stack.
New in Agena 2.16.9 (Nov 13, 2019)
- Some `->` assignment statements involving the `storage` token resulted in syntax errors. This has been fixed.
- The new C API function `agnL_optuint32_t` checks for an optional non-negative number and returns it if given, or a default, in both cases cast to uint32_t.
New in Agena 2.16.8 (Nov 4, 2019)
- The new `hashes.adler32` function computes the Adler32 string hash.
- Various `hashes` string hash functions now accept unsigned 4-byte integer arguments greater than 2^31: `djb`, `djb2`, `fnv`, `jen`, `oaat`, `pl`, `raw`, `sax`, `sdbm`, `sth`, `lua`, `murmur2`, `murmur3`, `murmur3128`, `varlen`, `djb2rot`, `asu`, `elf`, `ap`, `dek`, `bkdr`, `sysv`, `rs`, `bp`, `pjw`, `hashmap`.
- With integer arguments > 2^31, `bytes.cast` returned wrong results, the same with the following `bytes` library functions: `setwordsofdouble`, `sethighofdouble`, `setlowofdouble`, `onebits`, `leadzeros`, `trailzeros`, `mostsigbit`, `leastsigbit`, `reverse`, `setwords`, `sethigh`, `setlow`, `arshift32` and `nextbit`. This has all been fixed.
- Corrected error messages of `bytes.mod32` and `bytes.divmod32`.
New in Agena 2.16.7 (Oct 31, 2019)
- A table can now be assigned to a procedure with the new `storage` feature. This internal table will remain active during a whole session and you can read or write values to it in subsequent calls to the function. This new feature is at least thrice as fast as exchanging data with the registry but only half as fast as closures.
- Changed `watch` to work with an internal storage table instead of the registry.
- If was not possible to insert values into the internal status table of `numarrays`. This has been fixed.
- The way the `registry` package internally stored values caused invalid memory reads at garbage collection. This has been changed. Just use unique strings, not lightuserdata objects, as the first argument to `registry.anchor` and `registry.get`. Thus, `registry.anyid`, which previously created lightuserdata objects, has become obsolete and now just returns the string given, for backward compatibility. Also corrected error message of `registry.anchor`.
New in Agena 2.16.6 (Oct 28, 2019)
- `numarray.write` has become 3.5 % faster when writing numbers (C doubles).
- `math.ispow2` has been tuned by 5 %.
- The new function `watch` implements a simple stop watch.
- `registry.anchor` has been completely rewritten: You can now directly update a value without having to delete it before. Also, if a non-existent value shall be deleted, the function does not issue an error any longer.
- In summary, inserting new values into the registry has now become twice as fast and updating values thrice as fast. Unnecessary
- internal administrative overhead and memory consumption has been removed, as well.
- An example of how to use the registry to store data in an Agena session has been added to Chapter 6.30.
- The `mp` library did not work in Solaris. This has been fixed.
- Fixed `numarray.write` on Big Endian systems.
- Improved error messages of `setmetatable`.
- The new `agn_isinteger` C API function checks whether an integer is stored at a given stack position.
New in Agena 2.16.5 (Oct 14, 2019)
- `strings.random`, `hashes.varlen`, `os.fcopy` now behave correctly if internal memory allocation should fail, i.e. they issue an error now.
- `strings.rotateleft`, `strings.rotateright`, `utils.hexlify` and `utils.unhexlify` have become around 3 percent faster.
- `strings.find`, `strings.match`, `strings.isabbrev`, `strings.isending`, `strings.hits`, `strings.chomp`, `strings.gseparate` and `strings.advance` have been tuned a little bit.
- Fixed internal overflow in the Mac OS X version of `os.time`.
- The new C API function `agn_stralloc` allocates a string buffer of the most efficient size, aligned along the "long" boundary of your system.
New in Agena 2.16.4 (Oct 8, 2019)
- The new function `bytes.muladd32` multiplies two numbers and adds further numbers, using 4-byte unsigned integer arithmetic.
- The new function `bytes.divmod32` returns the quotient and remainder of a 4-byte division.
- The new function `bytes.nextbit` gets and clears the next bit from an unsigned 4-byte mask, starting with the most significant bit.
- The new function `hashes.crc8` performs an 8-bit reversed cyclic redundancy check for a string.
- The C API function `agn_calloc` has been extended to optionally free values at failure.
- The `binio` package has been fixed to correctly read and write numbers on Big Endian platforms.
- The GMP dynamic link library is now included in the Windows installer.
New in Agena 2.16.3 (Oct 8, 2019)
- The new `mp` package is a binding to the GNU Multiple Precision Arithmetic Library (GMP), providing multiple functions to conduct signed and unsigned integer arithmetic of arbitrary precision. There are also some functions in lib/mp.agn which demonstrate RSA encryption with private and public keys. The package is not available in the Mac OS X edition.
- The new function `utils.hexlify` converts a string to its hexadecimal representation where each character is replaced by a two-digit hexadecimal value.
- The new function `utils.unhexlify` conducts the opposite operation of `utils.hexlify`.
- The new functions `strings.rotateleft` and `strings.rotateright` conduct bitwise rotation on strings, with optional xoring.
- `binio.writenumber` and `binio.readnumber` have become ten percent faster.
- `hashes.mix64` and `hashes.mix64to32` should now return correct results.
- The new C API function `agn_calloc` allocates memory using C's calloc function and includes error handling.
New in Agena 2.16.2 (Sep 22, 2019)
- `strings.isutf8` returned wrong results in the second return and confusing results in its first return. Thus, the algorithm used to check for UTF-8 strings has become much stricter and now returns only one value. If you still want to use the old algorithm, use the new function `strings.multibyte`.
- Added a new parameter to `strings.separate` which causes the function to return a sequence instead of `fail` in certain situations, so that it can be more comfortably used in for/in loops.
- Argument check in `os.date` has been improved.
- Agena crashed when passing a sequence or register of more than six values to `os.time`. This has been fixed.
- The OS/2 WarpIN installer has been improved a little bit (at least I hope so).
New in Agena 2.16.1 (Sep 3, 2019)
- The new `negate` statement flips a Boolean from `true` to `false`, and `false` or `fail` to true. With a number, it converts its argument to 1 if it is 0, and a non-zero number to 0.
- The new function `strings.isgraph` checks whether a string consists of glyphs only. It is a direct port to the C function `isgraph`.
- The new function `strings.isascii` checks whether a string consists entirely of unsiged char 7-bit characters that fit into the UK/US character set. It is a direct port to the C function `isascii`.
- String indexing and the `for/in` loop on strings now work with embedded '