Agena Changelog

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 '' characters, i.e. embedded zeros are being processed and do not cause out-of-range errors or loop termination any longer.
  • The prettyprinter now completely writes strings with embedded zeros at the console.
  • Please note that most other string processing functions and operators cannot detect embedded zeros and still finish when they are encountered.
  • The new function `strings.strlen` determines the lengths of a string by calling both the underlying C function strlen and Agena's `size` operator. By comparing the results, you can check whether embedded zeros are included in the string or not.
  • - `strings.iscontrol` now returns `true` if the empty string ('' = ASCII code 0) has been passed.
  • Strings generated by `strings.random` with the 'ascii' option no longer by default contain the DEL key character (= ASCII code 127).
  • The new function `os.getmodulefilename` returns the absolute path to the currently executing programme.
  • If any argument is now passed to `io.getkey`, the function just waits until a key is pressed, but does not return anything.
  • Windows only: The new function `io.keystroke` emulates a keystroke, i.e. sends a character to stdin.
  • OS/2 only: The new function `io.kbdgetstatus` returns status information about the keyboard. It is a port to the C API function KbdGetStatus.
  • OS/2 only: The new function `os.os2info` returns various environment settings; it is a port to the C API function DosQuerySysInfo.
  • Syntax parsing of the `inc`, `dec` and related assignment statements has become much stricter: If you use an (optional) opening bracket to enclose an argument, then you must now also type in a closing bracket.
  • The C API function `agnL_checkoption` can now check options case-insensitively by passing a flag as the last argument.

New in Agena 2.16.0 (Sep 3, 2019)

  • The new operator `zero` checks whether a number or complex number is zero, and the new operator `nonzero` does the opposite. Both are around 8 percent faster than using the binary `=` or `` operators. The two new operators support metamethods.
  • Because `zero` is now a keyword, the function `calc.zero` had to be renamed to `calc.zeros`, and `linalg.zero` to `linalg.zerovector`.
  • The new function `math.floorpow2` is the opposite to `math.ceilpow2` and rounds down to the previous highest power of 2.
  • `math.ispow2` now can detect powers of two if its argument is greater than 2^31. The function returns `fail` if its argument is greater than 2^53 or if it is negative.
  • `math.ceilpow2` now returns `fail` instead of just overflowing if its agument is greater or equal 2^31.
  • `math.isirregular` could not correctly detect non-representable integers in the vicinity of the 2^53 threshold. This has been fixed.

New in Agena 2.15.5 (Jul 25, 2019)

  • The new function `numarray.cycle` cycles through arrays.
  • The new function `implies` implements the Boolean operation implies(a, b) = not(a) or b. The function also combines integers, where implies(a, b) = ~~(a) || b.
  • `factory.cycle` did not work with with registers, sequences and strings if no sentinel has been given. This has been fixed.
  • `numarray.include` rejected index position 1. This has been fixed.
  • The order of arguments of `numarray.whereis` has been changed to the one given in the Primer and Reference.
  • `numarray.write`, `numarray.read`, `numarray.readintegers`, `numarray.readdoubles` and `numarray.readuchars` did not work. This has been fixed.
  • Changed the way how `binio` file handles are written by the prettyprinter: instead of printing just a deceiving integer, the string 'BINIOFILE*' concatenated with an integer is written, as `binio` file handles are userdata and not integers.
  • Many mathematical functions now internally use predictive branching if deemed reasonable.

New in Agena 2.15.4 (Jul 25, 2019)

  • Updated the documentation: Primer and Reference, Crash Course, and Quick Reference.

New in Agena 2.15.3 (Jun 26, 2019)

  • `ulist.totable` has become at least thrice as fast, by porting it to C.
  • `ulist.isequal` and thus also the `=` equality operator have been ported to C for better performance, it is 10 times faster now.
  • `ulist.getitem` can now return more than one value by passing a third argument. This is around 90 % faster as individually reading the items.
  • `ulist.purge` now returns the element deleted.
  • The new function `ulist.sort` sorts ulists and has the same functionality as `sort`.
  • The new function `ulist.swap` exchanges the positions of two elements.
  • `ulist.put` ignored the filling factor. This has been fixed.

New in Agena 2.15.2 (Jun 17, 2019)

  • New release policy: While the OS/2, DOS, Debian Linux, Mac OS X and Windows versions of Agena will be further developed, the Raspberry Pi, Red Hat Linux, Linux PowerPC and Solaris editions due to lack of interest will no longer be permanently maintained.
  • `numarray.getitem` can now also return succeeding values from a numeric array. It is at least twice as fast as individually reading the items.
  • `llist.getitem` can now also return succeeding values from a singly-linked list. It is at least twice as fast as individually reading the items.
  • Ulists now have their own metatables, so you may index ulists as usual, using the squared bracket notation. The `size`, `=`, and `in` operators and the standard prettyprinter are now also supported. To gain read and write access to the sequences of the underlying singly-linked list, use the new function `ulist.getllist`.
  • `ulist.getitem` has become eleven percent faster, and `ulist.setitem` six percent faster, by porting them to C.
  • Tuned `ulist.iterate`.
  • The new function `utils.posrelat` converts negative integer indices to their positive equivalents.
  • `numarray.include` did not accept negative indices. This has been fixed.
  • `ulist.put` did not work with empty ulists and index 1 and other odd situations. All this has been fixed.

New in Agena 2.15.1 (Jun 3, 2019)

  • Added unrolled singly-linked lists to the `llist` package. They are usually at least ten times faster than singly-linked lists. See the descriptions of functions `ulist.list`, `ulist.append`, `ulist.prepend`, `ulist.put`, `ulist.purge`, etc. in the manual.
  • The new function `llist.getitem` and `llist.setitem` expose the internal index read and index write procedures to the environment so that self-written metamethods do not run out-of-stack.
  • You can now pass negative index position to `llist.purge`, `llist.put`, `llist.getitem`, `llist.setitem`, to access elements from the end of a linked list.
  • Linked list can now store status information or other data in a special table that is available at pseudo-index position 0. You can use the index metamethod or `llist.getitem` to read from or write data to this table.
  • `llist.listtotable` has been renamed to `llist.totable`. An alias has been provided to ensure backward compatibility.
  • Numarrays can now store status information or other data in a special table that is available at pseudo-index position 0. You can use the index metamethod or `numarray.getitem` to read from or write data to this table.
  • You can now pass negative index position to various `numarray` package functions to access elements from the end of an array.
  • `numarray.get` has been renamed to `numarray.getitem`. `numarray.put` has been renamed to `numarray.setitem`. Aliases have been provided to ensure backward compatibility.
  • The new function `numarray.getsize` exposes the internal procedure to determine the size of an array to the environment.
  • The new function `strings.xmlmatch` works like `strings.match`, but matches the contents enclosed by XML tags.
  • The `++` and `--` suffix operators did not return correct results if used at least in function calls, e.g. `f(c++)' did not work as expected. This has been fixed.
  • If called with no arguments, `math.randomseed` sometimes returned invalid seeds that could not be passed again to this function in order to reset the seeds. This has been fixed.
  • Improved garbage collection of packages `numarray`, `bloom` and `bytes`.
  • Changed the sources to prevent compiler warnings on some platforms.
  • As ever, this release has been Valgrind-checked on x86 Linux and Mac OS X to ensure there are no memory leaks.

New in Agena 2.15.0 (May 14, 2019)

  • The new `:=` compound assignment operator conducts integer division, i.e.: a := b a := a b.
  • All bit-twiddling operators `&&`, `||`, `

New in Agena 2.14.13 (May 8, 2019)

  • The `ln` operator has become 2 % faster, and `math.arcsinh` 12 % faster.
  • `math.dirac` now returns `undefined` if its argument is `undefined`.
  • `hypot`, `hypot2` and `hypot3` now use a more accurate and portable algorithm, at the expense of a 1 % speed loss. This also affects both `ilog2` and `abs` when called with complex numbers.
  • Streamlined the code, fixed faulty header includes, mathematical functions now always use the same underlying C math functions, usually from Sun Microsystems if they are at least as fast as those implemented in GCC; removed unused auxiliary C functions (agnxlib.c, however, was left untouched), etc.

New in Agena 2.14.12 (May 2, 2019)

  • Both `arccsch` and `arcsech` have become at least 20 % faster. `arccosh` has become 5 % faster.
  • `skycrane.getlocales` erroneously changed the locale to 'C', this has been fixed.
  • Fixed `beta` which could return wrong results if the sum of its arguments exceeded 171.
  • The underlying implementation of `io.readfile`, `io.readlines`, `io.nlines` and `io.skiplines` has been standardised, no functional changes.
  • Changes and fixes to the `dual` package (see file lib/dual.agn for documentation):
  • The addition `+` and subtraction `-` operators now accept mixed number and dual number operands.
  • The division operator `/` now accepts a number as the first operand.
  • The multiplication operator `/` now accepts a number as the second operand.
  • `dual.tanh` returned wrong results, this has been fixed.
  • The `abs` operator now returns the absolute value of the real part.
  • The exponent to `^` can now also be a dual number.
  • Division by zero was not properly handled by the `/` and `recip` operators. This has been fixed: now `undefined` is returned.
  • `undefined` as input is now properly by all package functions and operators: now they simply return `undefined`.
  • Fixed output of dual numbers for dual parts -0.

New in Agena 2.14.11 (Apr 30, 2019)

  • The new compound operator `&:=` concatenates the contents of a string variable with another string and writes back the result to this variable, i.e.: a &:= b a := a & b.
  • The new function `os.islocale` checks whether the given locale is supported by the operating system.
  • `skycrane.getlocales` no longer changes the locale if interrupted.
  • The `beta` function has become more than twice as fast with positive integer arguments.
  • `os.iseCS` has been renamed to `os.isos2`. An alias for `os.iseCS` has been provided to ensure backward compatibility.
  • The `gdi` could not be used in the Debian Stretch edition. This has been fixed.

New in Agena 2.14.10 (Apr 23, 2019)

  • `prepend` now works in-place, making it much more efficient, as are its counterparts `put` and the `insert` statement.
  • `arccosh` has become thrice as fast in the real domain.
  • The new functions `math.arcsinh` and `math.arctanh` compute the inverse hyperbolic sine and tangent in the real domain.
  • The new function `bytes.trailzeros` counts the number of trailing zeros in an unsigned 32-bit integer.
  • The new function `tables.borders` returns the lowest and highest assigned index in the array part of a table. With tables, `environ.attrib` also returns them, represented by 'lowest' and 'highest' keys.
  • `debug.getlocals` crashed with invalid levels. This has been fixed. It now also returns a table of unassigned local variables.
  • `hashes.murmur3128` could crash, this has been fixed. It now returns 4 unsigned 32-bit integers, accepts an optional seed as the third argument and is now available in the OS/2 and Raspberry Pi editions, as well.
  • The new C API function `agn_arrayborders` returns the lowest and highest index of the array part of a table.

New in Agena 2.14.9 (Apr 15, 2019)

  • The new `++` and `--` suffix operators return the current value of a variable and then increase or decrease the variable by one:
  • To new functions: `bytes.tolittle` converts a number into its Little Endian, and `bytes.tobig` into its Big Endian representation.
  • Some few non-functional changes to clear internal buffers in some functions before they issue errors.
  • Documented the formerly undocumented function `bytes.bcd`.
  • With numbers, `arcsinh` has become 2 % faster and `arccosh` 15 % faster. `stats.countentries` have become 2.5 % faster, `stats.extrema` 8 %, and `stats.peaks` 9 % faster.
  • Tuned `bytes.tobytes`. On Big Endian systems, it has also been fixed.
  • The new function `cordic.cmul` multiplies two numbers.
  • The new C API function `luaL_clearbuffer` clears the luaL_Buffer but does not push anything onto the stack.

New in Agena 2.14.8 (Apr 7, 2019)

  • `io.readlines` can now apply a user-defined function of one variable to the lines being read from a file. Instead of the original lines, the results of the function call are put into the resulting table.
  • `skycrane.timestamp` does not necessarily expect hours, minutes and seconds any longer.
  • The new function `bytes.numto32` converts a number to its 4-byte signed or unsigned integer representation.
  • The new function `bytes.parity32` determines the parity of an unsigned 4-byte integer.
  • The new function `math.nearmod` returns the closest value to a number divisible by a given modulus.
  • The new function `math.congruentprime` determines whether a number is a prime number congruent to a given modulo expression. Can be used to suggest `optimal` sizes for hash tables.
  • The new function `hashes.fibmod` may compute more evenly distributed hash values using Fibonacci hashing.
  • Added new string hash functions `hashes.asu`, `hashes.bkdr`, `hashes.dek`, `hashes.elf` - see the Primer and Reference for their description.
  • `prepend` can now better treat large sequences.
  • Improved and/or fixed error messages of `optnumber`, `optpositive`, `optnonnegative`, `optint`, `optposint`, `optnonnegint`, `optboolean`, `optstring` and `environ.kernel`.
  • Documented the formerly undocumented hash functions:
  • `hashes.strval` which is useful to classify words with the same ending,
  • `hashes.sumupchars` computes the Internet Checksum and other sums,
  • `hashes.varlen` returns variable-length integer hashes, and - depending on the user-given salt - can produce non-colliding hashes.

New in Agena 2.14.7 (Mar 28, 2019)

  • Added `bytes.add32` and `bytes.mul32` which add, respectively multiply two or more numbers using 4-byte signed or unsigned arithmetic. Likewise, `bytes.sub32`, `bytes.div32` and `bytes.mod32` are 4-byte subtraction, division and modulus operations.
  • The new function `hashes.djb2rot` is a modification of `hashes.djb2` with additional bitwise rotations. It produces less collisions and is also faster than `hashes.djb2`.

New in Agena 2.14.6 (Mar 20, 2019)

  • The alternative table and sequence constructors `// ... \' and `(/ ... )' now accept keywords without the need to put them into quotes.
  • Added functions `fastmath.sinfast`, `fastmath.cosfast`, `fastmath.tanfast` which approximate sine, cosine and tangent and depending on the CPU can be up to 40 percent faster than the - accurate - `sin`, `cos` and `tan` operators.
  • Added function `fastmath.invsqrt` which approximates the inverse square root and is around five percent faster than inversing the result of the `sqrt` operator.
  • `fastmath.lbfast` has become 1,800 times more accurate at around the same speed.
  • The new function `os.suffix` returns the last suffix in a filename.
  • The new function `skycrane.replaceinfile` replaces all occurences of one or more strings in a text file in-place.
  • The new function `bytes.mask32` returns an integer with a given number of bits set to 1.
  • The `sema` package now supports multiple instances of semaphores; to create them, use the new function `sema.new` and call them with the existing procedures as the very first argument. Also, the package now consumes much less memory unless you close a semaphore id that was not the last one opened just one step before.
  • `math.isprime` should be a little bit faster now.
  • Fixed `os.mkstemp` which often returned errors. The function does not return an additional file handle any longer.
  • The new C API function `luaL_isudata` checks for a userdata object and also validates its metatable if present.
  • Some minor code improvements.

New in Agena 2.14.5 (Jan 18, 2019)

  • The new function `bytes.shift32` shifts the bits in a 32-bit integer to the left or the right.
  • The new function `bytes.rotate32` rotates the bits in a 32-bit integer to the left or the right.
  • The new function `bytes.arshift32` performs arithemtic shift of the bits in a 32-bit integer.
  • The new function `bytes.extract32` returns the number formed by a given bit field in a 32-bit integer.
  • The new function `bytes.replace32` replaces the bits in a bit field of an 32-bit integer with a new one.
  • The new functions `bytes.and32`, `bytes.or32` and `bytes.xor32` conduct bitwise-AND, -OR and -XOR operations on one or more 32-bit integers. `bytes.not32` conducts bitwise negation of a 32-bit integer.
  • The new functions `bytes.nand32`, `bytes.nor32` and `bytes.xnor32` conduct complementary bitwise-AND, -OR and -XOR operations on one or more 32-bit signed integers.
  • `bytes.castdouble` has been removed as it has been identical to `bytes.castint`.
  • The 64-bit rotation operators `` did not correctly move bits beyond the 32 bits threshold. This has been fixed.
  • `bloom.new` issued confusing error messages with missing arguments. This has been changed.
  • Added tips for Linux users to Chapter 2.2 of the Primer and Reference.
  • This release has been Valgrind-3.12.0-checked on x86 Linux x86 Raspian Stretch to ensure there are no memory leaks.

New in Agena 2.14.4 (Jan 7, 2019)

  • The absolute value of an algebraic expression can now also be determined by using the pipe notation, e.g.: | x |, | sin(-1)/2 |, 2 * | x + y |, etc. Note that this currently does not work with relations and other non-mathematical expressions.
  • The new function `fastmath.hypotfast` is 60 percent faster than `hypot' - but less accurate - and calculates sqrt(square x + square y).
  • The new function `stack.switchto` automatically changes to the stack with the least number of elements.
  • `max` and `min` can now also compare two numbers.
  • Added functions to convert numbers into binary representations and vica versa, from Lua 5.3: `bytes.pack`, `bytes.packsize`, `bytes.unpack`.
  • Added the `utf8` package from Lua 5.3 with some helpers for UTF-8 encoding.
  • Described the formerly undocumented function `stats.accu` which memory-efficiently computes the arithmetic mean and standard deviation.
  • Conducted some code cleansing regarding integer type declarations, and modfied the sources of the plus packages `gzip` and `mapm` for Sun Solaris, and `xml` for Linux.

New in Agena 2.14.3 (Dec 28, 2018)

  • The new function `strings.random` creates a random Base64 or ASCII string.
  • The new function `os.mkstemp` creates a unique temporary filename and file handle and opens the file in read-write mode.
  • The new function `bytes.castint` casts numbers to C integers.
  • When given borders, the random integers generated by `math.random` where of bad quality, i.e. of low frequency. This has been fixed.
  • `environ.kernel` can now individually return the following read-only settings: "lastcontint", "smallestnormal" and "clockspersec".
  • `os.cpuinfo` returns information on the supported instruction sets in the new 'support' field and further information on the CPU in the 'cputype' field. The 'cpuid' field contains various information on the underlying CPU hardware.
  • With a number x, `cabs` now returns the complex number abs(x) + I*0 if any option is given.
  • The new function `calc.eulerdiff` computes the first derivative of a univariate or multivariate function with high precision and speed.
  • The new C API function agnL_fneps determines an epsilon value by taking a function value into account, using a divided difference table.
  • When passing functions to `math.epsilon`, memory leaks were created in case of errors. This has been fixed.
  • Removed keywords `peek` and `poke`.

New in Agena 2.14.2 (Dec 18, 2018)

  • The `if` statement is now also available in an operator form
  • Extended `math.epsilon` with new formulas, see the manual.
  • The new function `getorset` returns an element stored in a structure, or stores a new value to the structure if the given indices do not yet exist.
  • `strings.format` now accepts the %A modifier which is equal to the %H modifier.
  • Metamethods __real, __imag, __cis, __square and __cube have been introduced for the `real`, `imag`, `cis`, `square` and `cube` operators. Added formerly undocumented metamethods to the manual.
  • When current stack is a character stack, and when given numbers, `pushd` now checks whether a digit 0 .. 9 has been passed and issues an error otherwise.
  • The `sema` package obviously was not included in the binary distributions. This has been fixed.
  • New C API functions: lua_setmetatabletoobject, lua_seqgetinumber (function instead of macro now), agn_reggetinumber (function instead of macro now).
  • `ads.peek` has been renamed to `ads.peekin`.
  • `append` has been renamed to `prepend`.
  • The OS/2 edition now includes the formerly missing gcc473.dll file.
  • In OS/2, `os.tmpname` may have always returned an error. This has been fixed.
  • The distribution contains a new package called `dual` which provides means to play with dual numbers of the form a + b*e, where e 0 and e^2 = 0. Currently, the only documentation is the code itself, which you may find in the lib/dual.agn file of the Agena folder. You may use it to conduct automatic differentiation, with the first derivative to be computed with astonishing machine epsilon precision. (The documentation is the code itself, it has not been described in the Primer and Reference as it is not of general interest.)

New in Agena 2.14.1 (Oct 22, 2018)

  • Added Algol 68-style compound assignment; i.e., statements like "c +:= 2" which is equivalent to "c := c + 2" or "inc c, 2". The operators supported are +, -, *, /, and %. This is syntactic sugar to the `inc`, `dec`, `mul`, `div` and `mod` statements.
  • The new function `append` adds a single element to the front of a structure. It works non-destructively.
  • `sema.open` can now be passed a non-negative integer id. If the id has not yet been created, the function creates it. This allows you to write functions dumping the current semaphore state to a file and re-load it later, see `binio.writechar`, `binio.readchar`, `bytes.tobytes`.
  • `skycrane.timestamp` now by default returns the time in Daylight Saving Time if active. You can switch this off (always returning Standard Time) by passing the new option `standardtime=true`.
  • `calc.diff` and `calc.xpdiff` now accept the option `deriv = 0` which just returns the function value at the given point.
  • The new `calc.softsign` function computes the Softsign function x/(1 + abs x) >>. It is 40 percent faster than an Agena implementation.
  • `calc.smoothstep` has been extended to alternatively compute a polynomial which has zero 1st- and 2nd-order derivatives at x = 0 and x = 1. The argument list of the function has also been corrected.
  • In UNIX based systems, the global and personal initialisation files may also have the filename `agena.ini`.
  • `os.system` now correctly detects Windows 8.1 and 10.
  • `columns` could not process registers. This has been changed.
  • Improved references in the Primer and References, also corrected the Quick Reference.
  • Some cleaning of error messages with respect to punctuation.
  • To clear the namespace, the following macros providing backward compatibility to deprecated functions in 2.13 have been finally removed: `rot`, `math.clamp`, `math.symtrunc`. For all the functions removed, check the end of the lib/library file, where you will find fully functioning "emulators". You may add them to your personal agena.ini or .agenainit files.

New in Agena 2.14.0 (Oct 1, 2018)

  • A short-cut `if`-like statement has been introduced using the ? token: if any condition is met, then it executes exactly one statement.
  • The new `sema` package provides tools to memory-efficiently retrieve and administer unique non-negative integer IDs.
  • The new function `utils.speed` measures the speed of functions.
  • The new function `skycrane.timestamp` converts a timestamp to a Lotus Serial Date and other time components.
  • The new function `linalg.iszero` checks whether a vector or matrix contains only zeros.
  • The new function `linalg.isallones` checks whether a vector or matrix contains only ones.
  • `factory.count` now accepts an optional stop value.
  • The new function `satisfy` checks whether an atomic data or _all_ elements of a structure satisfy a given condition.
  • `recurse` and `descend` can now be passed functions checking for inequality without issueing errors. Also with tables, if the new option skiphash=true is being passed, all non-numeric keys and their associated values are ignored.
  • Syntax incompatibility: The arguments of `descend` have been swapped to comply with the `recurse` standard.
  • `descend` did not work correctly with registers. This has been fixed.
  • In DOS, `os.setenv` can now also delete environment variables.
  • `utils.writecsv` has been patched.
  • `reduce`, `nseq`, `nreg`, `stats.sumdata`, `stats.issorted` could crash if passed too many arguments. This has been fixed.
  • The `net` package now cleans up memory correctly when terminating the Agena session with CTRL+C.
  • This release has been Valgrind-checked on x86 Linux and Mac OS X to ensure there are no memory leaks.

New in Agena 2.13.0 (Sep 12, 2018)

  • The new function `math.stirnum` computes the Stirling number of the first or the second kind.
  • The new function `math.pochhammer` computes the Pochhammer function (rising factorial).
  • The new operator `cube` raises a number or complex number to the power of 3.
  • The new binary operator `roll` rotates a two-dimensional vector, represented by a complex number, through a given angle. The corresponding function `rot` with the same functionality has been deprecated. A macro has been provided to ensure backward compatibility.
  • The operator is around ten percent faster than `rot` on Windows, and 27 percent on Solaris.
  • `math.clip`, `math.clamp` and `math.symtrunc` are almost equal in functionality, so all the different flavours have been combined into an extended version of `math.clip` which now also allows to user-define the return value if its argument is not in the given range. Thus, `math.clamp` and `math.symtrunc` have been deprecated. Macros, however, provide backward compatibility.
  • `math.fdima` has been integrated into `math.fdim`. A macro has been provided to ensure backward compatibility.
  • The new `bytes` package provides the userdata data structure 'double' storing an Agena number as both a C double (i.e. Agena number) and its two higher and lower 32-bit unsigned integer representations, along with functions to query and assign its individual components.
  • The following related `math` functions have been moved to the `bytes` package which can be activated through the `import` statement: , `fpbtoint`, `gethigh`, `gethighlow`, `getlow`, `inttofpb`, `leadzeros`, `leastsigbit`, `mostsigbit`, `reverse`, `onebits`, `sethigh`, `setlow`, `tobinary`, `tobytes`, `tonumber`.
  • `math.sethighlowuint64` and `math.gethighlowuint64` have been removed since they could not always process each unsigned 64-bit integer correctly with Agena's doubles-based numeric system.
  • The following related `math` functions have been moved to the new `fastmath` package which can be activated through the `import` statement:
  • `invroot`, `lbfast`, `reciprocal`, `sincosfast`, `sqroot`, `sqrtfast`.
  • In OS/2 and DOS, the `gamma` function now also processes complex numbers.
  • `integral` and `float` have become five percent faster.
  • `calc.weier`, `calc.polyfit` and `calc.polygen` have become more precise by internally using Kahan-Ozawa summation.
  • `math.fibinv` has not been correctly registered. This has been fixed.
  • The undocumented baselib function `sunlog2` has been removed.
  • This release has been Valgrind-checked on x86 Linux to ensure there are no memory leaks.

New in Agena 2.12.7 (Aug 13, 2018)

  • `math.convertbase` has become around thrice as fast.
  • Three new stacks storing single characters have been introduced, with stack numbers 4 to 6. Except of `stack.sorted`, all stack functions and stack operators can be used with them. The new stacks can speed up processing time when relying on a lot of string concatenations, see `math.convertbase` for an example.
  • `stack.insertd`, `stack.pushvalued`, `stack.removed` can now be given a nonnegative stack index number, where 0 represents the bottom of the stack, 1 the position just above the bottom, etc.
  • If a stack position does not exist, `cell` now returns `null` instead of `fail`.
  • If a stack is empty, `popd` now returns `null` instead of an error.
  • If a stack is empty, `allotted` returns `null` instead of `false`.
  • If a stack is empty, `allotted` now returns `null` instead of `false`.
  • If a stack is empty, `stack.dumpd` now returns `null` instead of an empty sequence.
  • The new function `stack.pushstringd` pushes all characters of a string onto a character stack.
  • The new function `stack.replaced` replaces a stack value with another value.
  • The new function `stack.swapd` swaps two values in a stack.
  • The new function `stack.explored` returns the contents of a stack without modifying it.
  • The number of pre-allocated slots per stack has been reduced from 256 to 128.
  • When given a stack number, `switchd` switched to the wrong stack which could cause segmentation faults. This has been fixed.
  • When given a stack number, `allotted` did not return correct results and could cause segmentation faults. This has been fixed.
  • When inserting `too many` numbers into a number stack, Agena could crash with stacks #2 and #3. This has been fixed.
  • Corrected various error messages of the `stack` package.
  • All stack functions and operators have been described in the Agena Quick Reference (agena.xls).
  • Extended test cases for stacks.
  • This release has been Valgrind-checked on x86 Linux to ensure there are no memory leaks.

New in Agena 2.12.5 (Jul 30, 2018)

  • The new function `binsearch` performs a binary search in a structure and is much faster than the `in` operator when dealing with large structures.
  • The new function `math.fibinv` returns the index of a Fibonacci number.
  • `fib` has been ported to C and has become at least twice as fast.
  • `bminus` and `bintersect` have become twice to thrice as fast.
  • With complex arguments, `beta` erroneously sometimes returned `undefined` instead of a finite result. This has been fixed.
  • `bisequal` did not check structures for Cantor equality but whether one is a subset of the other. This has been fixed.
  • The new C API functions `agnL_optnonnegative` and `agnL_optpositive` check for nonnegative and positive numbers and optionally retun a default.
  • This release has been Valgrind-checked on x86 Linux to ensure there are no memory leaks.

New in Agena 2.12.4 (Jul 25, 2018)

  • `os.pause` has been implemented in C and does not strain the CPU any longer while waiting (none-busy wait). It can now also wait for a fractional number of seconds.
  • `os.wait` can now wait for a fractional number of seconds.
  • `time` now returns the number of seconds including milliseconds elapsed since January 01, 1970, instead of processor time consumed by Agena. It has thus become platform-independent.
  • The new function `os.clock` returns the processor time used by the current Agena session.
  • `environ.kernel` returns the CLOCKS_PER_SECOND setting on your platform in the new 'clockspersec' field.
  • `environ.system` returns the number of bits in a C char in the new 'Ctypes' field 'bitschar'. The following values can now be found in the 'Ctypes' table instead of the 'numberranges' table: 'bitsint', 'luaint32', 'luauint32', 'luaint64', 'luauint64'.
  • `getbit` and `setbit` now can retrieve or set the 32th bit of a 32-bit integer.
  • `getnbits` returns bits in a 32-bit integer. `setnbits` sets bits in a 32-bit integer.
  • `getbit` and `getbits` do not internally convert a negative argument to a positive value any longer before returning the bits.
  • In OS/2, with a complex argument, `arcsin`, `arccos` and `arcsec` erroneously sometimes returned `undefined` instead of a finite result if the imaginary part of the argument was zero. This has been fixed.
  • The new C API functions `agn_checkpositive` and `agn_checknonnegative` check for positive and nonnegative numbers.

New in Agena 2.12.3 (Jul 22, 2018)

  • The operators `nand`, `nor`, `xnor` and `xor` can now also compute bitwise complement and, or, exclusive-nor and exclusive-or.
  • The new function `implies`(a, b) computes bitwise and Boolean ~a || b, not(a or b), respectively.
  • The complement operator `~~` now only works in signed mode and returns a signed result, regardless of the environ.kernel/signedbits setting, as unsigned computation does not make sense.
  • The new `factory` package provides some functional programming-style iterator factories:
  • `factory.iterate` creates a function that iterates each element in a structure and each character in a string one by one. If there is nothing left, the function returns `null` and if called again, re-starts iteration.
  • `factory.cycle` creates a function that iterates each element in a structure and each character in a string one by one. If there is nothing left, the function does not return `null` but simply re-starts iteration if called again.
  • `factory.reset` sets the current index of an iterator.
  • `skycrane.counter` has been moved to the `factory` package and is available there by the name `factory.count`. Any floating-point mode is ignored
  • it is always Kahan-Ozawa if any of the arguments is a float. An alias for `skycrane.counter` has been provided to ensure backward compatibility.
  • `environ.arity` now returns the number of upvalues in a function as the third result.
  • `envion.attrib` returns the number of upvalues in a function in the new `nupvals' field.
  • The new functions `environ.ref` and `environ.unref` create a unique integer ID for any object.
  • The new function `environ.isequal` checks two objects for equality, returning `false` with structures that have the same elements but where where one structure does not refer to the other.
  • `registry.anchor` can now also delete values from the registry.
  • The new function `math.mostsigbit` returns the position of the most significant 1-bit, and `math.leastsigbit` the position of the least significant 1-bit.
  • The new function `math.reverse` reverses all the bits in an 32-bit integer.
  • The new function `math.ulp` computes the unit of least precision (ULP), the spacing between floating-point numbers.
  • `math.gcd` and `math.lcm` have been ported to C and have become 85 and 165 percent faster, respectively.
  • `reduce` with the `counter` option did not correctly clean up its environment. This has been fixed.
  • `registry.anchor` unintendedly returned its second argument. Now it returns nothing.
  • `math.powmod` caused segmentation faults with some integer arguments. This has been fixed.
  • The new C API function `agn_equalref` is the foundation of `environ.isequal`.
  • This release has been Valgrind-checked on x86 Linux and Mac OS X to ensure there are no memory leaks.

New in Agena 2.12.2 (Jul 15, 2018)

  • The new function `os.pause` waits for an amount of time or any user input. It emulates the ZX Spectrum command PAUSE.
  • Improved performance of `nseq` and `nreg` by ten percent when given integers.
  • Looping over functions now works as expected, you no longer have to use the `keys' token in `for/in` loops. Example: for w in strings.gmatch('I am a string', '%a+') do print(w) od
  • With functions, `environ.attrib` now returns the number od arguments and whether it includes varargs in the new fields "arity" and "varargs".
  • Patched `nreg`: with fractional arguments, the last element was not included in the register, now it is.
  • The `in` operator always returned `false` when searching for `null` values that have been stored in a register. This has been corrected.
  • Edited and extended Chapter 6.22 `Closures: Procedures that Remember their State` of the Primer and Reference to further discuss looping over procedures and factories.
  • This release has been Valgrind-checked on x86 Linux and Mac OS X to ensure there are no memory leaks.

New in Agena 2.12.1 (Jul 11, 2018)

  • With procedures, the number of types that can be checked with any parameter and the resulting return has been increased from four to five,
  • When combined with a `when` and `with` clause, the `return` statement can now also return values,
  • The new operator `integral` checks for an integer and is at least twice as fast as `isint`.
  • `numarray.integer` has been renamed to `numarray.int32`, and `calc.integral` to `calc.integ`.
  • The new function `debug.getlocals` returns all local variables of a procedure.
  • `nseq` has been modified in that it accepts functions that may return `null`. In this case, an element is not added to the resulting structure.
  • `nseq` and `nreg` now internally use Kahan-Babuska summation for most precise results. Also, error correction with values close to 0 has been added.
  • `next` now accepts a sentinel as the optional third argument. If `next` during traversal encounters an element that equals this sentinel, the function just returns `null`, and you may start iterating the structure again from its beginning.
  • `math.accu` now accepts a start value for the accumulator (first argument). Also added value correction if the intermediate sum is very close to 0.
  • C API function `agn_rawgetfield` has been renamed to `agn_rawgetifield`.
  • The new C API functions `agn_rawgetfield` and `agn_rawsetfield` retrieve or set a value from/to a table.
  • The `bloom` package was not included in the Linux, Mac and Solaris binary distributions. Now they are.
  • `log2` sometimes returned wrong results in OpenSUSE due to round-off errors with integer arguments in its standard underlying C function of the same name. This has been fixed by using Sun Microsystems code. All other operating systems have not been affected.
  • With the `local' declaration, the parser accepted invalid statments like `local a a := 1`. This has been fixed.
  • `hashes.murmur3128` now always issues an error when run in OS/2 and Raspberry Pi. Before, it caused segmentation faults on these platforms.
  • This release has been Valgrind-checked on x86 Linux to ensure there are no memory leaks.
  • In the parameter list and also the optional return type list of functions, you can now also pass the following numeric "type" names:
  • `integer` checks for a number that represents a signed integer,
  • `posint` checks for a number that represents a positive integer,
  • `nonnegint` checks for a number that represents a non-negative integer,
  • `positive` checks for a positive number (float or integer),
  • `nonnegative` checks for a non-negative number (float or integer).

New in Agena 2.12.0 (Jun 18, 2018)

  • New syntax:
  • Local variables can now be defined in short-cut functions using the `with` clause, e.g.: > fact := with n := 1 > -> exp(lngamma(x + n)) >>;
  • The `import` statement can now also assign an alias to a library name when given the new `as` clause, e.g.: > import hashes as h; > a := h.crc32('agena'); # which is equal to: > b := hashes.crc32('agena');
  • The `global` statement now checks whether the given variables have not been declared local before its invocation.
  • If there are no parameters in a short-cut procedure, then an empty bracket pair has to be explicitly given: then, now wrong: 1 >> now, right: 1 >>
  • Improvements:
  • `map` and `@` now support function composition. (See also new function `reduce` below.)
  • `min` and `max` can now process sets and registers.
  • `os.fcopy` can now copy files if only a target directory is given. The function now no longer overwrites existing files and issues an error instead. Warning messages have been improved. The function now issues errors instead of returning `fail` if a file could not be read or created, or if the source and target file are identical.
  • `os.list` returns a second argument, an explanatory text, if a given directory or given file could not be found.
  • `os.fstat` now returns the date of last access and last date of a file attribute change in the new 'lastaccess' and 'attribchange' fields.
  • You can now read and set individual bits of an unsigned char array with the new functions `numarray.getbit and `numarray.setbit`. `numarray. iterate` can traverse bitfields one by one if you pass the fourth argument `true`, e.g.: "f := numarray.iterate(a, 1, 1, true)".
  • `stats.hmean` has been ported to C, has become five times faster and now internally uses Kahan-Babuška summation to compensate for rounding errors.
  • The new function `math.gethighlowuint64` returns the higher and lower bytes of the unsigned 64-bit integer.
  • The new function `math.sethighlowuint64` combines two unsigned 32-bit integers to an unsigned 64-bit integer.
  • `strings.tolatin` now returns unsupported code points in its result.
  • `strings.chop` now accepts a function as a second argument, checks each character in the string from the right to the left for the given Boolean condition and returns the string from its beginning up to the character that no longer satisfies the condition.
  • `strings.advance`, `strings.remove` and `strings.chomp` now support pattern matching.
  • `strings.between` and `strings.fields` can now convert its result as a number(s).
  • `strings.between` has been extended: the prefix string can now reside within the string, not only at its beginning. Empty pre- or postfixes are no longer accepted. The function now returns `null` if there was no match (instead of its third argument, which was wrong).
  • New Functions:
  • The new function `reduce` applies a function on each item of a structure or string and returns one accumulated result.
  • The new `bloom` package implements Bloom filters. A Bloom filter is a memory-efficient mean to check whether a string probably is part of a dictionary or whether it is definitely not part of a dictionary, with acceptable query times.
  • The new function `stats.accu` returns a factory that computes the running mean, variance, median, and absolute deviation by mere accumulation of individual obervations. It consumes much less memory than other `stats` functions but is slower.
  • The new function `math.accu` returns a function that gets a number with each call, adds it to an internal accumulator using one of five selectable algorithms, and returns the accumulated sum.
  • `math.lbfast` approximates log2(x). 10 % faster than `log2`.
  • `calc.weier` implements the Weierstraß function, a function that is continuous but non-differentiable everywhere.
  • `strings.charset` returns a set of all the unique characters included in a string.
  • `strings.shannon` computes various Shannon entropies for a given string.
  • The new function `strings.splitfields` splits a string containing fields into its individual fields; the user may pass any delimiter separating the fields and also any wrapper that might enclose the various fields. Suited to parse database or other dumps.
  • `gzip.deflate` compresses a string using the zlib library.
  • `gzip.inflate` uncompresses a deflated string.
  • `hashes.crc16` computes the CRC16 value of a string.
  • `hashes.murmur2`, `hashes.murmur3` and `hashes.murmur3128` compute MurmurHashes. (`hashes.murmur3128` is not supported in OS/2.)
  • `environ.arity` returns the number of parameters of a function and additionally a Boolean indicating whether its parameter list includes a `?` (varargs) token.
  • Documentation of formerly undescribed functions:
  • `strings.gseparate` creates a factory splitting a string into its tokens one after the other.
  • `math.leadzeros` counts the number of leading zero bits in a 32-bit integer,
  • `math.onebits` counts the number of bits set in a 32-bit integer,
  • `math.sincosfast` returns approximations of sine and cosine,
  • `math.sqrtfast` returns an approximation of the square root.
  • `hashes.reflect` reflects the bits of an integer about its middle position.
  • `hashes.bsd` returns an integer between 0 and 65536, alternatively an integer between 0 and 255.
  • Bug Fixes:
  • The `restart` statement did not correctly reset Agena's three number stacks, causing segmentation faults if the stacks have been used thereafter. This has been fixed.
  • The following `hashes` functions could cause segmentation faults (at least in Windows) if called `too often`: `djb`, `djb2`, `fnv`, `jen`, `lua`, `mix64`, `mix64to32`, `oaat`, `pl`, `raw`, `sax`, `sdbm`, `sth`. This has been fixed.
  • The `import` statement / `readlib` function created memory leaks if the path to the main Agena library could not be found or other errors occurred. This has been fixed.
  • Since Agena 2.11.1, `nan` worked incorrectly with complex values representing `undefined`. This has been fixed.
  • The Linux version of `os.cdrom` has been fixed.
  • The `default` keyword has been removed.
  • The `telex` package now treats most ligatures and diacritics with Codepage 850 properly.
  • `skycrane.scribe` has been repaired.
  • In some Linux flavours, `ilog2` returned wrong results. This has been fixed. Miscellaneous:
  • Adapted sources to compile on Raspbian Stretch.
  • Improved the index of the Primer and Reference.
  • The new C API function lua_pushchar pushes a single character of type string onto the stack.
  • This release has been Valgrind-checked on x86 Linux and Mac OS X to ensure there are no memory leaks.

New in Agena 2.11.6 (May 30, 2018)

  • Bug fix and maintenance release:
  • Since Agena 2.11.1, `nan` worked incorrectly with complex values representing `undefined`. This has been fixed.
  • The Linux version of `os.cdrom` has been fixed.
  • The `restart` statement did not correctly reset Agena's three number stacks, causing segmentation faults if the stacks have been used thereafter. This has been fixed.
  • The import statement / `readlib` function created memory leaks if the path to the main Agena library could not be found. This has been fixed.
  • The `default` keyword has been removed.
  • Adapted sources to compile on Raspbian Stretch.
  • This release has been Valgrind-checked on x86 Linux and Mac OS X to ensure there are no memory leaks.

New in Agena 2.11.5 (Apr 3, 2018)

  • The binio package now supports methamethods. The metatable used by the package is called `BINIOFILE*`. Check the end ofChapter 6.19 on how to add new methods.
  • `binio.readindex` and `binio.writeindex` read and write binary data with a given index and an optional offset allowing fora user defined header.
  • `binio.readnumber` and `binio.readlong` can now be passed an optional file offset.
  • `binio.readlong`, `binio.readnumber`, `binio.readstring` and `binio.readshortstring` now work like `binio.readchar`:if the end of file has been reached, they all return `null` and no longer issue an error.
  • `binio.readshortstring` caused segmentation faults. This has been fixed.
  • `binio.writeshortstring` and `binio.writestring` have been tuned.
  • In Windows, `os.drivestat` now returns the `trim` flag that indicates a solid-state disk (with a high probability).
  • The formerly undocumented function `reverse` has now been described. The function reverses all elements in a sequence orregister in-place.
  • In the UNIX versions, the `gzip` package uses zlib-1.2.11.
  • This release has been Valgrind-checked on x86 Linux and Mac OS X to ensure there are no memory leaks.

New in Agena 2.11.4 (Jan 3, 2018)

  • The new function `tables.include` inserts values into a table of (sub)tables. If necessary, it creates a subtable before insertion.
  • The new function `hashes.lua` returns the hash of a string internally used by Agena.
  • The following `hashes` functions no longer need a second argument, i.e. the number of slots, to make them comparable: Instead when given only a string or number, they return its actual hash: `djb`, `djb2`, `fnv`, `jen`, `oaat`, `pl`, `raw`, `sax`, `sdbm`, `sth`, `mix64`, `mix64to32`.
  • Improved general error messages. The new `environ.kernel/errmlinebreak` setting allows to change the maximum number of characters to be displayed per line in syntax error messages.
  • The new function `debug.funcname` returns the name of the function from which it has been called. It is a wrapper for "debug.getinfo(n, "n").name". The function may be useful to create more flexible error messages.
  • `tables.dimension` did not work correctly if given a structure as the initialisor. This has been fixed.
  • In `strings.ljustify` and `strings.rjustify`, the filler can now also be a number.
  • `mprint`, `checkoptions` now detect whether they have been passed too many arguments.
  • Added new API functions agn_rawgetfield, agn_rawinsert, agn_rawinsertfrom. See manual for their features.
  • This release has been Valgrind-checked on x86 Linux and Mac OS X to ensure there are no memory leaks.

New in Agena 2.11.3 (Nov 30, 2017)

  • The new function `math.tohex` converts a non-negative integer to its hexadecimal representation.
  • `hashes.md5` can now also compute the MD5 hash value of a file.
  • The new function `hashes.crc32` performs a 32-bit reversed cyclic redundancy check on a string.
  • The new function `hashes.droot` computes the digital root and the additive persistence.
  • The new function `hashes.parity` returns a byte with even parity for a given integer.
  • The `llist` package, when loaded, caused problems with the `restart` statement
  • sometimes segmentation faults occurred. This has been fixed.
  • In Solaris 10, `cosc`, `arctan` and thus `arccot` may have returned wrong results in the complex domain. This has all been fixed.
  • `environ.kernel`: documented 'maxlong', 'minlong' and 'maxulong' defaults for signed and unsigned 32-bit integer limits. Also added 'lastcontint' and 'smallestnormal' keys which represent the largest accurately representable integer (2^53) and the small normal number (2^-1022).
  • This release has been Valgrind-checked on x86 Linux to ensure there are no memory leaks.

New in Agena 2.11.2 (Nov 8, 2017)

  • The new function math.sinhcosh(x) returns both sinh(x) and cosh(x). It is around 30 % faster than computing the values separately.
  • With complex numbers, the following functions have become faster with respect to Agena 2.11.1:
  • `antilog2` (3%), `antilog10` (3%), `arcsin` (twice), `arccos` (twice), `arcsec` (almost twice), `arctan` (20 %), `arctan2` (5 %), `cosc` (17 %), `csc` (42 %), `csch` (35 %), `sec` (42 %), `sech` (35 %), `sinc` (20 %), `tanh` (30 %).
  • `arctan` has been patched for arguments z = 0 + b*I with b > 1 and b non-integral.
  • It turned out that on Solaris some of the mathematical functions tuned in 2.11.0/1 have slowed down instead of sped up. The previous speed has be restored for the functions affected, some are them are faster than in Agena 2.10.4 or earlier. On Mac OS X, the tuning measures so not seem to have some effect.
  • Extended numerical test cases.

New in Agena 2.11.1 (Nov 1, 2017)

  • Tuning:
  • With real numbers, the following functions have become faster: `cbrt` (15 %), `ceil` (40 %), `cosh` (45 %), `frexp` (15 %), `ldexp` (15 %), `log` (20 %), `log10` (4 %), `sinh` (45 %), `tanh` (55 %), `math.expminusone`(twice as fast). Exponentiation now is 1.3 times faster.
  • With complex numbers, the following functions have become faster: `|-` (twice), `abs` (thrice), `arctan2` (25 %), `argument` (13 %), `ceil` (20 %), `cos` (2.8 times), `exp` (70 %), `recip` (20 %), `rot` (35 %), `sin` (2.8 times), `tan` (25 %). Exponentiation and multiplication have become 10 percent faster, and division 25 percent faster.
  • Bug fixes:
  • With 0, `ilog2` returnd 2^31 instead of `undefined`. The same happened with `infinity`. This has been fixed.
  • With a real number as the first argument, `rot` returned a wrong result. This has been fixed.
  • `hypot4` erroneously returned `undefined` in certain situations. This has been fixed.
  • Miscellanous:
  • `math.chop` can now also process complex numbers.
  • `ads.clean` uses a different internal library to prevent compiler warnings.
  • Extended numeric test cases.
  • This release has been Valgrind-checked on x86 Linux and MacOS X to ensure there are no memory leaks.

New in Agena 2.11.0 (Oct 23, 2017)

  • New Features:
  • In functions, the new `pre` clause, placed right before the `is` keyword, checks one condition and issues an error if it is not met: golden := proc(n :: number) # approximation of golden ratio pre isint(n) and n > -1 is # if n

New in Agena 2.11.0 RC 2 (Oct 4, 2017)

  • The new function `hypot4` computes sqrt(x^2
  • y^2), avoiding over- and underflow.
  • The new function `math.clip` clips its argument between two numbers.
  • The new function `math.chop` shrinks a number more or less near zero to exactly zero, using one of many methods.
  • `math.rectangular` can now also compute the box distribution Pi, and has also been fixed.
  • The new function `math.triangular` computes the triangular function.
  • The new function `math.fpclassify` determines the type of a (floating-point) number; it is a port to C's fpclassify.
  • The new function `math.invroot` approximates the inverse root 1/root(x, degree) using the Quake III method.
  • The new function `math.dirac` computes the Dirac delta function.
  • The `rect` and `math.zeroin` functions have been removed. Use the more general functions `math.rectangular` and `math.chop` instead. Aliases have been provided, however, to provide backward compatibility.
  • `cosc` has become a function and is no longer an operator.
  • `ads.desc`: If no description has explicitely been written to the base, the function now returns the empty string instead of 74 blanks. Also, the function did not correctly write the description, this has been fixed.
  • `ads.attrib`: The function now also returns the description in the 'description' field.
  • `ads.getallindices`, `ads.invalids` returned wrong values. This has been fixed.
  • `ads.clean` corrupted files. This has been fixed. Currently, the function does not clean a file of it contains a comment.
  • Improved error handling of many `ads` functions.
  • Changes to the sources to compile in DJGPP/GCC 7.2.0. GCC 4.7.3, however, is still used to compile the DOS version as DJGPP/GCC 7.2.0 features faulty math functions.
  • This release has been Valgrind-checked on x86 Linux to ensure there are no memory leaks.

New in Agena 2.10.4 (Aug 7, 2017)

  • The new keyword `procname` refers to the function in which it is used. You can thus programme recursive procedures without using its real name in the procedure body but with this reference. Note that `procname` refers to the function and does not return its name as a string.
  • `binomial` has been extended to also process negative arguments and also floats.
  • `fact` now accepts any rational argument that is non-integral.
  • The second argument to `root` is now optional and by default is 2.
  • Some bitwise operations on Solaris 10, DOS and Windows did not return the same results as on other platforms. This has been fixed (int64_t had four bytes instead of eight).
  • The new `hypot3` function returns sqrt(1
  • x^2), avoiding under- and overflows.
  • The new function `calc.chebycoeffs` computes Chebyshev coefficients.
  • The new function `calc.cheby` returns a function to compute the Chebyshev interpolant of a univariate or multivariate function, and optionally computes a derivative. Depending on the type of function to be differentiated it can be faster and more accurate than `calc.xpdiff` if you provide the proper window parameters.
  • The new procedure `calc.savgol` computes a Savitzky–Golay filter for a univariate function f to smooth its data. `calc.savgolcoeffs` computes the Savitzky–Golay coefficients.
  • The new procedure `calc.smoothstep` computes a sigmoid-like interpolation and clamping function.
  • The new procedure `calc.sigmoid` computes the sigmoid function, and `calc.logistic` the logistic function.
  • The new procedure `calc.gd` computes the Gudermannian function.
  • The new function `hashes.digitsum` omputes the digit sum of a number to a given base.
  • Improved error messages when comparing values of different types.
  • Improved error messages of the `io` and `os` libraries.
  • `debug.getinfo` now also checks whether the parameter list of a function contains `?`, i.e. the varargs placeholder, with the 'v' option. It is indicated by the 'varargs' key. If the parameters of a function include the `?` placeholder, the 'arity' entry denotes the number of all `static` parameters (without a count to `?`) instead of -2147483648.
  • Moved and renamed some C API functions from lapi.c to agnxlib.c for consistency: agnL_fillarray, agnL_islinalgvector, agnL_onexit.
  • The new C API function `agnL_fncall` conventiently runs a numerical Agena function and returns its result as a lua_Number.
  • In Windows, some of the plus package DLLs have been reduced in size.
  • The `Crash Course` has been updated.

New in Agena 2.10.3 (Jul 3, 2017)

  • Functions could not be properly dumped and re-read with the `strings.dump`/`loadstring` function pair since Agena 2.1.2. This has been fixed. Thus, an out-of-the-box method to also serialise data is available again by putting them in `return` statements.
  • Date and time values can now be directly passed to `os.date`.
  • Modified sources so that GCC 6.3.0 does not issue warnings.

New in Agena 2.10.2 (Jun 20, 2017)

  • `for` loops can now also be combined with an additional `until` clause, e.g.: > for i to 5 until i = 3 do print(i) od; 1 2 > for i in [1, 2, 3, 4, 5] until i = 3 do print(i) od; 1 2
  • The `in` operator could not detect structures in sequences and registers. This has been changed.
  • The `|-` absolute difference operator can now also process complex numbers. Also reduced its precedence to the one of `in`.
  • `tables.dimension` did not correctly set up rows and when updating a row later, also all other rows where overwritten
  • this has been fixed.
  • Functions with remember tables caused memory faults if the respective `return` statement included a call to _another_ function. This has been fixed. Also, if this other function called has been written in the Agena language, its result has not been put into the remember table. This can currently not be fixed, but an error will be issued now. Define an auxiliary variable storing the result of the function call and then use this variable in the `return` statement.
  • `calc.xpdiff` can now calculate the second and third derivative by passing the new `deriv=2` and `deriv=3` options. Corrected error message. The function now also returns results near undefined domains.
  • `calc.minimum` and `calc.maximum` always returned exceptions. This has been fixed.
  • `calc.zero` did not recognise the `eps` option, which has been fixed.
  • `calc.symdiff` has been removed and a macro has been provided to `calc.xpdiff`.
  • `math.fib` returned wrong results. This has been fixed, and the function now includes error handling.
  • `math.convertbase` erroneously declared a global variable. This has been fixed.
  • The new function `cas` returns sin(x) + cos(x), with x either a number or complex number, the efficient way.
  • The falling factorial function `math.fall` computes x*(x
  • 1)*(x
  • 2)* ... *(x
  • n + 1). With negative n, it computes the rising factorial function.
  • `arccot` and `cot` have become 9 percent faster.
  • Removed unused keywords `apply`, `mne` and `let`.
  • Added all available date specifiers supported by `os.date` to the manual.
  • Cleaned up test cases a little bit.

New in Agena 2.10.1 (May 15, 2017)

  • The new function `calc.isdiff` checks for the differentiability of a univariate or multivariate function at a point.
  • `calc.xpdiff` can now process multivariate functions f. As such, the epsilon and delta arguments must now be passed as options of the form eps=, delta=, with both defaults now determined by the magnitude of f's first argument, e.g. diff.xpdiff(f, 1, 2, 3, delta=1e-7, eps=1e-8).
  • Fixed `hashes.md5` which sometimes produced wrong MD5 values.
  • `math.random` did not recognise its third argument when given. The function also did not recognise very large lower and upper bounds properly and sometimes returned out-of-range results when given a lower or upper limit. This has all been fixed.
  • The `restart` statement did not reset the seeds for `math.random`. This has been fixed.
  • If called without arguments, `math.randomseed` now returns the current seeds.
  • `expx2` returned `undefined` with values towards -/+infinity. This has been fixed. The second argument has become optional and by default is positive, i.e. exp(x*x) is computed.
  • `math.norm` did not recognise its third argument when given and always normalised to the range [0, 1]. This has been fixed. Optimised code of the `stats` and `calc` packages, and `linalg.gsolve`.
  • The C API function `agn_getpairnumbers` has been renamed to `agn_getpairinumbers`. A macro has been provided to ensure backward compatibility.
  • Added eComStation OS/2 YUM installation instructions to the manual.

New in Agena 2.10.0 (May 5, 2017)

  • New features:
  • The `if` operator accepts an optional preceding `with` clause. It easily allows to define one or more auxiliary variables that are local to this operator only: > x := Pi; > a := with n := 2*x -> if x < 0 then n else 2*n fi; which is syntactic sugar for: > x := Pi; > scope > local n := 2*x; > a := if x < 0 then n else 2*n fi > epocs;
  • The `with` statement now allows to define local variables existing only in the body of a statement, e.g.: > with a, b := 1, 2 do > print(a + b) > od; which is syntactic sugar for: > scope > local a, b := 1, 2; > print(a + b) > epocs;
  • The new `(/ ... )` constructor allows to define a sequence of constant numbers and/or strings the simple way: items may not be separated by commas, and strings do not need to be put in quotes as long as they satisfy the criteria for valid variable names (name starting with a hyphen or letter, including diacritics). Expressions like `sin(0)` etc. are not parsed. Example: > a := (/ 0 1 2 3 zero one two three '2and3' ): seq(0, 0, 1, 2, 3, zero, one, two, three, 2and3)
  • The new `empty` operator checks whether a table, set, sequence, register or string is empty. It returns the opposite of the `filled` operator.
  • The new `infinite` operator checks a number for +/- infinity.
  • The new `%%` operator returns the percentage change of two values a, b and is equal to b /% a
  • 100.
  • The new `symmod` operator works like the `irem` function but is 30 percent faster. The `irem` function has been removed but an alias has been provided for backward compatibility.
  • The new function `times` takes a start value and applies a function on it and its results for a given number of times. It optionally stores all its intermediate results to a given structure. It can be applied on any type. It can be used, for example, to easily compute the Golden ratio: times( 1 + recip x >>, 1, 33) -> 1.6180339887499
  • The new `math.lnfact` function computes the logarithmic factorial of its non-negative argument n, i.e. lngamma(n + 1).
  • The new function `math.branch` returns its argument if x is non-negative, otherwise returns 0, and vice versa.
  • The new `math.clamp` function returns x if a

New in Agena 2.9.8 (Aug 15, 2016)

  • New features:
  • The new `|-` operator computes the absolute difference of two numbers x and y, i.e. abs(x
  • y).
  • The new `identity` function just returns all its arguments.
  • The new function `strings.compare` compares two strings and returns the first position where they differ, or 0 if both strings are equal. If called with any option, the function returns the result of the C function strcmp.
  • The new `astro.cweek` function returns the calendar week of the given date, a number in the range 1 to 53, according to the ISO 8601 standard.
  • The new function `astro.lastcweek` determines the last week of a year.
  • The new function `astro.cweekmonsun` computes the Gregorian dates of the Monday and Sunday for a given calendar week.
  • The new function `os.esd` computes the Excel Serial Date.
  • The new function `os.tzdiff` computes the difference between the system's local time zone and UTC in minutes and a Boolean indicating whether daylight Saving Time is active for the given date.
  • The new function `stats.freqd` returns a frequency distribution function for a sample that can be iterated subsequently to return the number of all occurrences step by step.
  • The new `xbase.fieldtype` function returns the dBASE data type of the given field.
  • The new `xbase.write` function writes a number, string, or boolean to a dBASE file. It can be used instead of `xbase.writenumber`, `xbase.writefloat`, `xbase.writestring`, `xbase.writeboolean`, etc.
  • The new C API function `agn_checknonnegint` checks for non-negative integers.
  • The new C API function `agn_datetosecs` takes a structure or at least three numbers and returns the number of seconds elapsed since the epoch of the system (usually January 01, 1970).
  • The new C API function `agnL_createpairnumbers` puts a pair of two numbers on top of Agena's C stack.
  • Improvements:
  • `hypot` has become around 40 % faster. `polar`, `approx`, `ilog2`, `calc.eucliddist`, `stats.neighbours` and various fractals package functions benefit from this increas in speed, as well.
  • `math.roundf` has become 13 percent faster.
  • `calc.eucliddist` now accepts multivariate functions and returns more precise results.
  • `calc.iscont` and `calc.limit` now can also process multivariate functions. If you would like give a self-defined epsilon, it must be passed as an 'eps': option as the very last argument. For example, if the function is f := x + y >>, with x = 1, y = 3, and eps = 1e-4, the call would be: `calc.limit(f, 1, 3, eps = 1e-4)`.
  • `calc.diff` now can also process multivariate functions. If you want to pass a user-defined accuracy value h, pass the eps=h option as the very last argument instead of passing h as the third argument.
  • `calc.limit` can now return the left-sided limit by passing the side='left' option, the right-sided limit by passing the side='right' option, the left- and right-sided limit by passing the side='both' option; and the bidirectional, the left-sided, and the right-sided limits with the side='all' option.
  • `os.date`: the day of week ('wday' field) is now determined according to the ISO 8601 norm, where 1 is Monday, and 7 is Sunday. You may switch back to the old behaviour (1 for Sunday, 7 for Saturday) by issueing environ.kernel(iso8601 = false).
  • `os.date`: The '*j' (Julian Date) and '*l' (Lotus Serial Date) options have been re-introduced as they have been inadvertently removed in Agena 2.8.4. Contrary to the former results returned with the '*l' format, the function now returns correct values.
  • `os.now` and `os.settime` now accept year, month, and day, and optionally hours, minutes and seconds.
  • `os.date` now also accepts a table array of integers representing year, month, day, and optionally hour, minute, second.
  • `os.datetosecs` now accepts no argument at all and in this case returns the number of seconds elapsed till the current date and time.
  • When passing `false` as the last argument to `os.lsd`, the function acknowledges daylight saving time (by default, the function always returns a Standard Time value even if Daylight Saving Time is active for the given date).
  • `astro.cdate` now also returns hours, minutes and seconds in ordinary sexagesimal notation.
  • In Windows and eComStation, `os.realpath` now by default returns a path with slashes instead of backslashes. You can override this by passing `false` as a second option.
  • `stats.obcount` and `stats.obpart` can now be passed the number of classes into which a distribution shall be subdivided with the new 'classes' option. Also, if no third argument is passed to the function, it automatically computes the step size (aka class width), with no upper limit (it is suggested to choose between 5 or 30 classes).
  • `stats.obcount` now accepts an optional fourth argument, a procedure that is applied on any element of a distribution before the function decides into which subinterval to sort it for the final count.
  • Improved memory allocation error management of `stats.quartiles` and `stats.fivenum`.
  • Improved error handling of `stats.checkcoordinate` `math.inttofpb`, `math.tobinary`.
  • `xbase.new` now also accepts the data type name 'Numeric' which is equal to 'N' and 'Number'. (There is no dBASE data type called 'Number'.)
  • The xbase package now supports signed 4-byte integers (Visual Fox Pro 'I' or 'Long' data type). Use `xbase.writelong` or `xbase.writenumber` to write 4-byte integers to a dbf file. The function automatically truncates Agena numbers to their integral part and issues an error if the numeric range [-2'147'483'647, +2'147'483'647] is exceeded. Longs can be read by LibreOffice 5.x Calc, but not by Excel.
  • The xbase package now supports timestamps (Visual Fox Pro 'T' data type). Use `xbase.writetime` to write them.
  • dBASE binary Double values can now be read by LibreOffice 5.x Calc. They can still not be read by current Excel editions.
  • `xbase.attrib` now also returns the dBASE version number.
  • `xbase.new` can now be given an explicit dBASE version number with the new version=x option. (See documentation of `xbase.new` for valid values for x). If no version option is passed, then by default the dBASE version is 0x03 = 3 decimal = dBASE III+. If at least one of the given fields is of type 'Double', then the version number is automatically changed to 0x30 = 48 decimal = Visual Fox Pro. This allows dBASE files created with Agena and containing binary Doubles to be imported into LibreOffice 5.x. Current versions of Excel still cannot read Visual Fox Pro dbf files, so you might pass the version option.
  • Besides xBASE doubles, `xbase.writenumber` can now also write xBASE floats, longs, and binary doubles. Thus, you must no longer need to check whether to use `xbase.writefloat`, `xbase.writelong`, or `xbase.writedouble`. Also improved error message.
  • The manual has been improved.
  • Bug Fixes:
  • `calc.limit` sometimes returned wrong results with removable singularities. This has been fixed.
  • The already documented `hypot2` function has now been implemented. It computes sqrt(1 + x^2), avoiding over- and underflows.
  • `os.lsd` works again if one or more arguments have been passed to it, and also now returns a correct result with dates before March 01, 1900.
  • `os.settime` now works as described in the manual.
  • `os.drivestat` and `os.settime` are available (again) in Linux.
  • `zx.genseries` always crashed. This has been fixed.
  • `utils.readcsv` now returns an error if both enclosing single and double quotes shall be removed from field values.
  • `skycrane.readcsv` now by default only deletes enclosing double quotes; single quotes around fields can no longer be removed.
  • `stats.obcount` and `stats.obpart`: The following feature does now work as described in the manual: "[...] if an element in a distribution equals the right border of the overall interval, it is considered part of the last subinterval."
  • `math.tosgesim` has been rewritten in C, improved in precision and no longer returns the second or minute 60 or greater. It has also become 30 percent faster.
  • `math.nthdigit` could not retrieve a digit in the fractional part of a number. This has been fixed.
  • `mdf` and `xdf` rounded all numbers to the wrong direction. This has been fixed. Thus, `xdf` can now be used to truncate floats to a given decimal place.
  • `gdi.pointplot` may not have worked when evaluating thickness and linestyle options. This has been fixed.
  • `os.drivestat` might not have worked in Sun Solaris. This has been fixed.

New in Agena 2.9.7 (Feb 2, 2016)

  • The new `intdiv` statement conducts an integer division of its operands and reassigns the result to the first operand.
  • The new function `calc.iscont` returns `true` if a real function is continuous at a given point, and `false` otherwise.
  • The new function `calc.limit` returns the limit of a function at a given point.
  • The new function `calc.eucliddist` computes the Euclidian distance, i.e. the straight-line distance, of two points on a curve defined by a function in one real.
  • The new function `calc.arclen` returns the arc length (curvilinear length) of a function in one real between two points.
  • The new function `calc.sinuosity` computes the ratio of the curvilinear length and the Euclidean distance between the end points of a curve.
  • The new function `calc.symdiff` computes the symmetric derivative of a function at a point. The function is three times faster than `calc.xpdiff`, but a little less accurate.
  • `math.eps` can now also compute a `mathematical` epsilon value that also takes into account the magnitude of its argument, by passing any second argument. It prevents huge precision errors with computations on very small and very large numbers.
  • `environ.kernel` returns the maximum path length with the 'pathmax' option.
  • `clock.tm` has been tuned.
  • Added another fix to `math.convertbase` with respect to the internal stack used.
  • `utils.readcsv` did not correctly strip empty quoted fields and fields enclosed by quotes containing delimiters this has been fixed.
  • `approx` returned a wrong result (i.e. `true`) if at one of its first two arguments was `infinity` and the other one was finite. This has been fixed.
  • The test suite has been corrected.
  • The number of internal number stacks has been extended from one to three stacks. You can switch between them by calling the new function `switchd` with its argument between 1 and 3. The default is stack #1. The new function `stack.selected` returns the currently selected/active stack.
  • When given a stack number, `allotted` returns the current number of values in the given stack. `stack.resetd` now also accepts one or more stacks to be cleared by passing their number(s).
  • The new function `stack.sorted` sorts all or the last given number of elements in the stack in ascending order.
  • The new function `stack.choosed` returns the number of the stack with the least number of stored values.
  • `stack.reversed` did not correctly check negative arguments. This has been fixed.
  • `pushd` can now insert values into a given stack by passing the stack = option as the last argument, avoiding explicit stack switches with calls to `switchd`. Using this option, however, may slow down the operation since processing an option takes quite some computation time. You may be better off calling `switchd`.

New in Agena 2.9.6 (Jan 13, 2016)

  • The `create table` statement can now pre-allocate both the array _and_ hash parts of a new table, e.g. `create table a(10, 200)`.
  • `math.convertbase` generally cleared the built-in numerical stack and thus could interfere with other functions still needing it. This has been changed.
  • `os.exit` now by default clears the interpreter state before leaving. The description of the function in the manual has been corrected, too.
  • `pushd` now accepts a sequence of numbers to be added to the built-in number stack.
  • `stack.reversed` can now reverse the last n values pushed onto the stack, e.g. `stack.reversed(n)`.
  • `resetd` has been moved to the `stack` library. An alias to this former base library function has been added for backward compatibility.
  • If the initialiser of `tables.dimension` is a structure, the function now creates an indidual copy of it to avoid referencing to the same structure. This was the behaviour of the former `dimension` baselib function.
  • The `mapm` package did not correctly free some of the consumed memory at exit. This has been fixed. Also, the garbage collection of the package trims the memory usage to significantly reduce general footprint of this library.

New in Agena 2.9.5 (Jan 13, 2016)

  • The new function `math.tobinary` converts a non-negative integer into its binary representation, a sequence of zeros and ones.
  • The new function `tables.newtable` returns a table with a given number or pre-allocated array and hash slots.
  • `dimension` has been completely rewritten and can now create any kind of n-dimensional table. The function has also been moved to the `tables` library (new function `tables.dimension`). An alias to the former `dimension` function in the basic library has been added for backward compatibility.
  • The `to` indexing method for tables did not work properly with some types of index ranges and in theses cases wrongly returned all elements in the array part of a table. This has been fixed.
  • With structures, the `case/of` statement now compares values for strict equality (like the `==` operator). Formerly, a Cantor-like equality check has been conducted where positions and the number of occurence of elements in a structure do not matter.
  • `stack.dumpd` can now also dump the last n values pushed onto the stack.
  • If `ads.iterate` receives a file handle only, the very first key ~ value pair in the base is returned (same as passing the empty string as the second argument). The function now can also read sequences: in this case, the function returns an iterator function that when called returns the next entry in the sequence database.
  • `ads.getall` now returns an Agena sequence of all the entries stored in a sequence database if any second argument is given. The entries are returned in the order of their physical presence in the database file; if one and the same entry is stored multiple times, it is returned multiple times.
  • `ads.createbase` now returns nothing, since returning the handle of a closed file did not make sense.
  • Memory leaks in `ads.createbase` and `ads.iterate` have been removed.
  • `ads.filepos` has been documented.

New in Agena 2.9.4 (Dec 7, 2015)

  • The new function `stats.midrange` computes the sum of the minimum and maximum value of a distribution, divided by two.
  • The new `|` operator compares two finite numbers a, b, determines whether a is less than b, a is equal to b, or a is greater than b, and returns -1, 0, or 1 respectively.
  • A numerical stack has been built into Agena. It can store numbers only. See Chapter 7.41 of the Primer and Reference for details.
  • Agena for Windows has been recompiled with GCC 4.8.1. The binaries are around 20 percent faster now.
  • `math.tobytes` had been rewritten for it did not work correctly if Agena had been compiled with GCC 4.8.x or higher. Thus, it now also works in DOS.
  • `mapm.xtonumber` could not convert a mapm arbitrary precision number into an Agena number. This has been fixed.
  • Improved error messages of `gzip.lines` and of `run`.
  • Some source files have been cleaned up, so Agena should compile better with very pedantic C compilers.
  • Extended the test suite.

New in Agena 2.9.3 (Nov 17, 2015)

  • The new `// ... \\` constructor allows to define a table of constant numbers and/or strings the simple way: items may not be separated by commas, and strings do not need to be put in quotes as long as they satisfy the criteria for valid variable names (name starting with a hyphen or letter, including diacritics). Records are supported as well. Expressions like `sin(0)` etc. are _not_ parsed
  • The new function `math.wrap` conducts a range reduction of a number to a given interval [min, max).
  • The new `inrange` operator checks whether a number is part of an interval. It is five times faster than the `in` operator. "inrange(x, a, b)" is equivalent to "x in a:b".
  • C-style comments ( /* ... */ ) are now supported.
  • The `**` operator turned into an infinite loop if the exponent was +/- `infinity` or `undefined`. This has been fixed.
  • The new `zx` package provides various elimentary mathematical functions implementing Chebyshev polynomials for sine, cosine, tangent, arcus sine, arcus cosine, arcus tangent, natural logarithm, exponentiation to the base E, general exponentiation, and square root. These functions are C implementations of the corresponding Sinclair ZX Spectrum 48k ROM Z80 assembler routines.
  • Furthermore, some auxiliary functions are provided to directly compute Chebyshev polynomial with a given coefficient vector, to reduce the range of arguments, and to retrieve or change Chebyshev coefficients. For completeness, pendents of all other ZX Spectrum math and Boolean functions are available, as well.

New in Agena 2.9.2 (Nov 5, 2015)

  • The new `utils.uuid` function creates a random version 4 universally unique identifier (UUID), or the nil UUID.
  • `os.exit` now closes the state of the interpreter before leaving for the operating system if its last argument is the Boolean `true`.
  • In eComStation, the 'halt' switch to `os.terminate` can now halt the system, but it does not power it off.
  • The new `registry` package provides limited access to the registry and should be used instead of the `debug.getregistry` function.
  • The `system` function in the `debug` library has been moved to the `environ` package. An alias has been provided for backward compatibility.
  • Garbage collection has been changed when deleting set entries via indexing.
  • In the manual, the chapters on sandboxes and scripting have been improved. Also, userdata, lightuserdata, and the registry are now briefly described. The Crash Course has been extended, as well.

New in Agena 2.9.1 (Oct 31, 2015)

  • The new `++` operator returns the next representable number larger than its argument. Likewise, `--` returns the next representable number smaller than its argument. They can be used to create open intervals, e.g. "1 in ++1 : --2" returns false, and use the same underlying C function as math.nextafter. With variables passed as arguments, the operators do not modify, i.e. increase or decrease, them (see `inc` and `dec` statements instead).
  • `put` now supports registers.
  • With sets, the standard assignment `setname[key] := value` is now supported. If value is `null`, key is deleted from the set. If value is not `null`, key is added to the set.
  • `rawset` can now delete a value from a set by passing the value as the second and `null` as the third argument.
  • The new function `numarray.purge` removes a given element from an array.
  • `numarray.include` can now insert a single number instead of an array into a numarray.
  • The new function `numarray.used` returns the estimated number of bytes consumed by the given array.
  • Arrays can now be reduced to zero size by `numarray.resize`.
  • When shrinking an array, `numarray.resize` no longer fills slots to be deleted with zeros. This prevents arrays from being modified if memory re-allocation fails.
  • The new environ.kernel/readlibbed setting returns a set of all the libraries imported in a session. The equivalent package.readlibbed set may be deprecated in the future. Likewise, environ.kernel/loaded returns the names of all standard libraries available after start-up.
  • The `insert` and `delete` statements did not cope well with complex expressions, e.g. "insert 1 into f.g(x)", with function f.g returning a structure. This has been changed.
  • With metamethods attached to tables, sequences and registers, the `insert` statement either failed or incorrectly added a value. This has all been fixed.
  • The `delete` statement did not support metamethods and thus allowed to purge values from structures protected by a proper read-only metamethod. Now, the delete statement supports metamethods: it passes `null` as the value and the data to be deleted as its key to the __writeindex metamethod. To protect values stored to structures you might define: > readonly_mt.__writeindex := proc(t, k, v) is > if unassigned v or assigned rawget(t, k) then > error('cannot delete or modify') > else > rawset(t, k, v) > fi > end;
  • The `pop`, `rotate`, `duplicate`, and `exchange` statements now issue an error if a structure features a __writeindex metamethod. This prevents read-only structures from being modified.
  • The `restart` statement did not delete loaded metatables from the environment. This has been fixed.
  • In DOS, `math.tobytes` did not work. The function now just returns `fail` on this operating system.
  • Improved the manual.

New in Agena 2.8.4 (Aug 24, 2015)

  • The new function `math.quadrant` returns the quadrant of an angle given in radians and returns an integer in [1, 4].
  • The new function `math.fdim` returns x
  • y if its argument x is greater than y, else returns 0.
  • The new function `math.isminuszero` checks for minus zero (-0).
  • The new function `math.symtrunc` returns its argument if it is in a given range, and a default otherwise.
  • In Windows, Solaris, and Debian, `math.signbit`, `math.isordered`, `fma`, `finite`, `log2`, as well as `int`, `frac` and their related functions now use C functions provided by the underlying platform instead of self-defined implementations.
  • `math.signbit` now returns correct values on formerly unsupported platforms, instead of just zero.
  • Both `antilog10` and `antilog2` have become five times faster by using the respective Cephes Math Library implementations. Please note the new ranges for the arguments: +/- 308.2547155599167 and +/- 1024, respectively. If the argument is out of these bounds, the operators return 0 or `infinity`. For very small arguments, you might use the `^` operator.
  • `stats.prange`, `stats.iqmean`, `stats.trimean`, `stats.quartiles`, `stats.fivenum`, `stats.smm`, and `stats.gsmm` now use the introsort algorithm to sort observations instead of traditional recursive Quicksort, to speed up computation times.
  • Positive numbers can now be preceded with the `+` token, as asserted in the manual. This will not effect anything.
  • `os.cpuload` crashed in Windows 2000 and earlier. This has been fixed.
  • `os.symlink` may have crashed in Windows. This has been fixed.
  • The `to` statement (not the `for` statement) could corrupt the stack in Agena 2.8.3. This has been fixed.
  • Fixed the -0 constant bug when loading or running script files.
  • Minor change to `os.system` et al: future Windows releases beyond 10 are now properly handled, provided no Win API changes will be made.
  • `os.terminate` is no longer available in Mac OS X since the Carbon framework formerly being linked caused memory leaks in Agena.
  • Improved the scheme files and parts of the Primer and Reference.

New in Agena 2.8.2 (Jul 16, 2015)

  • The new function `calc.ibeta` implements the incomplete beta integral.
  • The new function `calc.invibeta` evaluates the inverse of the incomplete beta integral.
  • `stats.acf` now optionally accepts a pre-computed arithmetic mean and the sum of all values in a distribution. This option reduces computation time to a third.
  • The new `tanc` function returns tan(x)/x for real or complex x 0, and 1 for x = 0.
  • The new `stats.invnormald` implements the inverse Normal distribution function.
  • The arguments of `calc.igamma` and `calc.igammac` have been swapped to comply with related integral functions.
  • `stats.gammadc` evaluated the Gamma distribution function instead of the complemented one. This has been fixed.
  • `calc.polygen` does not accept more than 256 arguments any longer for this could corrupt an internal stack.
  • The following functions now properly free internal memory in case of errors: `stats.acf`, `stats.acv`, `stats.prange`, `stats.neighbours`, `stats.nearby`, `calc.interp`, `calc.newtoncoeffs`.

New in Agena 2.8.1 (Jul 9, 2015)

  • `stats.trimean` now optionally accepts a given percentile rank determining the lower and upper margin.
  • The new function `stats.fivenum` returns the five-number summary of a distribution, plus the arithmetic mean.
  • The new functions `calc.Ai` and `calc.Bi` compute the Airy wave functions and their respective first derivatives.
  • The new `calc.zeta` function computes the Riemann zeta function.
  • The new `calc.polylog` function computes the polylogarithm of a given order and point in the real domain.
  • The new function `calc.En` computes the exponential integral int(exp(-x*t)/t^n, t = 1 .. infinity).
  • The new `calc.igamma` evaluates the incomplete gamma integral.
  • The new `calc.igammac` evaluates the complemented incomplete gamma integral.
  • The new `stats.gammad` Gamma distribution function returns the integral from zero to x of the gamma probability density function.
  • The new `stats.gammadc` complemented Gamma distribution function returns the integral from x to infinity of the gamma probability density function.
  • `calc.polygen` has become twenty times faster by using the same technique to access internal data as `calc.linterp` has done. The former bug that wrong results have been returned when passing more than 254 coefficients thus has also implicitely been fixed.
  • The index of the Primer and Reference, and the Crash Course have been improved, as well.

New in Agena 2.8.0 (Jun 24, 2015)

  • The new `with` statement unpacks values from a table, declares them local and then is able to access them in a block.
  • The former `with` function has been renamed to `initialise`, but there are no changes to the `import` statement.
  • The assignment statement has been extended to unpack values from a table, the `local` statement is supported, as well.
  • Record fields in tables can now be defined more easily by using the equals sign separating the - unquoted - record field name and the corresponding value.
  • `os.date` can return the Julian date if given the new '*j' format, or the Lotus 1-2-3 Serial Date if given the new '*l' format.
  • The new function `os.lsd` computes the Lotus 1-2-3 Serial Date, which is also used in Excel (known there as `Excel Serial Date`), where January 01, 1900 is day 1. It returns a number. (Day 60 = non-existent February 29, 1900 is properly handled.)
  • `os.now` also returns the Lotus 1-2-3 Serial Date with the 'lsd' key.
  • `xbase.writedate` now accepts both strings and numbers as the date to be written to a dBASE file.
  • `os.time` did not check for the existence of a given date and returned miraculous results with invalid dates. This has been fixed.
  • Remember tables sometimes failed returning a cached result if too many entries have been stored to them. This bug has been fixed.
  • The initialisation routine that searches for the main Agena library has become stricter to avoid unneccessary problems in UNIX.
  • The `values` operator has been fixed to avoid problems with strict equality checks (`==` operator).
  • On the interactive level, i.e. the Agena prompt, diacritics defined in the ISO 8859/1 Latin-1 codepage can now be part of names. Please note that within scripts stored to a file, diacratics still are not allowed within names.
  • Deprecated `stats`, `linalg`, and `xbase` functions now are correctly initialised in the compat.agn compatibility file.

New in Agena 2.7.0 (Jun 12, 2015)

  • Formerly, only one expected type of return could be defined for procedures, now you can specify up to four basic types by putting them in curly brackets, e.g.: > f := proc(x) :: {number, complex} is return 'a' end > f() In stdin at line 1: Error in `return`: unexpected type string in return.
  • There has been a subtle change on how Agena treats the last iteration value of numeric for loops if such loops are executed _on the interactive level_, i.e. not within a function: if the loop is part of a block, then the last iteration value now is accessible only in this `scope` block, but not in outer blocks: > scope > for i to 10 do od; > print(i) > epocs 11 > print(i) null > for i to 10 do od > print(i) 11 This fix has been applied to comply with the description in the Primer and Reference, so that the behaviour now is the same both with functions and the interactive level.
  • If you assign a procedure to `environ.onexit`, then when quittung Agena with `bye`, `os.exit`, or CTRL-C, this procedure will be called before exiting the interpreter. The procedure is also called when issuing the `restart` statement. Thus you may conduct file system clean-up, pass back information if Agena is being piped, save variables to disk, or anything else.
  • Remember tables can now already be assigned during procedure definition: just put the statement `feature reminisce` right after the `is` keyword. You may thus save an explicit call to `rtable.rinit` after the procedure has been defined. Thus, also anonymous procedures support remember tables now.
  • `os.system` can now directly detect Windows 10 and Windows 10 Server. The function also now correctly acknowledges Windows Server 2012 R2.
  • The `tar` package (UNIX tape archive reader) has become a part of the Agena distribution.
  • The new function `gdi.lineplot` plots lines between 2-dimensional points. It is just an easy-to-use wrapper around `gdi.pointplot` with the connect = true option.
  • `gdi.pointplot` with the connect = true option now supports the `thickness` and `linestyle` options for lines.
  • `gdi.setline`, `gdi.setcircle`, `gdi.setarc`, `gdi.setellipse`, `gdi.setrectangle`, `gdi.settriangle` now accept a thickness value as the very last argument. By default, it is 1 (= normal).
  • The new function `math.decompose` splits an integer of any base into its digits.
  • `math.ndigits` has been ported to C, and processes non-positive values, as well. It has not necessarily become faster.
  • The new C API function `agn_checkposint` checks whether a value is a positive integer.
  • The new C macro `lua_regsetinumber` sets an Agena number to the given index of a register.
  • The scheme files have been improved.
  • `environ.attrib` now checks whether a register has been assigned a user-defined type.

New in Agena 2.6.1 (May 26, 2015)

  • `environ.kernel` returns all current kernel settings when called with no argument.
  • In Windows, eComStation, and UNIX incl. Mac OS X `os.memstate`, now also returns the page size in bytes. If the memory status could not be determined in eComStation, then `os.memstate` now returns a table with all the values set to `undefined` instead of just returng `fail`.
  • `os.fattrib` now accepts a number (representing an octal value, like the argument to the UNIX chmod command)to change the mode of a file, so for example UNIX `chmod 755 file` = Agena `os.fattrib(file, 0o755)`.
  • `strings.tochars` now also accepts a sequence of numbers (unsigned chars) to be converted to a string.
  • The new function `binio.lines` creates an iterator that returns a line in a file step-by-step.
  • The new function `binio.isfdesc` checks whether a file handle is valid.
  • `binio.rewind` now accepts an optional position. If given, the function resets the file pointer to this position relative to the beginning of the file.
  • The new function `math.tobytes` returns a sequence with all the bytes of a number in Little Endian order.
  • The new function `math.tonumber` takes a sequence of numbers representing bytes and converts it into an Agena number.
  • The error messages of various I/O functions in the io and binio packages now give more detail.
  • `strings.tochars` has been patched to cope with embedded zeros.
  • `os.fattrib` could not change the date and time of files. This has been fixed. Also, in UNIX, `os.settime` issued errors
  • this has been fixed, too.
  • Corrected error messages of `os.datetosecs`.
  • The `ignorespaces` default (formerly true) has been changed: now `utils.readcsv` does not delete spaces in 1fields any longer. Also, if fields are enclosed in double qoutes, the function also automatically deletes these quotes. You can set the new `removedoublequotes = false` option to avoid this.
  • Agena for Windows now runs around 10 % faster, as it has been compiled with MinGW/GCC 4.5.2 instead of 4.6.2.
  • Two new packages have been uploaded to http://sourceforge.net/projects/agena/files/Packages:
  • a package to list, read, and extract individual files from a UNIX tar archive, and
  • a package called `Agner` with phone line availability formulaes developed by Danish Scientist Agner Krarup Erlang.

New in Agena 2.6.0 (May 11, 2015)

  • You can now `define` your own binary operators just by using functions of two arguments.
  • Added `divs.asine`, `divs.acosine`, `divs.asecant`, `divs.hsine`, `divs.hcosine`, `divs.htangent` and the proper metamethods for the arcsin, arccos, arcsec, sinh, cosh, and tanh operators, to the `divs` package. The `recip` and `~` operators now also support fractions.
  • The new `` operators return the number x (left operand) rotated a given amount of bits (right operand) to the left or the right.
  • `inc`, `dec`, `mul`, and `div` accepted function calls as the first argument. This has been fixed.
  • The `linalg` package now supports the division operator for vectors, and the `~` operator for both vectors and matrices.
  • Some `linalg` functions have been marginally improved with regards to runtime behaviour.
  • The list of available metamethods in Appendix A2 of the Primer and Reference has been extended.
  • The `shift` operator has been removed. Please use the `` for right-shifts. An alias, however, has been provided for backward compatibility.
  • Extended the scheme files.
  • The undocumented reserved words `algform` and `kthmoment` have been removed.

New in Agena 2.5.4 (May 8, 2015)

  • Due to a suggestion by a forum user, you may now include double quotes in a string delimited by single quotes without using a backslash. The same applies to single quotes embedded in a string delimited by double quotes, e.g. "'agena'" is now a valid string.
  • `inc`, `dec`, `mul`, and `div` accepted function calls as the first argument. This has been fixed.
  • The `typeof` operator could not determine user-defined types for userdata. This has been fixed.
  • The `cls` and `bye` statements can now be included in chunks (e.g. loop or procedure bodies), there are no longer syntax errors. Thus, os.execute('/usr/bin/clear') or os.exit() statements in chunks are no longer needed.
  • Two variables in `gdi.plotfn` had been declared global. This has been fixed.
  • The Linux build scripts have been corrected.

New in Agena 2.5.3 (Apr 14, 2015)

  • Due to an idea from Serbia, a new type check metamethod '__oftype' has been introduced for all structures and for userdata. If a type check metamethod exists for such an object, then it is run with calls to the :: and :- operators. If the object does not satisfy the criteria defined in the metamethod, then Agena returns `false`.
  • This also applies to function calls: if the check fails, Agena issues an error, e.g.:
  • > mt := [ '__oftype' ~ proc(x) is return type(x) = pair and left(x) :: number and right(x) :: number end ];
  • > duo := 1:2; > setmetatable(duo, mt); > f := proc(x :: pair) is return x end; > f(duo): 1:2 > duo := 'a':'b';
  • > setmetatable(duo, mt); > f(duo):
  • IN STDIN:
  • argument #1 does not satisfy type check metamethod
  • '__oftype' metamethods can also check results to procedure calls if an expected result type is specified in a procedure definition (e.g. `f := proc(x :: pair) :: pair is return x end;`).
  • User-defined types can now also be set to registers.
  • `stats.sumdataln` returned incorrect results. This has been fixed.
  • `stats.gmean` has been rewritten using logarithmic sums and now is twice as fast.
  • The new function `stats.meanvar` returns both the artithmetic mean and the variance of a distribution.
  • The new function `stats.standardise` normalises a distribution so that they become comparable.
  • The new function `stats.covar` computes the covariance of two distributions.
  • The '__sin' metamethod has been removed.

New in Agena 2.5.2 (Apr 7, 2015)

  • `gdi.plotfn` now can also plot graphs of high slope functions correctly thanks to a contribution by a Serbian user.
  • The following binary operators are now at least thrice as fast: `xor`, `atendof`, `&&`, `||`, `^^`, `~~`, ``, `::`, `:-`, `*%`, `/%`, `+%`, `-%`, `@`, and `$`.
  • The new `~` binary operator checks whether two numbers or complex numbers are not approximately equal, i.e. it is the negation of the `~=` operator.
  • The new `nand` and `nor` operators are the negations of `and` and `or`, respectively.
  • The new function `stats.cauchy` returns the probability density function 1/(Pi*b*(1+((x-a)/b)^2)), of the Cauchy distribution.
  • The new function `stats.sumdataln` sums up the natural logarithms of the observations in a distribution.
  • The new functions `stats.durbinwatson` tests the autocorrelation in the residuals from a linear regression.
  • The functions `stats.sum` and `stats.sumdata` have been merged, i.e. `sumdata` now also accepts a data selection function. `stats.sum` has been deprecated, but an alias is provided for backward-compatibility.
  • Most statistics functions now ignore `infinity` and `undefined` if present in tables. With sequences, the functions have already skipped these non-finite values.

New in Agena 2.5.1 (Mar 30, 2015)

  • Agena allowed to start a string with a single quote and finish it with a double quote, and vice versa. This has been changed: string delimiters must now either be single or double quotes.
  • Besides including one or more single quotes within a number to group digits, also underscores (like in Ada) can be used. Underscores and single quotes, however, cannot be mixed.
  • Functions alternatively can be defined using the Algol-like syntax: proc () is end, which is equal to := proc() is end.
  • The new `cis` operator computes the complex exponential function exp(I*x) = cos(x) + I*sin(x) for any real or complex argument x and is around 25 % faster than the equivalent expression exp(I*x).
  • If any Boolean is given as the last argument to `math.random`, then the sequence of random numbers should be arbitrary.
  • The new function `stats.chisquare` returns the probability density function x^((nu-2)/2) * exp(-x/2)/2^(nu/2)/gamma(nu/2), of the chisquare distribution.
  • The new function `stats.fratio` returns the probability density function gamma( (nu1+nu2)/2)/gamma(nu1/2)/gamma(nu2/2)*(nu1/nu2)^(nu1/2)* x^((nu1-2)/2) / ( 1+ (nu1/nu2)*x) ^ ((nu1+nu2)/2), of Fisher's F distribution.
  • The new function `stats.normald` returns the the probability density function exp( -(x-mu)^2/2/sigma^2 ) / sqrt(2*Pi*sigma^2), of the normal distribution.
  • The new `stats.studentst` function returns the probability density function gamma( (nu+1)/2 )/gamma(nu/2)/sqrt(nu*Pi)/(1+t^2/nu)^((nu+1)/2), of the Student's t-distribution.
  • `stats.skewness` can now compute the sample skewness of a distribution by passing an optional argument.
  • The new function `stats.kurtosis` determines the kurtosis (peakedness) of symmetric and unimodal distributions.
  • `skycrane.dice` now creates truely random numbers.
  • Agena cow correctly returns `undefined` with the numeric expressions 0^0 and 0**0. For the sake of speed of the exponentiation operators, it still incorrectly returns 1 instead of `undefined` for infinity^0.

New in Agena 2.5.0 (Mar 24, 2015)

  • `utils.writecsv` can now also write a header and enclose each value with a given string. Also, any option can now be given in the form `option = value`. The old way of sequentially passing options is still supported.
  • `stats.gmean` has been rewritten for it returned wrong values with distributions containing very small or very large values provoking underflows or overflows. Also, the function no longer returns complex values if the sign of the product of all observations is negative (returning `undefined` instead), and issues an error if the distribution contains complex values for it now computes in the real domain, only. The function has become twice as fast.
  • ``, `stats.skewness`, and `fractals.dragon` have been tuned a little bit.
  • `unpack` with a given register may have crashed Agena if the interpreter had not been compiled with GCC.
  • The `shift`, `` bitshift operators could crash Agena when called with non-numbers. This has been fixed.
  • Registers had not been correctly garbage-collected, leading to out-of-memory errors with large registers. This has been fixed.
  • The test suite now properly cleans up the namespace.
  • The manual and the scheme files have been corrected.

New in Agena 2.4.5 (Mar 12, 2015)

  • Two new modifiers for `strings.format`, `printf`, and related functions have been introduced to prevent quarrels with numerical functions that can return non-numbers in case of errors: 'D' prints an integer if the argument is a number, and the C double representation of undefined otherwise. 'F' likewise either prints a float, or the C double pendant of undefined.
  • the q modifier to `strings.format`, `printf`, etc. now works as described in the manual. The new Maple-like a modifier works like the q modifier but does not include trailing and leading double quotes.
  • The new function `strings.diffs` counts the differences between two strings: substitutions, transpositions, deletions, and insertions. Besides returning the number of differences, it can also return the types of differences. The function is thrice as fast as `strings.dleven`, but may count differently.
  • The name of the former `varprep` operator has been changed to `qmdev`. An alias has been provided for backward-compatibility (put varprep's argument in brackets).
  • The order of arguments to `stats.sd` has been changed: a) if any third argument is given (formerly second argument), the coefficient of variation is computed. b) if the optional second argument evaluates to `true`, the (unbiased) sample standard deviation is returned, otherwise the population standard deviation is computed.
  • `stats.var` has been extended to also compute the (unbiased) sample variance or the index of dispersion.
  • `stats.moment` can now also compute sample moments by passing `true` as the new fourth argument.
  • `stats.trimean` returned some sort of garbage if the distribution contained less than two observations. This has been fixed.
  • `stats.ssd` has been deprecated, please use `stats.sd(, true)` instead.
  • Improved error handling of `stats.checkcoordinate`.
  • The former `gethigh`, `getlow`, `sethigh`, and `setlow` operators are now functions moved into the math library, i.e. the new names are `math.gethigh`, etc. Aliases have been provided for backward compatibility.
  • Corrected the scheme files.

New in Agena 2.4.4 (Mar 6, 2015)

  • The new function `descend` recursively descends into a deeply nested structure and returns all elements that satisfy a given condition.
  • `recurse` now accepts multivariate functions.
  • `stats.moment` now uses the Kahan-Babuška method to prevent round-off errors.
  • `stats.kosumdata` has been renamed to `stats.sumdata`. For backward compatibility, an alias has been provided.
  • Corrected error messages of `stats.acv`. Improved error messages in some other stats functions in case of memory allocation failures.
  • `stats.iqmean`, `stats.trimean` and `stats.quartile` had to be patched once again to avoid crashes with distributions containing the value `undefined`.

New in Agena 2.4.3 (Feb 20, 2015)

  • `stats.acf`, `stats.acv`, `stats.ad, `stats.amean`, `stats.ema`, `stats.gini`, `stats.gsm`, `stats.iqmean`, `stats.meanmed`, `stats.sma`, `stats.kosum`, and `stats.zscore` and now use the Kahan-Babushka instead of the Kahan-Ozawa summation algorithm, and thus have become up to 20 percent faster now. Kahan-Babuška adds a corrective value to the pre-computed result after the last iteration, whereas Kahan and Kahan-Ozawa adds it in each iteration.
  • `stats.prange`, `stats.iqmean`, `stats.trimean`, `stats.quartiles` crashed Agena if an observation contained the value `undefined`. `stats.prange` sometimes also crashed Agena due to other reasons. This has all been fixed. - The `sadd` operator now uses Kahan-Babushka summation to prevent round-off errors.

New in Agena 2.4.2 (Feb 16, 2015)

  • The new operator `sinc` implements the unnormalised cardinal sine function, i.e. sin(x)/x.
  • The new function `rect` implements the rectangular function.
  • The new `linalg.reshape` function restructures a matrix to new dimensions and works like the corresponding Octave function of the same name.
  • The new function `math.signbit` checks whether its numeric argument has its sign bit set.
  • The new function `math.eps` returns the relative spacing between its numeric argument and its adjacent number in the machine’s floating point system.
  • The new function `stats.iqmean` returns the arithmetic mean of the interquartile range of a distribution.
  • The new function `stats.trimean` (not to be confused with `stats.trimmean`) returns the trimean and the median of a distribution to check whether it is biased.
  • Numeric `for` loops with fractional step sizes can now alternatively use the enhanced Kahan-Ozawa summation algorithm instead of the default original Kahan one, by the setting: environ.kernel(kahanozawa = true).
  • The `copy` operator can now explicitely extract the array or the hash part of a table by passing the new optional second argument 'array' or 'hash'.
  • `stats.quartiles` has been ported to C and is at least twice as fast now. Furthermore, it no longer assumes a sorted distribution. Also, the function no longer issues an error if the distribution contains less than two observations, but just returns `fail`.
  • The new `varprep` operator pre-computes a `variance sum` which must be divided either by the number of elements n in a distribution to calculate its population variance, or by n
  • 1 to compute its sample variance.
  • `stats.var` and `stats.sd` returned wrong results especially if the variance is close to the arithmetic mean of a distribution; the results sometimes were even negative or had imprecise accuracy. This has been changed by using an algorithm published by Donald Knuth / B. P. Welford, which is much more accurate
  • to the disadvantage of speed.
  • All statistics functions that determine or work with quartiles now determine the first and third quartile according to the NIST rule which has always been used by `stats.quartiles` (which had been wrongly documented): position of Q1 := entier(1/4*(n + 1)), position of Q3 := entier(3/4*(n + 1)), where n is the number of observations in a distribution.
  • `stats.isany` and `stats.isall` crashed with sequences. This has been changed.
  • Changed the `xbase` sources to prevent compiler warnings.
  • This release has been Valgrind-checked on x86 Linux and Mac to ensure there are no memory leaks

New in Agena 2.4.1 (Feb 2, 2015)

  • The new operators `antilog2` and `antilog10` raise 2 and 10 to the power of the given arguments, respectively. Depending on the support of the underlying C functions exp2 and exp10, they are around 30 % faster than the corresponding a^x operations.
  • The new `signum` operator returns 1 if its real argument is non-negative, and -1 otherwise. For complex argument z, it returns z/|z|.
  • The new function `math.koadd` adds two numbers using Kahan-Ozawa round-off error prevention.
  • The new function `stats.peaks` uses an alternative algorithm to determine peaks and valleys in time-series.
  • The new function `stats.md` returns the median deviation in a distribution.
  • The new functions `stats.isany` and `stats.isall` check whether distributions contains non-zero elements.
  • `stats.extrema` now is twice as fast than its former version.
  • The new function `stats.checkcoordinate` checks whether its argument is a pair consisting of two numbers.
  • The new function `optnumber` checks whether its argument is a number. If its argument is `null`, it returns a default number.
  • The new function `optpositive` checks whether its argument is a positive number. If its argument is `null`, it returns a default positive number. Likewise, `optposint` checks for positive integers.
  • The new function `optnonnegative` checks whether its argument is a non-negative number; if its argument is `null`, it returns a default non-negative number. Likewise, `optnonnegint` checks for positive integers.
  • The new function `optboolean` checks whether its argument is a Boolean; if its argument is `null`, it returns a default Boolean.
  • The new function `optstring` checks whether its argument is a string; if its argument is `null`, it returns a default string.
  • The new function `optcomplex` checks whether its argument is a (complex) number. If its argument is `null`, it returns a default (complex) number.
  • On Windows, `os.drivestat` returns further information on a drive: total number of clusters, number of free clusters, sectors per cluster, and bytes per sector.
  • `os.unmount` might have crashed in Solaris. This has been fixed.
  • `fma`, `isordered`, `trunc`, `log2`, and `isfinite` did not use the underlying C functions if available on the respective platform. Instead they used alternative definitions. This has been fixed.
  • Minor non-functional changes to the standard library file `lib/library.agn`.
  • The Agena Quick Reference is now edited with LibreOffice 3.4 instead of OpenOffice 4.1 due to issues with the latter application.
  • This release has been Valgrind-checked on x86 Linux and Mac to ensure there are no memory leaks

New in Agena 2.4.0 (Jan 13, 2015)

  • THE FOLLOWING MEASURES HAVE BEEN TAKEN TO TOTALLY HIDE DATA IN REGISTERS:
  • The `size` operator no longer returns the total size of a register regardless of the setting of the current top pointer. Instead, it simply returns the position of the top pointer at the time of its call. Since now there no longer is a way to determine the actual size of a register, you have to store its original size yourself. This measure also simplifies programming procedures that operate on registers, sequences, and tables.
  • Agena formerly allowed to assign values above the current top of a register. This bug has been fixed.
  • Error messages no longer indicate whether data has been hidden (obmission of the `current` word).
  • OTHER CHANGES ARE:
  • Both indices and and index ranges can now be mixed, e.g. a[2 to 3, 2] now is a valid expression.
  • The following functions now also support registers: replace`, `join`, `qsadd`, `sadd`, and `smul`, `bintersect`, `bminus`, `bisequal`, `augment`, `columns`, and `utils.writecsv`.
  • The new function `os.iseCS` determines whether Agena is running on eComStation.
  • The new function `os.islinux` determines whether Agena is running on Linux.
  • The new function `os.unmount` unmounts filesystems in the UNIX-based editions.
  • The new function `getbits` returns all 32 bits in an integer; the new function `setbits` sets the given bits to an integer.
  • `qsadd` now uses fused-multiply add to compute more accurate results.
  • The new function `os.terminate` halts, reboots, sleeps, or hibernates the system. It can also logoff or lock the current user session. It is available in the Windows, eCS, and Mac OS X editions.
  • The new function `os.monitor` puts a monitor on and off, or on stand-by. It is available in the Windows and Linux editions, only.
  • The new function `os.mouse` returns information on the number of mouse buttons, vertical and horizontal scroll wheels, a flag on whether the left and right buttons have been swapped, and the speed and threshold. It is available in the Windows edition, only.
  • The new function `os.vga` returns information on the current screen resolution, the vertical refresh rate, the colour depth, and the number of monitors attached. It is available in the Windows and eCS editions, only. `os.screensize` is now available in eComStation, as well.
  • The new function `os.hasnetwork` checks whether a network is currently present. It is available in the Windows edition, only.
  • The new function `os.isdocked` returns the status of the docking mode. It is only available in the Windows edition of Agena.
  • `os.cdrom` is now available in the eCS and Linux editions.
  • `os.uptime` is now available in the Mac OS X edition.
  • The new C API macro `lua_rawsetstringpairnumbers` sets a pair of two numbers to a table.
  • This release has been Valgrind-checked on x86 Linux and Mac to ensure there are no memory leaks.
  • BUG FIXES ARE:
  • `fma`, `math.tworaised`, and `math.isordered` did not use the underlying C functions when available on the respective platforms, this has been fixed.
  • Corrected error messages of some operators (missing reference to registers).

New in Agena 2.3.4 (Dec 29, 2014)

  • If in a procedure definition a check of the return type has been given, but the procedure had not returned anything, Agena did not complain. Now it does. Try this before and after: f := proc() :: set is end; f(); The error messages have been improved, if the return type did not match the expected one, as well.
  • The new function `strings.iscontrol` checks whether a string consists entirely of control characters such as backspaces, newlines, etc.
  • The new function `strings.isprintable` tests whether all the characters in a string can be printed at the console.
  • The new function `strings.ishex` checks whether a string represents a hexadecimal number.
  • `strings.isblank` now can alternatively check for all existing blanks.
  • `strings.glob` now can compare strings case-insensitively if the new Boolean option `true` is being passed.
  • `math.tworaised` always returned `fail` with real arguments in obviously all versions of Agena. This has been fixed. The DOS and Windows editions use the underlying C function exp2 which is very fast
  • whereas all other editions use a pow-based version if either exp2 is missing (e.g. Solaris or Linux) or is too inaccurate (eCS).
  • `ilog2` now also processes complex and fractional arguments, using the algorithm of the now defunct procedure `math.log2exp`. An alias to the latter has been provided for backward compatibility.
  • `io.anykey` and `io.getkey` are now available in eComStation
  • OS/2.
  • In eCS, `os.battery` internally did not close a handle after querying the power state. This has been changed.
  • `os.uptime` now is also available in the Solaris version of Agena.
  • `io.anykey` is now available in the DOS version.
  • In the DOS version, `io.getkey` did not work and also corrupted stdin. This has been fixed.
  • `strings.isalphaspace`, `strings.isloweralpha`, `strings.isupperalpha` returned wrong results in one case (ASCII #213 and 173 with codepage 850). This has been fixed.
  • `strings.ismagic` returned a wrong results. This has been changed.
  • `strings.isspec`, `strings.isalphaspec`, `strings.isloweralpha`, `strings.isupperalpha`, `strings.ismagic`, `strings.isalpha`, `strings.isalphaspace`, and `strings.isalphanumeric` have been tuned by around two percent.
  • The schema files have been updated.
  • The test suite has been improved.

New in Agena 2.3.3 (Dec 10, 2014)

  • A `when` condition can now be added to a `return` statement that does not return any value including `null`.
  • The new function `ilog10` returns the integral part of the logarithm of a value to the base 10.
  • The new function `math.ceilpow2` rounds an integer up to the next highest power of 2.
  • The new function `math.morton` interleaves the bits of two integers.
  • The new function `math.expminusone` returns a value equivalent to exp(x)
  • It is computed in a way that is accurate even if x is near 0.
  • The new function `math.lnplusone` returns a value equivalent to ln(x
  • It is computed in a way that is accurate even if x is near 1.
  • The new function `math.log2exp` extracts the exponent of a number and returns entier(log2(x)), but is much faster.
  • The new function `math.isordered` checks whether at least one of two numbers is `undefined`.
  • `math.tworaised` returns 2^x, with x of type number or complex, but is much faster than the exponentiation operators ^ and **.
  • The new function `math.copysign` returns a number with the magnitude of x and the sign of y.
  • The new function `math.arccosh` determines the inverse hyperbolic cosine in the real domain and is around thrice as fast as the universal `arccosh` function.
  • The new function `os.cdrom` opens and closes the tray of an optical disk drive. It can also eject any other removable drive. It is available in the Windows edition of Agena only.
  • The new function `os.isremovable` checks whether a given drive is removable. It is available in the Windows edition of Agena only. `os.isvaliddrive` determines whether a drive is connected to the file system.
  • The new function `os.ismounted` checks whether a given drive has been mounted. It is available in the Windows edition of Agena only.
  • The new function `os.isvaliddrive` checks whether a drive has been mounted to the file system. It is available in the eCS and Windows editions of Agena only.
  • The new function `os.curdrive` returns the letter of the current drive in eCS, DOS, and Windows.
  • `ilog2` and `math.ceillog2` now return `undefined` instead of issuing an error if given a non-positive integer.
  • `arccosh` returned a complex result with real argument zero. This has been fixed.
  • `skycrane.scribe` did not correctly print elements when being passed more than one structure. This has been changed.
  • `gdi.plotfn` issued an error if one of the `functions` to be plotted (in the first argument) was actually `null`. Now the function simply ignores these cases.
  • There may have been problems on Mac OS X when importing the `gdi` package due to incorrect file access rights. This has been fixed.
  • OS X returned a warning message when running `os.freemem`. This has been changed.
  • `os.cpuinfo` has been fixed in the Linux editions of Agena.
  • The `setbit`, `arccosh`, `arcsch` functions have been tweaked a little bit.
  • The testsuite did not feature the lew_nist.agb file. This has been corrected.

New in Agena 2.3.2 (Nov 27, 2014)

  • The new function `os.uptime` returns the number of seconds a system has been running. It is available in eComStation
  • On eComStation, `os.memstate` now also returns the maximum number of bytes available for a process ('maxprmem' key), and the maximum number of shareable bytes available ('maxshmem' key).
  • `math.ceillog2` does not accept zero as an argument any longer.
  • `ilog2` did not work, now it does.
  • The `import`/`readlib` functionality returned misleading information in eCS - OS/2 and DOS if a `plus` package exists (compiled into the agena.exe binary), but a corresponding library agn file has not been found. This has been fixed.
  • Version information compiled into the Agena Windows binary has been corrected.
  • This release has been Valgrind-checked on x86 Linux and Mac to ensure there are no memory leaks.

New in Agena 2.3.1 (Nov 25, 2014)

  • The new `hashes` package provides functions to compute string hashes.
  • The new function `ilog2` returns the integral part of the logarithm of its argument to the base 2. It is 25 % faster than the int/log2 equivalent.
  • The new `environ.kernel/maxulong` query returns the maximum value storable to C's unsigned long ints on the respective platform.
  • The `reg` operator, when passed items, unvoluntarily sometimes returned a register with `null`s at its top. This has been fixed.
  • Three functions have been added to the `math` package that are used in the Lua/Agena parser virtual machine communication to pass numbers: `math.inttofpb`, `math.fpbtoint`, and `math.ceillog2`. For the algorithms used, please see the lmathlib.c and lobject.c file.
  • The `@` and '$' operators sometimes did not correctly return results due to stack corruption. This has been fixed.
  • Very minor tweaking to functions creating structures.
  • The source file distribution also contains all library and C source files and various other files again. - This release has been Valgrind-checked on x86 Linux and Mac to ensure there are no memory leaks.

New in Agena 2.3.0 (Nov 12, 2014)

  • The new `` operator to the right (division by The `shift` operator performing bit shifts to either direction is and will still be maintained.
  • The new functions `stats.dbscan` discovers clusters in n dimensional observations with noise using a density based algorithm, i.e. DBSCAN.
  • The new function `stats.neighbours` returns all n dimensional neighbouring points in a given radius, using the Euclidean distance method.
  • The new function `stats.acf` computes the autocorrelation of a distribution at a given lag.
  • The new function `stats.acv` returns all autocorrelations through a given lag.
  • `environ.attrib` returns further information on tables: The 'dummynode' key indicates whether a table contains an unallocated hash part (a `dummynode`), the 'length' index returns the estimated number of items in a table using a logarithmic estimation method.
  • The new function `tables.getsize` returns a guess on the number of elements in a table, an indicator on whether a table contains an unallocated hash part, and an indicator on whether null has been assigned to a table. The function is useful to determine the size of a table significantly faster than the `size` operator does, using a logarithmic instead of linear method, but may return incorrect results if the array part of a table has holes, so the programmer should make sure that the array part of a table has no holes. It also does not count the number of elements in the hash part of a table.
  • The `print` function sometimes returned incorrect results with hash parts of tables. This has been fixed.
  • When arguments have been missing, parts of error messages of various functions were incorrect. This has been fixed.
  • The OS/2 eComStation edition, contrary to the manual, now includes the `xml` package, an expat binding. To also use the `xml.readxml`, `xml.decode`, and `xml.decodexml` functions, please manually copy the xml.agn file from the Agena sources into the lib folder of your Agena installation. A fixed WarpIN installer will be provided soon.
  • The new C API function `agn_tablesize` returns the information needed by the new `tables.getsize` function.
  • The new C API function agn_asize returns the current number of elements stored in the array part of a table.
  • The new C API function agn_islinalgvector checks whether a value is a vector created with the `linalg.vector` function.
  • Some source code cleansing.
  • This release candidate has been Valgrind checked on x86 Linux and Mac to ensure there are no memory leaks.

New in Agena 2.3.0 RC 3 (Oct 27, 2014)

  • In the parameter list of a procedure, up to four type names may now be passed per parameter.
  • The `llist` package has been re-implemented in C, yielding a performance gain of two (with appends and prepends) to more than twenty times (indexed read and write accesses, insertions, and deletions). The new `iterate` function, however, is as fast as the former one. Memory consumption and garbage collection have been significantly improved, as well.
  • `llist.prepend` and `llist.append` can now insert more than one value into a list.
  • The function returned by `llist.iterate` can now skip a given number of subsequent elements if it is called with anyoptionalnon-negative integer, i.e. f := llist.iterate(a); f(); f(1).
  • The new function `llist.replicate` creates a copy of a linked list.
  • Metamethods for the `=` and `~=` operators have been added to the llist package.
  • `sadd` and `qsadd` can now sum up table values with non-numeric keys.`settype` and `gettype` could not set or retrieve user-defined types to and from userdatathis has been changed.
  • When computing a union of sequences, Agena now properly reduces its size in memory, if appropriate.
  • The `==`, `size`, `in`, `union`, `intersect`, `minus`, `sadd`, and `qsadd` operators now support userdata metamethods.
  • `environ.attrib` now also determines whether a structure has a metatable assigned ('metatable') key.
  • `skycrane.scribe` now can automatically print null's and also structures and does not issue errors with these values any longer.
  • If a file could not be found, `io.readfile`, `io.infile`, `io.readlines`, `io.nlines`, `io.skiplines`, `writefile`, returned garbage in the error message. This has been fixed.
  • Various error messages have been improved.
  • A new data structure has been added: the the memory-saving register. It is a fixed-size Agena `sequence` that also stores null's, and it is not automatically extended if more values have to be added (but see `registers.extend` and `registers.reduce` on how to extend or shrink a register). Registers allow to hide data: by resetting the pointer to the top of a register using `registers.settop`, any values stored above this pointer can neither be read nor changed. Most existing statements, operators and functions are supported. See also: `registers.gettop`. Please read Chapter 6.15 `Sandboxes`. There are no performance gains with regards to sequences, but since registers do not automatically shift elements, they are eight times faster with the respective operations.
  • The C API functions `agn_getutype` and `agn_setutype` support userdata, as well.The deprecated function `package.register` has been removed due to clashes with the new `register` token.

New in Agena 2.3.0 RC 2 (Oct 1, 2014)

  • The new functions `utils.readini` and `utils.writeini` read and write traditional INI initalisation files.
  • The new functions `io.filepos`, `binio.filepos`, and `xbase.filepos` return the current file position.
  • `io.seek`, `io.filepos`, `io.move`, `io.rewind`, `io.toend`, and `io.filesize` now support files larger that 2 GBytes, provided your compiler supports this capability (MinGW/GCC 4.5.2 does not).
  • `os.cpuload` now also works on Windows machines.
  • A potential memory leak in the `net` package, that did not yet show up, has been fixed.
  • If the `net` package had been re-initialised in a session, an error had been returned. This has been fixed.
  • `os.date` and `os.time`, `os.now`, `os.settime`, `os.computername` now also run on OS/2 eComStation.
  • On OS/2 eCS, `os.system` returns additional data on the operating system. `os.cpuinfo` now can also determine the number of cores, and the `gzip` package has become available in the OS/2 version of Agena, too.
  • Improved the sources to prevent unneccessary compiler warnings.

New in Agena 2.3.0 RC 1 (Aug 18, 2014)

  • Numeric `for` loops now support the `downto' keyword so that you can count down without using an obligatory negative `by` step size. In the `downto' context, the `by' step size should always be positive. `from' start and `to' stop values are obligatory when using the `downto' keyword.
  • The metamethods '__finite', '__entier', and '__sqrt' are no longer supported. Instead, three new metathods for operations on structures have been added: '__union' for union operations, '__intersect' to determine intersections, and '__minus' for differences. Thus, the `bags` package now also supports these three operations.
  • The `\` integer division operator did not support its metamethod and used the one for float divison (`/` operator) instead. This has been fixed.
  • The new function `stats.gini` determines the Gini coefficient, a measure of (in-)equality.
  • The new function `stats.zscore` returns a function computing the z-score (standard score) of a sample - the number of standard deviations the sample is above or below the mean of a distribution.
  • `stats.sorted` now by default uses the Introsort algorithm instead of Quicksort. This can speed up computation time thrice in ill-conditioned situations (where Quicksort would need O(n^2) operations), while not sacrificing performance in ordinary situations. Actually, Introsort uses Quicksort by default and then automatically switches to Heapsort if the recursion depth reaches 2*log(n, 2), where n is the number of elements in a structure. You may override this logic by passing the new option 'quicksort' which solely uses the traditional recursive Quicksort method to sort numbers. Also, `stats.sorted` now also can use the Heapsort algorithm exclusively if the new option 'heapsort' is being passed, and a non-recursive Quicksort algorithm devised by Niklaus Wirth with the new option 'nrquicksort'.
  • The new function `stats.meanmed` returns both the arithmetic mean and the median of a distribution, or alternatively the quotient of the mean and the median, speeding up computation times when these values are needed by around 20 percent.
  • Improved the error message of the `size` operator.

New in Agena 2.2.6 (Jul 28, 2014)

  • `stats.chauvenet` can now check specifically for lower or upper outliers by passing the option `outlier='lower'` or `outlier='upper'`, respectively.
  • `bags.remove` caused segmentation faults. This has been fixed. Moreover, all `bags` functions implemented in C have been internally changed.
  • The (undocumented) metamethods for `+`, `-`, and `*` did not work if the `bags` package has not been invoked with the `with` function or the `import/alias` statement. This has been fixed.

New in Agena 2.2.5 Update 1 (Jul 22, 2014)

  • Replaced calls to the `select` and `map` functions with `$` and `@` in various libraries.
  • Replaced most of the calls to `protect` with `try/yrt´ statements.
  • Extended the index of the `Primer and Reference` and updated the `Crash Course`.

New in Agena 2.2.5 (Jul 21, 2014)

  • The new function `mdf` rounds up a number at its n-th digit, `xdf` rounds it down.
  • The `@` (formerly `->`) operator has been fixed and can be used safely now. It still is around 40 % faster than `map`.
  • The new `$` operator, reminiscent to `@`, selects all the elements in a table, set, or sequence that satisfy a given condition checked by a univariate function. It is around 40 % faster than `select`.
  • The new 'status' option to `environ.gc` determines whether the garbage collector is running or has been stopped.

New in Agena 2.2.4 (Jul 21, 2014)

  • `stats.percentile` now also returns the lower, the upper outlier limit and the interquartile range of a distribution.
  • Improved error messages in case of wrong indexing attempts.
  • The `@`/`->` operator has been switched off due to segmentation faults. Please use the `map` function instead. Library functions concerned have been adjusted properly.

New in Agena 2.2.3 (Jul 8, 2014)

  • `stats.ad`, `stats.amean`, `stats.gmean`, `stats.hmean`, `stats.mad`, `stats.mean`, `stats.median`, `stats.qmean`, `stats.sd`, `stats.trimmean`, `stats.var` now return `fail` if a distribution contains less than two observations.
  • `stats.chauvenet` looped infinitely if the distribution contained no elements. Now it returns `fail` if a distribution contains less than two elements. The function now accepts alternative functions to compute the mean and deviation.
  • Corrected error messages of `stats.countentries`.
  • Standardised and modulised the C code of many `stats` functions.
  • `gdi` package: improved display of axes tickmarks and axes labels.
  • The new function `gdi.pointplot` plots graphs of points.

New in Agena 2.2.2 (Jun 30, 2014)

  • `if` conditions can now also be used as expressions, e.g.: a := if cond then expr1 else expr2 fi. The `is` operator is still supported but will be deprecated in one of the next major releases.
  • Syntactical sugar has been introduced for the `skip` and `break` statements: instead of putting them into `if` clauses just add the new `when` token followed by a condition, e.g.: "skip when a > 5" is equivalent to "if a > 5 then skip fi".
  • The symbol of the mapping operator has been changed to make code easier to read: please use `@` instead of `->`. The `->` symbol, however, is still supported but will be abolished in one of the next major releases.
  • The `xor` operator now works differently with non-Boolean values: it returns the first operand if the second operand evaluates to `null`, otherwise the second operand is returned, like the `alternate` function.

New in Agena 2.2.0 Update 1 (Jun 20, 2014)

  • Improvements:
  • Fixed `math.norm` for it returned incorrect results if the left border of the target interval was not equal to 0.
  • Fixed `io.eof` for it accidently returned the opposite of the expected result.
  • New: `io.rewind` sets the file position to the beginning of a file, `io.toend` sets the file position to its end.
  • New: When given a second option to `stats.scale`, the function normalises all its observations to the range [0, 1].
  • New: `stats.extrema` determines all local maxima and minima in a structure of points.
  • When given any option, `stats.ios` now first normalises the distribution to the range (-infinity, 1] (see `stats.scale`), determines the difference list, sums of its absolute differences and divides the sum of the number of occurrences minus 1 to make a distribution comparable to other ones. It thus no longer divides the sum of absolute differences by the arithmetic mean of the observations.
  • `stats.obcount`, `utils.readcsv`, `llist.append` accidently defined a global variable each. This has been fixed.
  • `environ.globals` has been changed: instead of printing the name of an undefined global variable and the corresponding line number at the console, it now returns both name and line number in a sequence of pairs.
  • Cleansed the index of the `Primer and Reference`.

New in Agena 2.2.0 (Jun 17, 2014)

  • New statements and operators:
  • The new `relaunch` statement restarts a `for/to` and `for/in` loop from its beginning, i.e. resets the control variable to its start value (`from` clause or first element, respectively).
  • The new `->` operator maps a univariate function on the elements of a table, set, sequence, and pair. It is up to 40 percent faster than the `map` function.
  • The new `duplicate` statement puts a copy of the top item of a sequence onto its top.
  • The new `exchange` statement exchanges the two topmost items of a sequence.
  • The new `rotate` statement moves elements in a sequence or table up or downwards.
  • The new `pop` operator returns the last element of a sequence and then removes it from the sequence.
  • The new `smul` operator multiplies all numbers in a table or sequence.
  • The new `mul` statement multiplies its argument by a scalar.
  • The new `div` statement divides its argument by a scalar.
  • io package:
  • The new functions `io.eof` and `binio.eof` check whether the end of a file has been reached.
  • `io.infile`, `io.readfile`, `io.writefile` now accept file handles.
  • `io.open` now accepts the strings 'read' for second argument 'r', 'write' for 'w', and 'append' for 'a'.
  • `io.write` and related functions can now directly output Booleans without applying the `tostring` function before.
  • Error handling of `io.skiplines` has been improved.
  • stats package:
  • The new function `stats.chauvenet` determines outliers in a distribution.
  • The new function `stats.fsum` applies a function on each of its elements and then sums the results up.
  • The new function `stats.fprod` applies a function on each of its elements and then multiplies the results.
  • `stats.ios` returns an experimental variation coefficient if any second argument is given.
  • `stats.mad` returns an experimental variation coefficient if any second argument is given. It also 10 % faster now.
  • `stats.gmean` conducts very fast real multiplication if the new option `true` is given.
  • `stats.ad` and `stats.sd` now return the variation coefficient if any second argument is given.
  • Code-tweaked `stats.scale` and `stats.smallest`.
  • xbase package:
  • The new function `xbase.mark` marks a record in an xBase file to be deleted
  • it does not, however, physically delete or overwrite the corresponding fields. The new function `xbase.ismarked` checks whether a record has been marked to be deleted.
  • The new functions `xbase.fields` and `xbase.records` return the number of fields and records in an xBase file, respectively.
  • The new function `xbase.isopen` checks whether its argument is a valid file handle that points to an open xBase file.
  • The new function `xbase.wipe` deletes all fields of a given record.
  • The new function `xbase.header` returns the field names of an xBASE file along with the corresponding types.
  • `xbase.readdbf` now also accepts file handles. Furthermore, a list of field numbers can be optionally passed in order to extract only certain columns.
  • The `xbase` package now supports dBASE 7 Doubles, i.e. numbers stored in binary Little Endian format.
  • `xbase.new` now accepts the names 'Logical' or 'L', 'Number' or 'N', 'Float' or 'F', (binary) 'Double' or 'O', 'Character' or 'C' (for strings up to 254 characters long), and 'Date' or 'D' to define fields.
  • `xbase.sync` now returns true even if nothing had to be flushed.
  • Improved error handling of `xbase.purge`.
  • `xbase.field` has been deprecated, please use `xbase.readdbf` instead. An `alias`, however, is provided to ensure backward compatibility.
  • Error handling of `xbase.record` has been improved.
  • astro package:
  • `astro.cdate` often returned wrong results
  • this has been fixed. It now also returns the fraction of the day.
  • Improved error messages of the `astro` package. math package
  • `math.ndigits` and `ceil` now properly check their argument.
  • `math.todecimal` has been extended to handle negative sexagesimal values intuitively.
  • The new functions `math.dd` and `math.dms` convert between TI-30 pocket calculator `decimal` sexagesimals. The new function `math.splitdms` returns the hours, degrees, and minutes of a TI-30 sexagesimal `decimal`. The functions have been added to allow easy sexagesimal arithmethic TI-30 style.
  • `math.convertbase` has become thrice as fast with decimal input, and around twice as fast otherwise.
  • Miscellaneous:
  • `calc.neville` now can also return a generating function.
  • Improved error message of `approx`, `getbit`, and `setbit`.
  • Optimised internal sequence operations.
  • The new C API function `agn_seqgetinumber` returns a lua_Number from a sequence; if a value in the sequence is not a number, then opposed to `lua_seqgetinumber`, it returns 0.
  • Added two high-resolution icons for both Agena and AgenaEdit.
  • Improved the manual.
  • This release has been Valgrind-checked on Linux and Mac to ensure there are no memory leaks.
  • Changes:
  • The `div` package has been renamed to `divs`. `div.div` has been renamed to `divs.divs`.
  • Reserved the token `when` for future use, it cannot be used as a name any longer.
  • The contents of `environ.minlong`, `environ.maxlong`, `environ.pathsep`, and `environ.buffersize` should now be queried by calls to `environ.kernel('minlong')`, `environ.kernel('maxlong')`, `environ.kernel('pathsep')`, and `environ.kernel('buffersize'), only. Any original Agena library functions can no longer be maliciously manipulated by changing these now deprecate environment variables.
  • `The functions `notisposint` and `notisnegint` have been removed since they are redundant and also could return wrong results when given two or more arguments. Use `isnonposint` and `isnnonnegint`, respectively. Aliases, however, have been provided to ensure backward-compatibility.
  • Bug fixes:
  • In short-cut functions, the `?` varargs token is no longer accepted. vararg handling in short-cut functions has never been supported, anyway. An example for a short-cut function is " x >>".
  • `linalg.ludecomp` did not correctly check for singular matrices. This has been fixed.
  • The `stats`, `linalg`, `calc`, and `xbase` packages have been modified to clear allocated memory in case errors occur.
  • The variation coefficient returned by `stats.ad` since 2.2.0 RC 1 has been incorrect. This has been fixed.
  • `stats.mad` and `stats.smallest` caused memory leaks if a distribution included `undefined`s or non-numbers. This has been fixed.
  • `skycrane.tee` did not correctly output contents when given the the format option. This has been fixed.
  • `xbase.readdbf` crashed when reading date values and also crashed when it encountered IO errors when reading doubles. It also ignored Float values. This has all been fixed.
  • The deprecate `xbase.field` ignored Date and Float values. This has been fixed. It is advised, however, to use the extended `xbase.readdbf` function instead of `xbase.field`.
  • The makefile for the DOS edition has been fixed.

New in Agena 2.2.0 RC 4 (Jun 12, 2014)

  • The new `relaunch` statement restarts a `for/to` and `for/in` loop from its beginning, i.e. resets the control variable to its start value (`from` clause or first element, respectively).
  • `stats.mad` returns an experimental variation coefficient if any second argument is given.
  • The new function `stats.chauvenet` determines outliers in a distribution.
  • Added two high-resolution icons for both Agena and AgenaEdit.

New in Agena 2.2.0 RC 3 (Jun 3, 2014)

  • The `xbase` package now supports dBASE 7 Doubles, i.e. numbers stored in binary Little Endian format.
  • `xbase.new` now accepts the names 'Logical' or 'L', 'Number' or 'N', 'Float' or 'F', (binary) 'Double' or 'O', 'Character' or 'C' (for strings one to 254 characters long), and 'Date' or 'D' to define fields.
  • `calc.neville` now can also return a generating function.
  • `linalg.ludecomp` did not correctly check for singular matrices. This has been fixed.
  • `skycrane.tee` did not correctly output contents when given the the format option. This has been fixed.
  • The `stats`, `linalg`, `calc`, and `xbase` packages have been modified to clear allocated memory in case errors occur.
  • `stats.mad` and `stats.smallest` caused memory leaks if an observation included `undefined`s or non- numbers. This has been fixed.

New in Agena 2.2.0 RC 1 (May 15, 2014)

  • The new `rotate` statement moves elements in a sequence upor downwards.
  • The new `pop` operator returns the last element of a sequence and then removes it from the sequence.
  • The new `smul` operator multiplies all numbers in a table or sequence.
  • `stats.gmean` conducts very fast real multiplication if the new option `true` is given.
  • `stats.ad` and `stats.sd` now return the variation coefficient if any second argument is given.
  • `math.ndigits` and `ceil` now properly check their argument.
  • `math.todecimal` has been extended to handle negative sexagesimal values intuitively.
  • The new functions `math.dd` and `math.dms` convert between TI-30 pocket calculator `decimal` sexagesimals. The new function `math.splitdms` returns the hours, degrees, and minutes of a TI-30 sexagesimal `decimal`. The functions have been added to allow easy sexagesimal arithmethic TI-30 style.
  • `io.write` and related functions can now directly output Booleans without applying the `tostring` function before.
  • `environ.minlong`, `environ.maxlong`, `environ.pathsep`, and `environ.buffersize` should now be queried by calls
  • to `environ.kernel('minlong')`, `environ.kernel('maxlong')`, `environ.kernel('pathsep')`, and `environ.kernel('buffersize'),only. Any original Agena library functions can no longer be maliciously manipulated by changing these now deprecate environment variables.
  • Optimised internal sequence operations.
  • The makefile for the DOS edition has been fixed.
  • This release candidate has been Valgrind-checked to make sure there are no memory leaks.

New in Agena 2.1.8 (Apr 29, 2014)

  • When specifying two permitted types for a parameter in the parameter list of a procedure, Agena when calling the procedure crashed if the passed value was not of one of the permitted types. Also, when passing `null` at a function call, the type check often did not work correctly. All this has been fixed. Type check error messages have been improved, too.
  • The new function `stats.trimmean` returns the arithmetic mean of the interior of an observation.
  • In the DOS and ANSI versions of Agena, `arctan2` returned incorrect results with complex numbers 0!x and 0!y and x = y. This has been fixed.
  • Improvement of the manual.

New in Agena 2.1.7 (Apr 10, 2014)

  • When specifying expected types in the parameter list of a procedure, Agena only checked the first data type and returned confusing error messages otherwise if more than one data type has been indicated. This has been fixed.
  • `xbase.attrib` now returns proper information on the recognised data types.
  • In the manual, the page numbers of the table of contents were incorrect. This has been changed.
  • `xbase` test cases have explicitly been added to the test suite.
  • The compilation scripts for the cordic package have been changed.

New in Agena 2.1.6 (Apr 10, 2014)

  • `os.system` can now detect Windows 8.l and Windows Server 2012 R2.
  • A long-standing bug in `xbase.new` has been patched to avoid segmentation faults.
  • The new function `xbase.writedate` writes a DATE value to an xBASE file, a string in the format YYYYMMDD.
  • The new function `xbase.writefloat` writes a FLOAT value to an xBASE file, a decimal number with a total number of 20 digits, including a maximum of 18 digits following the decimal point.
  • `xbase.readdbf`, `xbase.record`, and `xbase.readvalue` now can now read DATE and FLOAT values.
  • `xbase.record` returns LOGICAL values as either the Booleans `true` or `false`.
  • The codepage used is now stored to xBASE files.
  • The new cordic package computes various real functions (logarithm, sine, square root, etc.) with algorithms only using addition, subtraction, multiplication, division, and table lookups.
  • `xbase.isVoid` has been renamed to `xbase.isvoid`. An alias to the old function name is provided for backward compatibility.
  • `bags.attribs` has been renamed to `bags.attrib`. An alias to the old function name has been defined to assure backward compatibility.
  • The unused C API function agn_checkboolean has been removed.
  • The backward-compatibility file `compat.0.agn`, providing aliases for Agena 0.31 and earlier functions, has been removed due to clashes with the current Agena 2.x namespace.
  • The following undocumented C API functions have at least been identified: agn_usedbytes, lua_strnext, agn_getfunctiontype, agn_getrtablewritemode, agn_setreadlibbed, agn_getbitwise, agn_setbitwise, luaL_checkoff64_t, agn_setbitwise, agn_getbitwise, agn_setdebug, agn_getdebug, agn_setgui.

New in Agena 2.1.5 (Mar 11, 2014)

  • The new function `linalg.rref` computes the reduced row echelon form of any matrix.
  • The new functions `linalg.backsub` and `linalg.forsub` perform backward and forward substitutions on augmented or square triangular matrices.
  • The new function `calc.simaptive` computes the integral of a univariate function using Simpson-Simpson Adaptive Quadrature. It around 50 times faster than the C version of `calc.gtrap`, and thrice as fast as `calc.integral`. However, it is not as versatile as `calc.interp`, primarily with singularities around or within its borders.
  • `calc.gtrap` has been rewritten in C and is 20 % faster now.
  • `calc.Ei` now accepts negative values.
  • Added a subchapter on pairs to the manual and improved the Quick Reference.
  • Uploaded patched source files of the `gzip` package.

New in Agena 2.1.1 (Jan 6, 2014)

  • `try/catch`: explicit specification of an error variable right after the `catch` token is now optional. If no error variable is given, then the error message is automatically stored to the local `lasterror` variable, and the `then` keyword must be left out: > try > error('oops !') > catch > print(lasterror) > yrt; oops !
  • The `try/catch` statement sometimes did not work in procedures (unassigned error variable). This has been fixed. - The new `net.wget` function downloads HTML pages from the Web.
  • Tuned `skycrane.counter` by 10 %. The function now optionally applies the Kahan-Ozawa instead of the original Kahan summation algorithm if the new third argument is the string 'ozawa'. The corresponding C sources have been modified to prevent compiler optimisation, which could cancel the optimisations, as well.
  • `argerror` now prints the user-defined type name of a value received in its error message. If a value does not have a user-defined type, then its basic type is issued.
  • The new 'a' option to `debug.getinfo` returns the number of arguments expected by a procedure, thanks to Rob Hoelz' LuaPowerPatch.
  • Improved `index out-of-range` error message for strings. - Modified the `stats.agn`, `linalg.agn`, `library.agn`, and `ansi.agn` files with respect to their error handling.

New in Agena 2.1.0 (Jan 3, 2014)

  • For a new kind of error handling, the new `try/catch` statement has been introduced. It has been invented and written by Hu Qiwei for Lua 5.1 back in 2008.
  • The new `redo` statement restarts the current iteration of a `for/to` and `for/in` loop from the beginning.
  • The new `recip` operator returns the inverse of a number x. It is equivalent to the expression 1/x, but faster.
  • The new `stats.ema` function computes the exponential moving average of a distribution. The new function `stats.gema` returns an iterator function returning the respective exponential moving average of a distribution.
  • `*%`, `+%`, and `-%` returned `undefined` instead of a correct result if their right operand had been zero. This has been fixed.
  • Fixed an error message in `net.survey`.
  • Improved error messages for out-of-range indexing of pairs and strings.
  • In the ANSI, Solaris, and DOS versions, the `int` operator has been tuned.
  • The new C API function `agn_arraytoseq` converts a numeric array into a sequence and pushes this new sequence on top of the stack.
  • Updated the manual.

New in Agena 2.0.0 (Dec 2, 2013)

  • New statements and functions:
  • Agena 2.0 is downward-compatible to Agena 1.12, except that the tokens `import`, `alias`, `until`, and `onsuccess` are now keywords and can no longer be used as variables. Currently, there are Solaris, Debian (x86, PowerPC, Raspberry Pi), Windows, Mac, and DOS installers available for 2.0, including an updated Primer and Reference that explains all new features in detail.
  • The new loop variants `for/as` and `for/until` check a condition at the end of the current iteration and either commence the next iteration or leave the loop. This works with both `for/to`, as well as `for/in` loops. In effect, both variants execute a loop at least once until the given condition is being checked.
  • In numeric `for` loops, the `to` clause may not be given any longer. Instead, when leaving out the `to` clause, the loop iterates until the largest number representable on your platform, in C HUGE_VAL, has been reached.
  • The new `onsuccess` clause in `if` and `case` statements executes a chunk if at least one of the conditions is true.
  • The new `import` statement allows to import one or more libraries without putting their names into quotes, e.g. "import calc, stats" is equivalent to "readlib('calc', 'stats')".
  • The `alias` option to the `import` statement assigns one or more short names to the library functions initialised, e.g. "import calc alias xpdiff" is equivalent to "with('calc', 'xpdiff')", and "import calc alias" is equivalent to "with('calc')".
  • The new `..` operator allows to index tables even if its left-hand side operand evaluates to `null`. In this case, `null` is returned and no `attempt to index field ... (a null value)` error is issued. It is similar to the `getentry` function but is three times faster.
  • The new function `drem` evaluates the remainder of an integer division x/y, but contrary to `irem`, rounds the internal quotient x/y to the nearest integer instead of towards zero.
  • The new function `skycrane.todate` returns the current date and time as a formatted string.
  • The new function `io.truncate` truncates a file at the current file position.
  • The new function `io.move` changes the file position a given number of characters to the left or right.
  • The new function `io.filesize` returns the size of a file.
  • `readlib` now accepts strings as its arguments, only. Numbers are not allowed any longer.
  • If the last argument to `with` is the Boolean `false`, then the function does not write assigned short names to the console (stdout).
  • `strings.fields` now also accepts a sequence of index numbers. It does not, however, accept the index `0` any longer.
  • The Raspberry Pi Wheezy Debian installer now includes the `gdi` graphics package.
  • The `change.log` file is now correctly displayed in Windows.

New in Agena 2.0.0 RC1 (Nov 14, 2013)

  • Agena 2.0 is downward-compatible to Agena 1.12, except that the words `import` and `alias` are now keywords and can no longer be used as variables. Currently, there are Windows and Debian installers available for 2.0 RC 1. Just have a look into the Sourceforge Binaries/Agena 2.0 RC folder.
  • The new `import` statement allows to import one or more libraries without putting their names into quotes, e.g. "import calc, stats" is equivalent to "readlib('calc', 'stats')".
  • The `alias` option to the `import` statement assigns one or more short names to the library functions initialised, e.g. "import calc alias xpdiff" is equivalent to "with('calc', 'xpdiff')", and "import calc alias" is equivalent to "with('calc')".

New in Agena 1.12.9 (Nov 6, 2013)

  • `stats.prange` has been rewritten in C and has become up to 60 % faster.
  • `os.cpuinfo` now returns correct and more information on ARM-based systems.
  • In DOS and UNIX systems including Mac OS X and only in the complex domain, the exponentiation of the base 0 to the exponent 0 + r*I, with r any non-zero float, returned `undefined` instead of 0. This has been fixed.
  • In DOS and UNIX systems including Mac OS X and only in the complex domain, the exponentiation of the base 0 to the exponent r + 0*I, with r any positive float, returned `undefined` instead of 0. This has been fixed.
  • `stats.obcount` and `stats.obpart` could not include values into the rightmost subinterval. This has been fixed.
  • `calc.nakspline`, `calc.naksplinecoeffs`, `calc_clampedspline`, and `calc_clampedsplinecoeffs` provoked segmentation faults if called with a structure that contained too few points, i.e. pairs. This has been fixed by returning `fail` in these cases.
  • Potential memory deallocation errors have been removed from `calc.neville`, `calc.interp`, `calc.newtoncoeffs`, `calc.naksplinecoeffs`, `calc.clampedsplinecoeffs`, `calc.nakspline`, and `calc.clampedspline`.
  • The new C API function `agn_checkinteger` checks whether an argument is a number and an integer and - contrary to `luaL_checkinteger`
  • issues an error otherwise.

New in Agena 1.12.8b (Oct 31, 2013)

  • Improvement to debug information.
  • Minor improvements to the information displayed after entering `agena -h` in a shell.
  • The sources have been updated, include correct Debian installer creation files for both PowerPC und Intel, and a corrected configuration source file to successfully compile Agena in DOS.
  • A Raspberry Pi/Wheezy installer is now being provided.
  • The former Mac installer could not set up Agena properly on Mac OS X 10.5. This has been changed.
  • The x86 Debian installer did not correctly set up Agena, this has been fixed.

New in Agena 1.12.8 (Sep 16, 2013)

  • The new function `stats.mad` determines the median absolute deviation of a distribution.
  • The new function `bags.minclude` inserts all elements in a sequence into a bag, thus de-coupling the number of elements to be included into a bag from the limited size of Agena's arguments stack.
  • If bags included a non-numeric element, outputting the bag at the console failed. This has been hot-fixed.
  • Updated the manual and Quick Reference.

New in Agena 1.12.7 (Sep 2, 2013)

  • The new function `math.tosgesim` converts a decimal to its sexagesimal representation.
  • The new function `proot` returns the principal root of a number or complex number.
  • The new function `cbrt` determines the cubic root of a number or complex number, and is around 33 % faster than `root` with complex numbers.
  • `math.todecimal` has now been implemented in C and is 33 % faster. It also does not require an obligatory second and third argument.
  • `fractals.flip` has been implemented in C and is around 15 % faster now.
  • Solaris, Linux, Mac, and Windows, and maybe DOS sometimes returned `undefined` instead of 0 when trying to raise the complex origin to a power. This has been fixed.
  • In Solaris 10 and only with complex numbers, the underlying libc function cpow used to conduct complex exponentiation (`^` operator) sometimes returned incorrect results. This has been hot-fixed by replacing cpow with a self-written one.
  • There have been problems when trying to compile the 1.12.6 sources. This has been changed.

New in Agena 1.12.6 (Aug 24, 2013)

  • The iterator produced by `stats.gsma` always returned 0. This has been fixed.
  • `stats.obcount` and `stats.obpart` returned errors if one of the elements in an observation matched the right border of the overall subinterval (second argument). This has been fixed.
  • Added more examples on using Lua-style regular expressions to the manual.

New in Agena 1.12.5 (Aug 20, 2013)

  • `stats.obcount` and `stats.obpart` have been tuned by 55 %, using an arithmetic method to determine the fitting subinterval instead of bifurcation; thus also values both situated at the right border of a subinterval and the left border of the neighbouring subinterval are now correctly collected according to the defintion in the manual. `io.infile` sometimes did not return correct results in case a line consisted of `environ.buffersize` or more bytes (currently >= 512 bytes on Windows, but depending on the C BUF_SIZ defintion). This has been fixed. - The Mac OS installer did not include the patched `stats` package (`stats.sma`, etc.). This has been fixed.

New in Agena 1.12.4u1 (Jul 31, 2013)

  • For instructions on how to easily install the update, have a look at the libupdate.read.me file residing on the root of the agena-1.12.4-update1.zip archive. This archive can be downloaded from the Binaries/Agena 1.12.4 folder.
  • In Windows, DOS, and Mac, the Agena 1.12.4 u1 installers include the original 1.12.4 release plus this update.
  • `clock` package: when subtracting `tm` values, debugging information had been printed at the console. This has been fixed.
  • `gdi.plotfn` and `gdi.plot` did not properly print y-axis labels and the left x-axis label in some situations. This has been hot-fixed.
  • Undocumented and unused `gdi.sync` and `gdi.autosync` aliases have been removed from the `gdi` package.
  • Updated the scheme files.

New in Agena 1.12.4 (Jul 25, 2013)

  • `os.date` returned an unusable string when given a time format string. This has been changed. Also, the descriptions of `os.date` and `os.time` have been corrected in the manual.
  • `os.time` has become Year 2038-compatible and now also accepts a sequence of date and optionally time values.
  • `clock.sgstr` now returns correct results if the seconds component is a fraction.
  • The `clock` package now prevents round-off errors if the seconds component of a `tm` value also includes milliseconds. - `stats.sma`, `stats.smm`, `stats.gsma`, `stats.gsmm` exposed a memory leak if the passed structure included `undefined`. This has been fixed.
  • `stats.sma` and `stats.smm` have been tuned by removing an unnecessary Agena API call.
  • `stats.sorted` and `calc_naksplinecoeffs`, `calc.nakspline`, `calc.clampedspline` exposed memory leaks if the structure contained too many values (i.e. if internal memory allocation errors occurred). This has been changed.
  • `calc.interp` created a memory leak if it issued the error `number of coefficients must be equal to number of points`. This has been fixed.
  • `calc.interp` amd `calc.clampedspline` created a memory leak if they issued the error `expected a sequence of three sequences`. This has been fixed.

New in Agena 1.12.3 (Jul 22, 2013)

  • The new functions `stats.gsmm` and `stats.gsma` are like `stats.smm` and `stats.sma`, respectively, but return iterator functions. The larger the size of an observation, the faster they are with respect to `stats.smm` and `stats.sma`.
  • `calc.polygen` has been rewritten in C and thus is 60 % faster now.
  • `os.datetosecs` now also accepts sequences and also three up to six integers representing the date and optionally time.
  • `utils.checkdate` now also accepts tables or sequences of date/time values.
  • Out-of-range detection in `stats.sma` and `stats.smm` has been improved.
  • If the number of table entries to `os.datetosecs` is less then three, the function now returns an error.

New in Agena 1.12.2 (Jul 17, 2013)

  • The new function `stats.sma` returns the simple moving average, both in its scientific as well as its financial variation.
  • The new function `stats.smm` returns the simple moving median, both in its scientific as well as its financial variation.
  • Improved error messages of almost all `binio` functions.
  • `binio.readstring` crashed when not reading a string from a file, this has been fixed.
  • `skycrane.semaphore` has been renamed to `skycrane.count`, and an alias has been set up to link to the new function for back-compatibility.

New in Agena 1.12.1 (Jun 24, 2013)

  • The new function `os.symlink` creates a symbolic link.
  • The new function `os.readlink` returns the name of the file a symbolic link is referring. The new function `strings.separate` splits a string into its tokens surrounded by a given set of delimiters. Contrary to `split`, the delimiter at the front of a token may be different from the delimiter at its end.
  • `io.isopen` has been implemented in C and is at least 66 percent faster.
  • `os.fstat` is now Year 2038-compatible, additionally returns the device number, and in UNIX/Mac also a file ID, the disk space occupied by a file, and the optimal block size for reading or writing the file. NTFS symbolic links including NTFS junctions are now detected by the Windows version of this procedure.
  • `os.fstat`, `os.listcore` and thus `os.list` did not detect symbolic links on UNIX-based systems. This has been changed.
  • `clock.sgstr` can now also convert `tm` values.
  • `skycrane.trimpath` has become 25 percent faster.

New in Agena 1.12.0 (Jun 13, 2013)

  • Sequences can now be indexed with negative indices, determining elements from the right end of a sequence - provided that the indices are in the correct range. This also holds true when trying to index a sequence range with the `to` keyword.
  • Corrected error messages with invalid sequence indices.
  • The `create local` statement now also supports the `sequence` keyword - along with the `seq` keyword - to create local sequences. - `os.date`, when called with no argument, did not correctly return milliseconds less than 100 msecs in the time string. This has been changed.
  • Initalisation procedures for packages now should be of the form `.aux.init`. The old style `.init` is still supported but `with` will still assign a short name in this case for the initialisation procedure for backward compatibility, which you may want to avoid.
  • Corrected Chapter 6.17 `Packages`.

New in Agena 1.11.6 (Jun 6, 2013)

  • `io.readfile` now can optionally only return the contents of a file if it includes a given substring, or if it does not include a given substring.
  • The new function `io.infile` checks whether a file includes a given substring and returns `true` or `false`. It is 40 percent faster on Windows than `io.readfile` with the pattern option.
  • `stats.sorted` can now optionally use an iterative Quicksort algorithm by passing the new `true` option. Using the iterative algorithm may be faster on older machines than using the default recursive one.
  • Improved error handling of `io.readlines`, `io.nlines`, and `io.skiplines`.
  • `utils.findfiles` did not work if only one file name had been given or if a procedure has been passed. This has been changed. The function now is 40 % faster in line-per-line mode.
  • In the manual, improved Solaris and Linux installation instructions with regard to dependencies.

New in Agena 1.11.5 (May 28, 2013)

  • `skycrane.enclose` has been rewritten in C, and is four times faster now. `skycrane.semaphore` has been rewritten in C and now is 20 % faster. The function now also applies Kahan summation if the start value is a non-integer.

New in Agena 1.11.4 (May 15, 2013)

  • The new `*%` operator returns the percentage.
  • The `/%` operator returned the percentage instead of the ratio. This has been fixed.
  • Updated the Crash Course.

New in Agena 1.11.3 (May 13, 2013)

  • The new operators `+%` and `-%` add or subtract a percentage.
  • The new function `io.writefile` writes all of the given numbers or strings to a new file. The function is around twice as fast than using a combination of `io.open`, `io.write`, and `io.close`.
  • The `div` package now supports the following operators: `^`, `sqrt`, `ln`, `exp`, `abs`, `sign`, `sin`, `cos`, `tan`, and `arctan`.
  • The new function `div.numer` returns the numerator in a `div` structure.
  • The new function `div.denom` returns the denominator in a `div` structure.
  • `notisposint` can now process more than one argument.
  • The new function `notisnegint` checks whether all of its arguments are zero or positive.
  • The new function `ispositive` checks whether all of its numeric arguments are positive.
  • The new function `isnegative` checks whether all of its numeric arguments are negative.
  • The new function `isnonneg` checks whether all of its numeric arguments are zero or positive.
  • `/%` has been patched.
  • `sign` returned 1 if its argument has been `undefined`. It now returns `undefined` in these cases.

New in Agena 1.11.2 (May 3, 2013)

  • `io.readfile` now removes all newlines and all carriage returns, if the second argument `true` is being passed.
  • The new function `strings.lrtrim` removes all leading and trailing white spaces or the given leading or trailing character from a string. It does not remove spaces or the given character within the string.
  • The new constant `PiO4` is equivalent to Pi/4.
  • The new function `stats.ssd` returns the sample standard deviation.
  • `utils.decodexml` and thus `utils.readxml` now properly treat dots and underscores in XML tags and do not slice off trailing characters from these tags. Leading and trailing white spaces are now removed from the XML value. Line breaks within the XML value are still not being removed.
  • `binio.writeshortstring` and thus also `save`, which uses the formerly mentioned function, crashed Agena when trying to save strings of 255 characters or less; this has now been fixed.
  • The Quick Reference now also lists all mathematical constants available.

New in Agena 1.11.1 (Apr 23, 2013)

  • The new function `polar` converts a number or complex number into its polar form.
  • The new constant `E` is equivalent to the existing constant `Exp` = exp(1).
  • The new constant `Pi2` is equivalent to 2*Pi.
  • The new constant `PiO2` is equivalent to Pi/2.
  • `stats.numbperm` now also accepts sets of any type of elements.
  • Error handling in `stats.cdf` has been improved.
  • The pure ANSI C API functions `agn_complexreal` and `agn_compleximag` have now been documented.

New in Agena 1.11.0 (Apr 16, 2013)

  • The new `/%` operator divides two numbers and returns the result in percent.
  • The new `iqr` function returns the integer quotient and integer remainder of two numbers.
  • The new function `stats.pdf` computes the probability density function for a normal distribution.
  • The new function `stats.cdf` implements the cumulative density function.
  • The new functions `stats.ndf` and `stats.nde` help in writing new statistical distribution functions.
  • The new function `strings.isspec` checks whether a string consists entirely of special characters.
  • The new function `strings.isalphaspec` checks whether a string consists entirely of Latin letters, diacritics, and special characters.

New in Agena 1.10.5 (Apr 10, 2013)

  • `binio.writechar`, `binio.writenumber`, `binio.writelong`, `binio.writestring`, and `binio.writeshortstring` now accept further data to be saved to a file.
  • The new `div` package provides basic arithmetic functions to process fractions.
  • The `clock` package has been internally improved.
  • The `__tostring` metamethod in conjunction with `print` might have crashed Agena when trying to simply return its own non-numerical or non-string argument. This has been fixed.

New in Agena 1.10.4 (Apr 3, 2013)

  • The `ìnstr` operator in conjunction with the new 'borders' option featured a memory leak due to premature garbage collection of the returned pair. `strings.mfind` thus had also been affected. This has been fixed.
  • `os.listcore` contained a memory leak, which has been removed.
  • The test suite has been extended.
  • Agena has been successfully Valgrind-verified with the new test suite.

New in Agena 1.10.3 (Apr 2, 2013)

  • The `llist` package now uses pairs instead of dictionaries to hold values, resulting in an increase of speed of around 10 %.
  • `llist.append` can now append more than one value to a list.
  • `llist.purge` issued an error if it tried to delete the last value in a list. This has been changed.
  • `utils.findfiles` did not work any longer if a singfle file name had been passed. This has been corrected.

New in Agena 1.10.1 (Mar 26, 2013)

  • `io.readfile` has been rewritten in C. While the increase in speed on Windows is almost unnoticable, the gain on Mac OS X is 8 %.
  • In the manual, Chapter 7 Standard Libraries has been completely restructured and reformatted. Also, Chapter 8 C API Functions has been reformatted.

New in Agena 1.10.1 (Mar 19, 2013)

  • The new function `io.skiplines` skips a given number of lines in a file and may boost processing a text file when looking for data always residing at a specific part of it.
  • Improved Chapter 4.7.8 on patterns and captures in the manual.
  • Recompiled the `mapm` package for Windows.

New in Agena 1.10.0 (Mar 12, 2013)

  • The `instr` operator can now return the start and end positions of a pattern in a string with the new 'borders' option. The operator now also behaves like `strings.find` in case an invalid index has been passed (usually now resulting to `null`) instead of issuing an error.
  • The new function `strings.mfind` returns all start and end positions of a pattern found in a string.
  • The new function `strings.capitalise` capitalises a string.
  • The new character classes %v and %k for pattern matching recognise vowels including y, and consonants. - The optional third argument to `utils.writecsv` (passing the delimitor) can now either be a string or an option of the form `delim = ` or `'delim':`. If the third argument is none either, it now issues an error. This has been done to avoid confusion for `utils.readcsv` has been already been accepting the 'delim' option. Examples: > utils.writecsv(obj, 'd:/config/config.csv', delim='|'); # equal to: > utils.writecsv(obj, 'd:/config/config.csv', 'delim':'|'); # equal to: > utils.writecsv(obj, 'd:/config/config.csv', '|')

New in Agena 1.9.5 (Feb 28, 2013)

  • The new function `io.readfile` reads the entire contents of a file given by its name, a string, in binary mode, and returns it as a string.
  • If `os.remove` or `os.move` could not delete or move an existing file, they returned `true` without deleting or moving the respective file. Now they correctly issue an error. At least with GCC compiled versions of Agena, file name jokers such as `.`, `..`, `*`, and `?` are still not accepted.
  • `utils.findfiles` consumes less memory and besides a path now also accepts a list of specific files to be scanned for a text.
  • `os.listcore` has been slightly tuned.
  • he `case` statement could not properly treat indexed values in the `case` clause (e.g. case environ.os of ..., or case a[n] of ...). This has been fixed. Indexed values in the `of` clauses however have been working correctly

New in Agena 1.9.4 (Feb 22, 2013)

  • The new function `strings.glob` compares a string with a pattern including the wildcards `?` and `*`, where `?` represents exactly one unknown character, and `*` represents zero or more unknown characters.
  • os.listcore` and thus `os.list` are now much faster and more memory efficient when given file wildcards.
  • `os.list` did not always properly descent recursively into subdirectories. This has been fixed. It also now returns the absolute path to the main directory scanned as a second return.
  • `utils.findfiles` did not correctly treat wildcards, this has been changed.
  • Due to improper internal stack management, `restart` crashed Agena if the library.agn file contained an error at invocation. This has been fixed. Also `restart` now properly treats the -d command line switch (debugging mode) and prints information on re-initialisation.

New in Agena 1.9.3 (Feb 20, 2013)

  • The new function `os.cpuinfo` determines information on the processor in use, e.g. its type, number of cores and clock rate. It is fully available in Windows 2000 and above, Mac OS X, and in Linux. The only returns in common to all of the operating systems listed above are the `brand`, `frequency`, `vendor`, and `ncpu` fields. All other fields may be system-dependent. SPARCs and DOS are rudimently supported.
  • The new function `io.isopen` checks whether a file is open and also
  • contrary to `io.isfdesc` checks for a valid file position.
  • The new function `log2` returns the base-2 logarithm of a numeric or complex argument.
  • `log10` now has been implemented in C and is around 10 % faster.
  • `log` is now an operator and on average is four times faster.
  • `approx` returned a wrong result if both arguments had been `undefined` and at least one of the arguments had been of type complex. This has been changed.
  • If its second argument has multiple returns, `values` can now process all of them instead of only its first return. Thus, for example, the `unpack` function can now be used in calls to `values`.
  • The `gzip` package now is available in the DOS binary distribution.
  • Improved the index of the manual.

New in Agena 1.9.2 (Feb 6, 2013)

  • The `llist` package has been changed:
  • the package is now entirely implemented in Agena not using functions implemented in C any longer,
  • linked lists including `null`s are now properly printed and converted to strings for output,
  • `llist.listtoseq`, `llist.checklist`, `llist.getn` and `llist.seqtolist` have been removed, the first three possibly corrupting Agena's stack with maliciously manipulated llist structures.
  • The new function `llist.listtotable` converts a linked list to a plain table.

New in Agena 1.9.1 (Feb 5, 2013)

  • The new package `llist` implements linked lists which are at least six times faster than tables or sequences when having to conduct a large number of insertions or deletions.
  • The new funtion `utils.checkdate` checks whether a date and optionally a time exists.
  • The new function `os.cpuload` returns the 1, 5 and 15 minute load averages of the computer. It is available in Linux and Mac OS X only.
  • The new function `os.pid` returns Agena's process ID.
  • The new function `notisposint` checks whether a number is not a positive integer. It is 10 % faster than `not isposint`.
  • `checkoptions` now does not issue its function name in case of errors, but the name of the function that called it.
  • `os.setdate` now can set the system time in Windows. `os.execute` now issues an error if no command processor could be found.
  • The `size` operator now also works with pairs.
  • The `__size` metamethod did not work at all. This has been fixed.
  • The `__in` metamethod did not work with sets. This has been fixed.
  • `skycrane.removedquotes` has been implemented in C and thus is around three times faster.
  • `skycrane.tocomma` and `skycrane.trimpath` have been implemented in C and thus are now both around twice as fast.
  • `os.fattrib`, `os.datetosecs`, `os.settime`, `astro.sunriset`, and `astro.moonriset` did not correctly check the date and time values passed. This has been changed. `strings.dleven`, `strings.field`, `ads.getall`, and `net.receive` now correctly handle memory allocation failures.
  • Removed some few unnecessary assignments reported by DJGPP/GCC 4.7.2 in the C sources.
  • Extended the test suite and the scheme files.
  • The new C API function `agn_malloc` conveniently allocates blocks of memory, and issues an error and optionally frees blocks in case of failure.
  • The new C API function `agn_free` frees one or more blocks of memory.
  • The C API function `agn_isutypeset` now also processes sets.
  • The new C API function `agn_isutype` checks whether the given user-defined type has been set to a table, set, pair, sequence, or procedure.

New in Agena 1.9.0 (Jan 28, 2013)

  • The new `alternate` function returns its first argument if its second argument is `null`. Otherwise it returns its second argument.
  • The -b switch to the Agena executable has been removed since its output had been the same as the -v option.
  • The Windows and UNIX/Mac versions of `strings.utf8size` contained a potential memory leak; this has been changed.
  • All binary DLLs/SOs of the plus libraries no longer contain unused code, slimming their sizes by up to 10 percent, depending on the operating system. The makefile and the sources previously importing unused header files have been changed. For example, this at all reduces the size of the Windows binaries by 55 kBytes.
  • Extended the test suite.
  • Updated the scheme files.

New in Agena 1.8.17 (Jan 22, 2013)

  • C functions which are only used in the `calc` and `astro` packages are no longer part of the libagena SO/DLL, but are part of the SOs/DLLs of the mentioned packages, slimming down memory consumption a little bit if the packages are not used.
  • Corrected typos in the Windows installer.

New in Agena 1.8.16 (Jan 21, 2013)

  • `net.survey` now returns a fourth value, a Boolean, indicating if input is available, or if a timeout or exception occurred. For performance reasons, the function now also can check explicitly for reading, writing, or `exception` sockets instead of scanning all socket modes. Besides scanning all open sockets for their status, the function now also accepts a sequence of specific sockets and only scans these.
  • The functions `net.address` and `net.remoteaddress` have now been documented.
  • `net.lookup` now also accepts numeric IP addresses as input.
  • `net.openwinsock` and `net.closewinsock` can now return `fail` plus a string containing an error message, instead of just throwing an error, by passing an argument of any type to them.
  • `utils.decodeb64` did not exist (just under the name of `utils.decode64`, without the `b`). This has been changed.
  • The new C API function `agn_pushboolean` pushes the Boolean value fail, true, or false onto the stack.
  • In the manual, especially improved the chapter on the `net` package.
  • The `astro` has not been delivered with the binary releases. This has been changed.
  • The `xml` and `bags` packages had been missing in the binary installer of the Mac edition. This has been fixed.
  • The source file distribution now features up-to-date editions of the clock and skycrane packages.
  • The install option in the makefile now works again.
  • Updated the scheme files.

New in Agena 1.8.15 (Jan 11, 2013)

  • The new function `strings.toutf8` changes an ISO-8859-15 encoded string to UTF-8. ISO-8859-15 is ISO-8859-1 plus the EUR symbol.
  • The new function `strings.tolatin` changes a UTF-8 encoded string to ISO 8859/15. ISO-8859-15 is ISO-8859-1 plus the EUR symbol.
  • The new function `strings.isutf8` detects whether the given string is in UTF-8 encoding or in pure ASCII.
  • The new function `strings.utf8size` determines the size of a UTF-8 string.
  • The new function `skycrane.dice` returns random integers in the range [1 .. 6].
  • The new function `clock.dectotm` converts a time value in decimals (of type number) into its `tm` representation.
  • The new function `clock.tmtodec` converts a `tm` value into its decimal representation of type number.
  • The new function `astro.sunriseset` determines sunrise and sunset times plus its civil, nautical, and astronomical twilight variations.
  • The new function `astro.moonriseset` returns the times of Lunar rise and set for a location in GMT.
  • The new function `astro.moonphase` returns the moon phase.
  • The new function `astro.sun` provides an easier-to-use interface to `astro.sunriseset`.
  • The new function `astro.moon` provides an easier-to-use interface to `astro.moonriseset`.
  • The new function `astro.jdate` converts a Gregorian date to the corresponding Julian date.
  • The new function `astro.dmstodec` converts coordinates in the form degree, minute, second, and their orientation 'N', 'S', 'W', or 'E' to their corresponding decimal degree (DegDec) representation.
  • The new function `astro.dectodms` does the opposite.
  • The former `utils.cdate` function has now been implemented in C and is around 60 % faster. Its new name is `astro.cdate`. An alias of `utils.cdate` to the new C version has been defined, but it may be deprecated in future Agena releases.
  • The former `utils.isleapyear` function has now been implemented in C and is around 66 % faster. Its new name is `astro.isleapyear`. An alias of `utils.ispleapyear` to the new C version has been defined, but it may be deprecated in future Agena releases.

New in Agena 1.8.14 (Jan 3, 2013)

  • `stats.median` now is 10 % faster. `stats.sorted` has become around 5 % faster.
  • The new function `stats.smallest` returns the k-th smallest number in a numeric table or sequence.
  • The new `utils.cdate` function converts a Julian date into its corresponding Gregorian calendar date representation.
  • The new `strings.isisoalpha` function checks whether a string consists entirely of ISO 8859/1 Latin-1 alphabetic lower and upper-case characters.
  • The new `strings.isisolower` function checks whether a string consists entirely of ISO 8859/1 Latin-1 alphabetic lower-case letters.
  • The new `strings.isisoupper` function checks whether a string consists entirely of ISO 8859/1 Latin-1 alphabetic upper-case letters.
  • The new `strings.isisospace` function checks whether a string consists entirely of ISO 8859/1 Latin-1 white spaces.
  • The new `strings.isisoprint` function checks whether a string consists of printable ISO 8859/1 Latin-1 characters.
  • The new `strings.isolower` and `strings.isoupper` functions convert a string to upper or lower case-letters using the ISO 8859/1 Latin-1 character set.
  • `strings.transform` applies a function to the ASCII value of each character in a string and returns a new string.
  • Updated the scheme files.

New in Agena 1.8.13 (Dec 29, 2012)

  • The `size` operator had issues with some special kind of tables (new tables containing holes in their array part). Now the operator always returns the correct number of assigned elements, for the sake of performance. (The former binary search method has been dropped, and instead a linear search of the array part has been implemented.)
  • Due to the above change, `read` does not return an `attempt to index a null value` error in the described situation any longer. - Improved the index of the manual.
  • Valgrind regression test: okay.

New in Agena 1.8.12 (Dec 20, 2012)

  • Added `skycrane.iterate` returning a function that when called returns each element in the ascending order of the keys of the original table. It also works on sets and sequences.
  • If you pass the Boolean value `true` as the very last argument to `checkoptions`, then any unknown option of type pair will be part of the resulting table, with no error issued. This makes `checkoptions` more tolerant.
  • Optimized code of `utils.readcsv`.
  • Improved error messages of `columns`. - Updated the manual. - Extended the editor scheme files.

New in Agena 1.8.11 (Dec 10, 2012)

  • `stats.sorted` now properly sort floats.
  • Removed a potential memory leak from `print` in connection with the `delim` option.

New in Agena 1.8.10 (Nov 28, 2012)

  • The new function `skycrane.move` easily moves files and directories and is an interface to `os.move`.
  • The issue with former out-of-memory errors of the new C implementation of `sorted` has been finally solved by fixing a Virtual Machine function I wrote that deeply-copies structures. The `copy` operator, however, worked flawlessly, because the Lua Virtual Machine, on which Agena is based, compensated for it.

New in Agena 1.8.9.1 (Nov 21, 2012)

  • The new `sorted` function threw ot-of-memory errors. This has been hot-fixed by re-instating the old function that worked.
  • Quarrels with the extended `calc` package under Linux have finally been solved.
  • To download the Library Update, please have a look into the binaries sourceforge.net folder, file `agena-1.8.9.1-update-os-independent.zip` and also read the `read.me` file for proper installation instructions. Updated installers are provided for Solaris, Windows, Mac, Linux, and DOS. All other users are kindly asked to install the above mentioned update.

New in Agena 1.8.9 (Nov 20, 2012)

  • The new function `selectremove` combines the functionality of `select` with the one of `remove`: The first result contains all the elements of the given structure that satisfy a given condition, the second result contains the elements of the given structure not satisfying the condition. This may speed-up computations when you need both results, maybe for post-processing, by around 33 %.
  • If a table is passed to `select` and `remove`, the new `newarray` option makes sure that the results are returned in an array with consecutive positive integral keys, not preserving the original keys of the the respective values determined. Thus, select( x :: number >>, ['a', 10, 20, 30, 40, 'z'], newarray=true) returns [10, 20, 30, 40] instead of [2 ~ 10, 3 ~ 20, 4 ~ 30, 5 ~ 40]. This saves you from passing the result to `tables.entries` when needed.
  • The new function `skycrane.sorted` sorts a table or sequence non-destructively but contrary to `sort` and `sorted` can cope with structures including values of different types. First, numbers are sorted, then strings, the others are not. The function, however, is three times slower than `sorted`.
  • `stats.issorted` now accepts a function as its second argument to determine the expected sorting order.
  • Contrary to previous claims in the manual, the `copy` operator could not (deep-)copy pairs. Now it can do so.
  • `environ.isselfref` did not work well with self-referencing pairs. This has been changed.
  • `sorted` has now been implemented in C and is around twice as fast as before.
  • The new C API function `agn_paircheckbooloption` checks whether the value at the given stack index is a pair, whether its left operand is the given string, and whether the right operand is a boolean. Returns the boolean as a number.
  • The new C API function `agn_pairgetnumbers` retrieves the numbers from the pair residing at a given stack index.
  • Documented the API C macros `lua_iscomplex`, `lua_ispair`, `lua_isset`, and `lua_isseq`.
  • Improved the manual.
  • Extended the test suite.

New in Agena 1.8.8 (Nov 8, 2012)

  • `calc.interp` and `calc.newton` have now been merged, and their functionality has been implemented in C. The name of the new function is `calc.interp`, and an alias `calc.newton` has been set up to link to the new function. If `calc.interp` is called with only one argument, the function returned is at least twice as fast when evaluating interpolation values. The new `calc.interp` version is also numerically more stable. - Added two new interpolating functions:
  • `calc.clampedspline` is a clamped cubic spline interpolation function. `calc.clampedsplinecoeffs` determines the linear, quadratic, and cubic coefficients of a clamped cubic spline.

New in Agena 1.8.7 (Nov 5, 2012)

  • `calc.interp` and `calc.newton` have now been merged, and their functionality has been implemented in C. The name of the new function is `calc.interp`, and an alias `calc.newton` has been set up to link to the new function. If `calc.interp` is called with only one argument, the function returned is at least twice as fast when evaluating interpolation values. The new `calc.interp` version is also numerically more stable.
  • Added two new interpolating functions:
  • a) `calc.clampedspline` is a clamped cubic spline interpolation function.
  • b) `calc.clampedsplinecoeffs` determines the linear, quadratic, and cubic coefficients of a clamped cubic spline

New in Agena 1.8.6 (Nov 2, 2012)

  • `checkoptions` has now been implemented in C and thus is at least twice as fast. - Added five new interpolation functions:
  • `calc.nakspline` is a `not-a-knot` interpolation function.
  • `calc.neville` interpolates according to the Aitken-Neville algorithm.
  • `calc.newton` interpolates according to the Newton rule.
  • `calc.naksplinecoeffs` determines the linear, quadratic, and cubic coefficients of a `not-a-knot`-cubic spline.
  • `calc.newtoncoeffs` computes the coefficients of the Newton form for the given points.

New in Agena 1.8.5.1 (Oct 26, 2012)

  • The new function `argerror` works like `error`, but is a littler bit smarter.
  • The new function `checkoptions` checks options, saving many lines of code.
  • The new function `skycrane.scribe` works like `io.write` and `io.writeline`, but also accepts tables and sequences. Else, it works like `io.write/line`.
  • `io.flush` has been renamed to `io.sync`. The function `io.flush` will be depracated in a future release of Agena.
  • Windows, Mac, and DOS installers including the update are available in the Binaries folder.

New in Agena 1.8.3 (Oct 10, 2012)

  • The new `subs` option to `utils.readcsv` replaces one or more occurence of a value in a line with another one.
  • The new `comma` option to `utils.readcsv` allows to transform a float with a comma in the CSV file, separating its integral from its fractional part, to an Agena float.
  • The new `dot` option in `utils.writecsv` writes floats with the decimal dot replaced by the given single character, to the CSV file, thus allowing floats with a decimal comma.
  • `stats.sum` and `stats.countitems` now accept multivariate functions.
  • Some few corrections to the manual.

New in Agena 1.8.2 (Oct 8, 2012)

  • `whereis` has now been implemented in C. Thus it is at least twice to trice as fast as before. - `os.now` now returns the difference between your local time zone and GMT in minutes including daylight saving time, and east of Greenwich, in the new `td` entry. The new `dst` entry indicates whether daylight saving time is in effect in your local time zone (the same as the 9th value in the `localtime` entry). The Julian Date and the English names of the month and day queried are returned, too.
  • `stats.scale` is a version of `linalg.scale` just for plain tables and sequences, but implemented in C.
  • The new function `stats.colnorm` returns the largest absolute value of the numbers in a table or sequence, and the value with the largest absolute value.
  • The new function `stats.rownorm` returns the sum of the absolute values of the numbers in a table or sequence.
  • The new function `stats.sum` computes the sums of all numbers in a table or sequence. Contrary to the `sadd` operator, it prevents round-off errors during summation.
  • The following functions now also accept structures including the value `undefined`. In this case, all `undefined's` are ignored in the respective computations, so that the functions can be used with incomplete observations: `stats.amean`, `stats.cumsum`, `stats.median`, `stats.sum`, and inherently `stats.minmax` and `stats.issorted`.
  • `stats.median` now longer requires a sorted structure. It checks automatically whether the input is sorted or unsorted.
  • The new function `stats.sort` sorts tables or sequences of numbers in ascending order twice as fast if the structure contains (around) more then seven elements. It also ignores `undefined's`. - Fixed error message of `linalg.scale` in case of a wrong first argument.

New in Agena 1.8.1 (Oct 1, 2012)

  • The new `skycrane.readcsv` function works like `utils.readcsv`, but with the following default options, which can be overridden: convert=false, ignorespaces=false, remove='quotes', remove='doublequotes'.
  • The new function `linalg.norm` returns the norm of a matrix or vector.
  • The new function `linalg.scale` normalises the columns of a matrix in such a way that, in each column, an element of maximum absolute value equals 1.
  • Improved error handling of `linalg.checkmatrix`, `linalg.vector`, and `linalg.matrix`. Some improvements to the manual.

New in Agena 1.8.0 (Sep 24, 2012)

  • The new function `os.now` returns various information on the current date and time, both for your local time zone and UTC/GMT, plus an indicator for your time zone, and the number of seconds elapsed since the start for the epoch. Please note that in the DOS version, local time and GMT cannot be distinguished.
  • The new function `os.datetosec` converts a date into the number of seconds elapsed since the start of an epoch.
  • The new function `os.sectodatec` takes the number of seconds elapsed since the start of an epoch and returns the date and time.
  • The new function `os.settime` sets the system clock. It is available only in the UNIX editions of Agena.
  • The new function `strings.isblank` checks whether a string consists entirely of white spaces and/or tabulators.
  • The new function `strings.isspace` checks whether a string consists entirely of white spaces.
  • `os.fcopy` destroyed a file if it was copied to itself. This will now be prevented. Also, the function now sets the file time stamp of the file to be copied to the target file.
  • `xml.decodexml` and thus `xml.readxml` could not interpret indented tags and certain XML structures. This has been changed.
  • Applied the Year 2038 fix to `os.time` and `utils.calendar.

New in Agena 1.7.10 (Sep 14, 2012)

  • Patched the VM routine that creates table arrays and dictionaries with a preallocated number of slots, so that the `size` operator can determine the number of elements actually assigned correctly.
  • The new agn_createtable C API function creates a table so that the `size` operator always returns a correct result if the array part contains holes.
  • The `select`, `remove`, and `bags.bag` functions now use the above mentioned new API function.
  • Fixed `strings.isnumeric` and `strings.iscenumeric` which wrongly returned true with empty strings.
  • Improved error handling of the `columns` function.
  • Improved and updated the regression test suite.

New in Agena 1.7.9 (Sep 10, 2012)

  • os.system can now directly detect Windows 8 and Server 2012.
  • The `size` operator returned twice the number of items actually stored in a dictionary that has been created with the `create dict` statement. This has been fixed. If a table also includes an array, the operator now is also 20 % faster.
  • bags.attribs has thus also indirectly been fixed for it returned a wrong number of entries in its first return if elements had been passed in a call to `bags.bag`.

New in Agena 1.7.8.2 (Sep 4, 2012)

  • The new function `stats.obcount` divides a numeric range into its subintervals, sorts all occurrences in an observation into these subranges and finally counts all elements in these subranges.
  • The new function `skycrane.bagtable` returns a table of bags with its keys determined by the given indices.
  • gdi.setellipse and `gdi.setellipsefilled` ignored the `colour` option. This has been changed.
  • gdi.plot used wrong axis dimensions if the `square` option has been passed. This has been fixed.
  • linalg.ludecomp inadvertently created a global variable. This has been corrected.

New in Agena 1.7.8.1 (Aug 29, 2012)

  • Corrected error handling of `stats.percentile`, `stats.prange`, `stats.skewness`, and `stats.iqr`.
  • Improved error handling of `stats.quartiles`.
  • Improved the manual.

New in Agena 1.7.8 (Aug 28, 2012)

  • Patched `stats.amean` which returned wrong results if called multiple times from within procedures.
  • Removed `stats.iosplus`.
  • The agena.xls Quick Reference file contained invalid tab names. This has been corrected.

New in Agena 1.7.7 (Aug 27, 2012)

  • Like `stats.mean`, the new function `stats.amean` returns the arithmetic mean of an observation but is more robust by avoiding arithmetic overflow and round-off errors. Thus it is, however, slower than `stats.mean`.
  • The new function `stats.iosplus` determines the volatility of an observation and contrary to `stats.ios` also allows to compare observations of different magnitudes.
  • The new function `strings.isnumeric` checks whether a string represents an integer or a float.
  • The new function `strings.iscenumeric` checks whether a string represents an integer or a float that includes one decimal-comma.
  • The new function `skycrane.getlocales` returns all locales available on your operating system.
  • The new function `skycrane.tocomma` converts a number or a numeric string to a string with an optional decimal-dot replaced by a comma.
  • Minor improvement to the C code of `stats.ios`.
  • Improvements to the Statistics Library chapter.

New in Agena 1.7.6 (Aug 20, 2012)

  • The contents of a bag is now printed in ascending order of its keys.
  • The new function `bags.attribs` returns the number of occurrence of all unique elements in a bag and also the accumulated number of all occurrences of these elements in a bag.
  • If `os.fcopy` fails, the name of the file that could not be copied is returned as a second argument.
  • The new `Skycrane` package includes auxiliary functions: an extended version of `os.fcopy`, and two little helpers.
  • The `environ.printcomplexzeroed` setting has been removed. Use the `environ.kernel/zeroedcomplex` option instead.
  • The new, or undocumented, `environ.kernel/promptnewline` option, if set to true, prints an empty line between the input and outputline regions. Just try it out.
  • In the manual, the chapter on Booleans has been extended and corrected. Also a subchapter on pattern matching and linked lists has been added. The Quick Reference has been corrected, as well.

New in Agena 1.7.5 (Aug 13, 2012)

  • Added the XML/LuaExpat package. It includes functions which are five times faster than `utils.decodexml` or `utils.readxml`.
  • Fixed a bug in `readlib` that caused segmentation faults when a C library could not be read.
  • In Solaris, the `mapm` package could not be loaded. This has been changed.

New in Agena 1.7.4 (Jul 30, 2012)

  • The core functions of the `bags` (multisets) package have now been implemented in C: `bags.bag`, `bags.include`, `bags.remove`, and `bags.bagtoset`. Thus they are around twice as fast as the former Agena implementations.
  • The `in` metamethod of the bags package has been tuned. It is now at least 4 times faster than before. - Some hardening of the `restart` statement.

New in Agena 1.7.3 (Jul 25, 2012)

  • The `create` statement threw `out of memory` errors if the user tried to assign a negative number of preallocated slots. This has been changed by preallocating zero slots in this case, which is valid a valid setting.
  • `bags.bag` threw `out of memory` exceptions if called with no argument. This has been fixed (see above for the reason).
  • Coroutines could not be created because of a name conflict with the `create` statement. This has been changed by renaming `coroutine.create` to `coroutine.setup`. To see what coroutines are, please have a look at the official Lua programming language website.

New in Agena 1.7.2 (Jul 24, 2012)

  • Extended the metamethod chapter of the manual and added a subchapter on weak tables and sequences, and garbage collection.
  • Lua's concept of weak tables has been extended to sequences. The `insert` statement now cannot be applied to weak tables.
  • `environ.attrib` now can also process pairs - and with structures, returns the user-defined type of a structure or procedure if defined. It also returns information on weak tables and sequences.
  • The new multiset package has been added, called `bags`. A bag is a kind of Cantor set that also stores the number of occurrence of each unique element.
  • (Coroutines/Threads will be usable soon, currently there is a name conflict with the `create` statement: Error at line 1: `` expected near `create`.)

New in Agena 1.7.1.1 (Jul 20, 2012)

  • The new function `augment` joins two or more tables or sequences horizontally.
  • The new function `columns` extracts the given columns from a two-dimensional table or sequence.
  • `utils.readcsv` can now remove quotes or double quotes from fields while parsing a CSV file with the new `remove` option.

New in Agena 1.7.1 (Jul 16, 2012)

  • `copy` can now also copy a table if one of its keys is this table itself (see for example `_G._G`).
  • `copy` crashed if it tried to copy structures with cycles, i.e. if it contained any structure that directly or indirectly referenced to itself. This has been fixed.
  • If the global system table `_G` has been deleted (a table containing all currently assigned global names), `restart` crashed Agena. This has been fixed.
  • Improved the manual and added subchapters on sandboxing and handling the environment, and some notes on self-referencing structures.

New in Agena 1.7.0 (Jul 11, 2012)

  • Setting `environ.printZeroedCmplxVals` did not accomplish anything. Please use `environ.printzeroedcmplxvals` instead.
  • os.curdir` will be deprecated in the next Agena 1.8 release. Please use os.chdir()` instead to determine the current working directory.
  • As announced earlier, the following left-hand side functions have now been deleted and have been substituted by their lower-case right-hand equivalents

New in Agena 1.6.15 (Jul 9, 2012)

  • The new function `sorted` returns a sorted structure whithout modifiying the original structure.
  • The new function `recurse` checks each element of a table, set, or sequence by applying a function on each of its elements.
  • The previously undocumented `printf` function is finally explained in the manual. `printf` works like C's printf which allows to format contents written to stdout.
  • `has` crashed if applied on self-referencing structures (cycles), this has been fixed.
  • `environ.isselfref` has been tuned by 600 %.
  • Improved the manual and the Quick Reference.

New in Agena 1.6.14 (Jul 4, 2012)

  • The `has` function has been tuned by a further 35 percent.

New in Agena 1.6.12 (Jun 27, 2012)

  • Patched `os.list` (and thus implicitely also `utils.findfiles`) which did not properly acknowledge filename wildcards when descending into subdirectories.
  • Further slimmed the C API by transforming lua_rawsetstringnumber, lua_rawsetstringstring, and lua_rawsetstringboolean into pre-processor macros.
  • `environ.release` now also includes the patchlevel of the lib/library.agn file as its fourth entry.
  • If the new global variable `environ.libpatchlevel` is defined in the lib/library.agn file, the main Agena Library patchlevel is also printed at start-up.
  • Slimmed down the start-up message. Type `agena -m` to get the amount of free RAM at start-up.
  • Readied Agena for lib/library.agn updates.

New in Agena 1.6.11 (Jun 25, 2012)

  • utils.decodexml` and `utils.readxml` can now ignore XML comments with the new 'nocomment' option.
  • The new function `utils.findfiles` returns all names of files that include a given search criterion.
  • Since Agena 1.6.8, `io.readlines` could crash when trying to read thousands of characters from one single line. This has been fixed.
  • Corrected storage of multiple entries with the same XML object name in `utils.decodexml`. All entries are now in the same hierarchy.

New in Agena 1.6.9 (Jun 20, 2012)

  • Re-instated `io.readlines`.
  • The following former C API functions have been deprecated but have been replaced by C pre-processor define's: lua_rawsetistring, lua_rawsetilstring, lua_sinsertlstring, lua_sinsert.
  • Removed an unnecessary C function call from the lua_rawseti procedure.
  • Removed old and unused code from the ADS library.

New in Agena 1.6.8 (Jun 19, 2012)

  • Re-instated `io.readlines`.
  • The following former C API functions have been deprecated but have been replaced by C pre-processor define's: lua_rawsetistring, lua_rawsetilstring, lua_sinsertlstring, lua_sinsert.
  • Removed an unnecessary C function call from the lua_rawseti procedure.
  • Removed old and unused code from the ADS library.

New in Agena 1.6.7 (Jun 18, 2012)

  • Extended `utils.decodexml` and `utils.encodexml` to recognize multiple occurences of the same XML objects.
  • `ads.openbase` crashed when trying to open non-ADS files. This has been fixed.
  • Shortened the C code of the lexer and the C API.

New in Agena 1.6.6 (Jun 13, 2012)

  • Upon Agena exit, the `net` package now cleans its internal open socket admin table.
  • Removed an unnecessary internal function call when printing results at the console.
  • Hardened Agena.

New in Agena 1.6.5 (Jun 11, 2012)

  • `setbit` has been rewritten in C and thus is around eight times faster than before. `getbit` has been rewritten in C and thus is around five times faster than before. It also now works correctly with negative numbers.
  • In Windows, the `net` package now cleans up the Winsock environment upon exit.
  • In Windows, `net.lookup` closed Winsock. This has been fixed.

New in Agena 1.6.4 (Jun 8, 2012)

  • The new function `utils.encodexml` creates an XML stream from a dictionary.
  • The new function `utils.writexml` writes an XML stream from a a dictionary into a file. The new function `getbit` checks whether a bit is set in an integer at a given position. In nested expressions, the `&&`, `||`, `^^`, `xor`, `::`, `:-`, and `atendof` could return 'null' instead of a correct result. This has been fixed, so that also `setbit` does now work properly. - `net.receive` no longer issues an error if an error occurs during receipt, but returns 'false' and a string with an error message. It also does not close the socket any longer in case of failure.
  • Added some more examples to Chapter 7.26, `The net package.

New in Agena 1.6.0 (May 23, 2012)

  • New Functions and Features:
  • The new function `checktype` determines whether all values in a structure are of a given type.
  • The new function `isint` checks whether all of its arguments are integers.
  • The new function `strings.dleven` returns the Damerau-Levenshtein distance of two strings.
  • The new function `stats.ad` determines the absolute deviation of all the values in a structure.
  • The new function `stats.countentries` counts the number of occurrence of all the elements in a structure.
  • The new function `stats.deltalist` returns a structure of the deltas of the respective neighbouring elements.
  • The new function `stats.gmean` returns the geometric mean of a structure.
  • The new function `stats.hmean` returns the harmonic mean of a structure.
  • The new function `stats.ios` returns a proven indicator on stability in a distribution.
  • The new function `stats.iqr` returns the interquartile range.
  • The new function `stats.issorted` checks whether all numbers in a structure are sorted in ascending order.
  • The new function `stats.moment` computes the moment of the given data about an origin.
  • The new function `stats.numbperm` returns the number of permutations.
  • The new function `stats.percentile` determines percentiles.
  • The new function `stats.skewness` returns the skewness, an indicator of the symmetry of a probability distribution.
  • The new function `stats.sumdata` sums up all the powers of a structure about an origin.
  • `stats.tovals` is now a C library function and thus is up to 40 percent faster.
  • With an empty table or sequence, `stats.qmean`, `stats.mean`, `stats.gmean`, `stats.sd`, `stats.median`, `stats.var` now return fail.
  • The maximum length for an input line in the stand-alone interpreter has been changed from 512 to 2048 characters.
  • The new environment variable `environ.maxpathlength` stores the maximum number of characters for a file path (excluding C's \0 character).
  • The new environment variables `environ.minnumber` and `environ.maxnumber` hold the minimum and maximum value an Agena number (currently an ANSI-C double) can store.
  • The new environment variable `environ.umaxlong` includes the maximum integral value of the C type unsigned long on 32+bit systems, and unsigned long on 16bit machines.
  • C API:
  • 100 % compatibility of the Agena C API to Lua's C API has been re-established by introducing Lua's *dump functions. Thus you are now able to store functions in a binary representation, e.g. by using `strings.dump` or lua_dump on the C level.
  • Introduced the new `agnL_optboolean` function to check for optional Boolean arguments and return them in case of success.
  • Bug Fixes:
  • `environ.globals` always quit with an error, this has been fixed.
  • `approx` returned false with both of its arguments being or evaluating to 'undefined'. It now returns true in this case.
  • Agena crashed when passing an empty table _and_ a delimitor to `join` this has been fixed.
  • The `colour` option is no longer being ignored by `gdi.plot`.
  • With tables, `stats.minmax` returned a wrong value for the minimum. It now works correctly.
  • With an empty table, `stats.median` returned 0, now it returns fail.
  • Contrary to the documentation, `strings.isending` returned 'true' with both strings being equal. This has been fixed.
  • `run` returned `could not open file` if an existing Agena script included a syntax error. This has been changed to a more comprehensible error message by completely rewriting the function.
  • Added Lua 5.1.4 patch 9: "Wrong code generation for some particular [e.g. complex] boolean expressions."
  • Added Lua 5.1.4 patch 11: "Parser may collect a prototype while building it." * Info: Adding Lua 5.1.4 patch 10, "[__write/__new]index metamethod may not work if metatable is its own metatable", to Agena is not necessary, for Agena already works correctly in this case.
  • Removed the unused keyword `default`.
  • Some hardening of functions and features.
  • Enhancements:
  • Added an _experimental_ version of `io.anykey` to the Mac version. However, at least on Lion, the key being pressed sometimes is echoed on the shell.
  • `utils.readcsv` now can optionally return all values in a CSV file in a flat sequence.
  • The `clock` package now supports the division operator `/` by adding it to its `tm` operator's metatable.
  • The behaviour of `with` has been changed for it could not assign short names for many library functions: If functions have been put into the .aux table, it does not assign short names for these function names; otherwise it assigns short names for _all_ other package functions.
  • Thus:
  • `package.register` to register all the library functions for `with` to assign short names, is no longer needed. It will be deprecated in one of the following releases.
  • Improved the test suite.
  • Manual:
  • Improved the manual and extended its index. Consistency: For all of the following renamings, the following old variable names are still supported.
  • `environ.MinLong` has been renamed to `environ.minlong`.
  • `environ.MaxLong` has been renamed to `environ.maxlong`.
  • `environ.BufferSize` has been renamed to `environ.buffersize`.
  • `environ.PathSep` has been renamed to `environ.pathsep`.
  • `environ.More` has has been renamed to `environ.more`.
  • `environ.WithProtected` has been renamed to `environ.withprotected`.
  • `environ.Os` has been renamed to `environ.os`.
  • `environ.Cpu` has been renamed to `environ.cpu`.
  • `environ.Release` has been renamed to `environ.release`.
  • `environ.GdiDefaultOptions` has been renamed to `environ.gdidefaultoptions`.
  • In Windows, `os.login` and `os.computername` now return 'fail' like the UNIX and OS/2 versions do.
  • The `-DCOMPAT13` switch has been finally removed for compiling an Agena 1.3.x complient version. Other:
  • Deprecated `calc.fseq` has been deleted. Please use `nseq` instead.

New in Agena 1.5.1 (Nov 15, 2011)

  • Patched `strings.fields` which did not work at all. Also, it has been converted to a C library function and thus is 2.6 times faster.
  • `strings.words` now accepts a third argument, if set to `true`, succeeding delimiters are ignored.
  • Removed a possible security leak from `io.write` and `io.writeline` and improved its error messages.
  • Patched `binio.readchar` to avoid troubles with files of size greater then 2 GBytes.
  • Corrected error messages of functions `xbase.purge`, `xbase.readvalue`, `xbase.purge`, `ads.getvalues`, `binio.readshortstring`, `os.computername`, `os.login`, `os.fattrib`, `environ.kernel`, `package.register`.
  • Terabytes can now be entered with the notation T, where is an integer, and T is the character `T`. Likewise, g denotes billions, and t trillions. See page 48 of the manual for further information.
  • Updated the manual.
  • Mostly all backward compatibility switches in the C source code have been removed for code cleansing reasons. This affects only those who try to recompile Agena 1.5 or higher with full backward compatibility to Agena 1.3 and 1.4, and with most of backward compatibility to Lua 5.0 (except old Lua 5.0 library handling).

New in Agena 1.5.0 (Sep 12, 2011)

  • `map` now can also process strings given as its second argument. The respective function and its arguments are consecutively applied to each character from left to right, and the result is returned in a sequence.
  • `run`: If you want to load and execute code from files with an 'agn' suffix, you do not have to specify the suffix in the argument any longer. So `run 'test'` and `run 'test.agn'` are now the same.
  • The `is` keyword is now obligatory to define procedures. (With GCC, use the -DCOMPAT14 switch to compile a version of Agena where the `is` keyword is still optional.)
  • The `try` statement has been deprecated and is no longer supported. (With GCC, use the -DCOMPAT14 switch to compile a version of Agena which still features this statement.)
  • The following `utils` functions have been removed: `arraysize`, `getarray`, `getwholearray`, `newarray`, `searcharray`, `setarray`. For backward compatibility, they have been added to the lib/compat.agn file. (With GCC, use the -DCOMPAT14 switch to compile a version of Agena that still suppports the original utils functions.)
  • `utils.singlesubs` has been completely rewritten. It now expects a sequence of numbers as the second argument instead of the former stringarray userdata structure. It is 35 % slower than the former version, but removal of the stringarray structure was more important.
  • `strings.include` crashed if called with 0 as the second argument. This has been fixed.
  • Applied Michael G. Schwern's May 10, 2011 patch to his `32-bit-Year 2038-Fix` date auxiliary functions used by the os and xbase packages (`Make mktime64() correct the incoming tm struct as ISO C requires.`)
  • Internal code optimisation: some library initialisation and file loading C functions use the stack to build path and filename strings. The new C aux function `concat` written by Solar Designer is now being used instead.
  • The Agena C API is now 100 % compatible to the Lua C API to facilitate porting C Lua packages to Agena.
  • The following functions have thus been renamed: lua_isnumber -> agn_isnumber, lua_isstring -> agn_isstring, luaL_optnumber -> agnL_optnumber, luaL_checknumber -> agnL_checknumber, luaL_optnumber -> agnL_optnumber, luaL_checkinteger -> agnL_checkinteger, luaL_optinteger -> agnL_optinteger.
  • The following macros have been renamed: luaL_checkint -> agnL_checkint, luaL_optint -> agnL_optint.
  • As opposed to the former Agena implementation, lua_tonumber now returns 0 like in Lua in case a non-number has been passed, instead of returning HUGE_VAL.
  • lua_setglobal2 has been removed. Use lua_pushvalue and lua_setglobal instead.

New in Agena 1.4.2 (Sep 5, 2011)

  • If in the parameter list of a procedure user-defined types had been specified, in procedure calls no errors were issued and the procedure was executed instead, in the following cases:
  • a table, set, sequence, pair, or procedure - without being of a user-defined type - had been passed,
  • no value at all had been passed for the parameter concerned.
  • This has been fixed. Also, all respective error messages have been standardized.

New in Agena 1.4.1 (Sep 1, 2011)

  • Short names for `stats.quartiles` and `stats.mode` could not be assigned by the `with` function. This has been fixed.
  • Erroneously, `with` could not assign a short name for `gdi.settriangle`. This has been changed.
  • Error handling of `calc.polygen` has been improved.
  • Improved error message of `fractals.draw` for missing FRACTINT map files.
  • Removed deprecated `strings.rseek` function. For backward compatibility, `strings.seek` has been added to the lib/compat.agn file.
  • Added the -d switch to print debugging information during startup of the interpreter.
  • The Windows version of Agena has now been compiled with GCC 4.5.2.
  • Updated language scheme files.
  • The manual has been updated.

New in Agena 1.4.0 (Aug 29, 2011)

  • Semantic Changes
  • Loop control variables of numeric `for/to` loops are now automatically local to their surrounding blocks instead of their (inner) loop bodies. If a local variable with the same name as the loop control variable has been declared and assigned before executing a numeric loop, it is overwritten by the last iteration value of the loop. As such, the `external` switch in numeric `for` loops is no longer accepted. (With GCC, use the -DCOMPAT13 switch to compile a version of Agena that still recognises but ignores the `external` keyword.)
  • With the constant `fail`, `not` returned `true`, but with `fail` assigned to a variable, `not` returned false. This has been changed, i.e. 'a := fail; not(a)' now returns `true`.
  • `stats.median` now returns `fail` instead of 0 if the given structure is empty.
  • `utils.readcsv`: If a single white space is passed with the `delim` option and if the `ignorespaces` option has not been given, white spaces are not automatically removed any longer before splitting each line of the file into its words.
  • The function also has two new options: `header` which marks the first line in a file, and `output` which allows to store the contents of the file into a dictionary with its field names defined by the file header.
  • The `$` substring notation is no longer supported. (With GCC, use the -DCOMPAT13 switch to compile a version of Agena that still suppports the `$` operator.)
  • Extensions:
  • Infinite do/od loops have been added. This kind of loop iterates infinitely and can be interrupted only with the `break` or `return` statements. They are syntactic sugar for `while true do ... od` loops.
  • With tables, `stats.minmax` formerly only worked with arrays. This has been changed, i.e. values with corresponding non-positive keys (e.g. strings, non-positive integers, negative and positive floats, etc.) are now properly recognised in the evaluation.
  • `stats.mean`, `stats.qmean`, `stats.sd`, and `stats.var` now also process sequences.
  • The new `stats.mode` function returns all values in a sequence or table with the largest number of occurrence, i.e. highest frequency.
  • The new `stats.quartiles` function returns the first, second, and third quartile of a _sorted_ table or sequence.
  • Previously undocumented features of `linalg.matrix` have been added to the manual and its error handling has been improved.
  • Improved error handling of `linalg.hilbert`.
  • `gdi.setinfo` now accepts the `square` option. If `square = false`, then the x and y axes will not have the same scale on plots created with `gdi.plot`.
  • The `gdi.plot` function to draw graphics unfortunately has not been documented. This has been changed.
  • `gdi.plot` accepts two new options: The 'x' option specifies the horizontal range over which a plot is displayed, and the 'y' option specifies the vertical range.
  • If a PLOT structure is passed to `gdi.plot` that contains only POINTs, LINESs, RECTANGLES, TRIANGLEs, CIRCLEs, and ELLIPSEs (including their *FILLED variants), then `gdi.plot` automatically determines the scales (`gdi.setinfo` does not necessarily need to be called).
  • The OOP features inherited from Lua are now documented in Appendix A9. The author does not recommend object-oriented programming.
  • Tuning:
  • Tuned `filled` operator by around 3 %.
  • Tweaked `in`, `join`, `sadd`, `qsadd`, `replace`, `copy`, `unique`, and Cantor set operators on tables and sets a bit.
  • With tables, the `top` and `bottom` operators are around 5 % faster now.
  • The `size` operator is at least 8 % faster if a table does not include nulls.
  • `linalg.mzip`, `linalg.mmul`, and `linalg.transpose` have been tuned by around 3 % each.
  • Numeric for/to loops with fractional step sizes have been optimised by reducing the number of their control variables by half. This, however, did not attain any increase in speed.
  • Patches:
  • Patched `linalg.ludecomp` to detect singular matrices. Also, the function can now automatically determine the order of the given matrix.
  • As opposed to the manual, `gdi.plot` did not automatically determine horizontal and vertical ranges. This has been fixed.
  • `gdi.plot` no longer ignores the `square` option set by `gdi.setinfo`.
  • `gdi.setinfo` added settings to INFO structures even if they have been already present. This has been changed.
  • Circles were not plotted properly by `gdi.plot`. This has been changed.
  • The `gdi.plot` function in most circumstances ignored the individual colouring of geometric objects. This has been changed.
  • The gdi package did not assign short names for `gdi.settriangle`, `gdi.settrianglefilled`, `gdi.setrectangle`, and `gdi.setrectanglefilled`. This has been changed.
  • The fractals package did not assign short names for functions of user-defined type 'esctime'. This has been changed. Corrected error message of `fractals.draw` if positional arguments were not numbers.
  • Miscellaneous:
  • The functionality of `calc.fseq` has been merged into `nseq`. For backward compatibility, `calc.fseq` is still part of the calc package, but the function actually refers to the `nseq` implementation.
  • Added the `environ.FractScreenUpdates` variable to the `fractals package` to denote the number of vertical lines (a non-negative integer) after which a fractal will be updated in a window. The `environ.FractOptimised` variable has been deprecated.
  • Auxiliary gdi functions have been regrouped.

New in Agena 1.3.3 (Feb 14, 2011)

  • Patches to `instr`:
  • When in regex mode, the operator returned a wrong result if a start position has been given.
  • When in plain search mode, the operator returned an out-of-range error if no start position has been given.
  • Except in reverse search mode, if no match has been found, the first argument has been returned instead of `null`.
  • Corrected error message of the `create` statement with respect to sequences.
  • In AgenaEdit, when outputting more than one structure with only one call to `print`, structures were not printed in full form if the first structure featured a __tostring metamethod. This has been changed.

New in Agena 1.3.2 (Jan 24, 2011)

  • `dimension` created interesting results if a structure has been passed as the initialiser. This has been changed: `dimension` now creates independent copies of the structure when initialising the table.
  • The functionality of `strings.rseek` has been added to the `instr` operator. Thus, `strings.rseek` has been deprecated. For backward compatibility, `strings.rseek` has been added to the lib/compat.agn file.
  • `strings.hits` now supports regular expressions and captures. This behaviour can be turned off by passing a boolean as a third argument.
  • `strings.isabbrev` and `strings.isending` now automatically use a plain search if no regular expressions or captures have been passed as part of the second argument.
  • Tweaked `strings.ismagic` and `strings.isfloat`.
  • The `log` function now is 13 % faster.
  • When outputting more than one structure with only one call to `print`, structures were not printed in full form if the first structure featured a __tostring metamethod. This has been changed.
  • Added categorisations of functions to Chapter 7 to facilitate the start for new users.

New in Agena 1.3.1 (Jan 10, 2011)

  • There have been problems with nested calls to the following binary operators: `xor`, `atendof`, `&&`, `||`, `^^`, `::`, and `:-`, and thus also with the pretty printer which quit with an error when printing nested structures. This has been fixed.
  • Fixes to `os.list`:
  • If the 'r' option has been passed, the current working directory has been mistakingly changed after completion of the call.
  • If 'r' has not been passed as the last argument, the function issued an error.
  • `null` has not been accepted as the first argument to denote the current working directory.
  • When a string was indexed with a non-number, e.g. "str[null]", Agena returned `null`. Now an error is raised.
  • If library.agn has not been found the wrong path has been output twice in the warning. This has been changed.

New in Agena 1.3.0 (Jan 3, 2011)

  • Procedures now can check whether their returns are of a given standard or user-defined type. 
  • The new `values` operator returns all values in a table or sequence (first argument) with the given keys (second to last argument).
  • Added the `strings.fields` function which extracts given fields (columns) in a string.
  • Added the `strings.ljustify` and `strings.rjustify` functions which add characters to the end or beginning of a string, respectively, as necessary to create a new string of a given width.
  • The new `::` operator checks for a given basic or user-defined type and returns true or false.
  • The new `:-` operator checks whether a value is not of a given basic or user-defined type and returns true or false.
  • The `gzip` file compression library now is part of the distribution.
  • In order to support the new `::` operator, the `try` statement now only accepts variable and indexed names so that no clashes occur when parsing the `::` keyword. Before, any value could be processed. The `try` statement will finally be deprecated.
  • Fix to `io.lines` to always correctly detect DOS-like carriage returns at the end of a line.
  • Anonymous functions: " x >>" and "  >>" had been valid expressions. This has been changed.
  • When deleting a user-defined type with `settype`, Agena could crash. This has been fixed.
  • Patched AgenaEdit to properly print structures again.
  • Corrected error message issued when a wrong value has been passed as a function argument that should have been of a user defined type.
  • Standardised error messages in the `io` package.
  • In Linux, the installer now copies the libagena.* files to /usr/local/lib instead of /usr/lib. The include files are copied to /usr/local/include/agena instead of /usr/include/agena. Missing include files agnnt*.h have been added to the installers.
  • An installer is now also available for PowerPC Debian.

New in Agena 1.2.0 (Dec 27, 2010)

  • The substring operator has been redesigned but the old version will still be
  • available till Agena 2.0: the new one is: `str[left to right]`, the old one has been:
  • `str$(left, right)`. An example:
  • before: `str := 'string'; print(str$(2, 3))` -> 'tr'
  • now: `str := 'string'; print(str[2 to 3])` -> 'tr'
  • You are now able to determine sublists of table arrays and sequences with the
  • new syntax mentioned above: `s[left to right]`. An example:
  • now: `a := [10, 20, 30, 40]; print(a[2 to 3])` -> [20, 30]
  • now: `a := seq(10, 20, 30, 40); print(a[2 to 3])` -> seq(20, 30)
  • The `ops` function now allows to specify the values to be returned by passing a
  • sequence of their index positions as its first argument, e.g. ops(seq(1, -1), 10, 20,
  • 30).
  • The new function `strings.include` inserts a character sequence into a string
  • at a given position.
  • The following functions now issue an error instead of just returning `fail` in
  • case of a failure: `os.remove`, `os.move`, `os.mkdir`, `os.rmdir`, `os.chdir`.
  • Improvements to the following operators working on sets and sequences
  • concerning garbage collection: `insert` statement, `union`, `intersection`, `minus`,
  • `unique`, `copy`, `pop/top` and `pop/bottom` statements, and set assignments.
  • Improved error message of `fractals.draw` if FRACTINT colour map file has not
  • been not found.

New in Agena 1.1.0 (Dec 22, 2010)

  • Compatibility to Agena 1.0:
  • Some functions have been removed from Agena and some have been converted to package functions (see below). If you still want to use them, issue readlib 'compat' on the command line or put the above statement into your initialisation file if you prefer backward compatibility to Agena 1.0.
  • Extended Functionality:
  • The `pop/top` and `pop/bottom` statements and `bottom` and `top` operators can now also be applied to table arrays.
  • When called with `null` or no arguments, `os.chdir` no longer issues an error but returns the current working directory. Thus, the former `os.curdir` C function has been replaced by one written in the Agena language.
  • `os.list` now recursively traverses subfolders if the new 'r' option is given.
  • The `join` operator now also accepts an optional delimitor and supports the option to specify the the first and the last element of the structure to be concatenated.
  • `instr` can now search from the right end of a string by passing a negative position.
  • If a table includes other tables, sets, sequences, or pairs, `copy` now knows how to handle these references properly if they occur multiple times: If an embedded structure is included n times, then one real copy is made and n-1 references to this newly created structure are inserted. Before, n independent copies have been made.
  • The new `isnonposint` function checks whether the given numbers are all integers and non-positive.
  • `io.close` can now close multiple files with only one call.
  • The `with` function did not assign short names for the following procedures of the `math` package: `convertbase`, `fraction`, `zeroin`, `todecimal`, `lcm`, `gcd`, and `ndigits`. This has been corrected.
  • The `rwritemode` function mentioned in the manual did not exist. It is now available but called `rmode`.
  • Error messages of various functions have been improved.
  • Namespace Cleansing: Renamed or Moved Functions:
  • The `register` and `loadclib` base library functions have been moved to the `package` library.
  • The former `rdelete`, `rget`, `rinit`, `roinit`, `rmode`, `rset`, `remember`, and `defaults` base library functions have been moved to the new `rtable` package.
  • Renamed the global _Env table to `environ` which now also contains procedures to access the environment.
  • The former global `homedir` and `infolevel` environment variables have been renamed to `environ.homedir` and `environ.infolevel`, respectively.
  • The following former base library functions have been moved to the `environ` package: `anames`, `attrib`, `gc`, `getfenv`, `globals`, `isselfref`, `pointer`, `setfenv`, `used`, `userinfo`, `__RESTART`, `__DOTTYPRINT`.
  • `mapm.xtoNumber` has been renamed to `mapm.xtonumber`, `mapm.xtoString` has been renamed to `mapm.xtostring`. For backward compatibility, the old function names can still be used by executing the lib/compat.agn file (first readlib the `mapm` package and then load the compat.agn file).
  • Deprecated Functions and Variables:
  • `strings.seek` has been deprecated. Its functionality has been added to the `instr` operator. To switch off `instr`'s pattern matching mode, pass the start of the search as the third and `true` as the fourth argument. `instr` is around 40 % faster in non-pattern matching mode than `strings.seek`. For backward compatibility, `strings.seek` has been added to the lib/compat.agn file.
  • The `concat` base library function has been removed. Use `join` instead. For backward compatibility, the former function has been added to the lib/compat.agn file.
  • The `hasrtable` and `hasrotable` functions have been removed. For backward compatibility, they have been added to the lib/compat.agn file.
  • The `pcall` function has been deprecated. Use `protect` instead. For backward compatibility, the function has been added to the lib/compat.agn file.
  • The `maptoset` function has been deprecated. For backward compatibility, the function has been added to the lib/compat.agn file.
  • The `os.alldirs` function has been deprecated. Use the 'dirs' and 'r' options in a call to `os.list` instead. For backward compatibility, the function has been added to the lib/compat.agn file.
  • `os.isMac`, `os.isSolaris`, `os.isLinux`, `os.isWin`, `os.isOS2`, `os.isDOS`, `os.isHaiku` have been deprecated. Please use the new environment variables environ.Os and environ.Cpu instead, which also speeds up code. For backward compatibility, the functions have been added to the lib/compat.agn file.
  • The undocumented _VERSION variable has been removed. For backward compatibility, its assignment has been added to the lib/compat.agn file.
  • Other Changes:
  • The C API function lua_rawsetstringnumber mentioned in the manual did not exist. This has been changed.
  • Code optimisations to the parser.
  • In some of the packages, accidently a few variables have been implicitly declared global. This has been fixed.
  • Corrected and updated initialisation sample files.
  • AgenaEdit has been updated.
  • The language scheme files have been updated.
  • The Linux installers now include the xBase package.

New in Agena 1.0.6 (Dec 17, 2010)

  • Improved error messages of `join`, `copy`, and `filled` operators, of `toset`, `toseq`, and `totable` functions, of `insert`, `delete`, `pop` statements, and of `for` loops.
  • With sequences, Agena crashed in the following sequence of events: 1) a `delete` statement had been executed, 2) the sequence therafter had been empty, and 3) a new element had been inserted again. This has been fixed. (Internally, the `delete` statement no longer internally reduces the size of sequences any longer.)
  • With large strings, `concat` crashed. This has been fixed.
  • With strings of 512 and more bytes, `join` and `replace` could crash. This has been fixed. The two operators are now also much faster than ever before.
  • `math.isprime` returned wrong results with arguments > 2^31 (mentioned vaguely in the manual). This has been fixed by extending the argument range to integers with values up to +/-2^63.
  • `math.nextprime` and `math.prevprime` had the same issue with larger arguments like `math.isprime`. This has also been changed. With argument 2, `io.nextprime` falsely returned 5 instead of 3. This has been fixed, as well.

New in Agena 1.0.5 (Dec 13, 2010)

  • `join` could crash Agena and otherwise behave unexpectedly if the resulting string exceeded 512 bytes. This has been changed.
  • If `restart` has been called after an error has been issued in the previous statement, Agena in rare occasions crashed because of stack corruption. This has been fixed.
  • With newly created tables containing exactly one element in the hash part, `attrib` now returns correct results for the number of allocated hash slots (1 instead of 0).
  • Corrected error messages of `qsadd` and `sadd`.
  • Improved error messages of `join`, `copy`, and `filled` operators, and of `insert` and `delete` statements.
  • Error handling of `read`, `save`, and `fractals.draw` has been improved.
  • Improvements to the makefiles.
  • Buffer sizes have now been standardised in the sources.

New in Agena 1.0.5 (Dec 11, 2010)

  • With sets, `copy` did not copy a user-defined type definition. This has been changed.
  • `join` could crash Agena and otherwise behave unexpectedly if the resulting string exceeded 512 bytes. This has been changed.
  • If `restart` has been called after an error has been issued in the previous statement, Agena in rare occasions crashed because of stack corruption. This has been fixed.
  • With newly created tables containing exactly one element in the hash part, `attrib` now returns correct results for the number of allocated hash slots (1 instead of 0).
  • Corrected error messages of `qsadd` and `sadd`.
  • Improved error messages of `join`, `copy`, and `filled` operators, and of `insert` and `delete` statements.
  • Error handling of `read`, `save`, and `fractals.draw` has been improved.
  • Improvements to the makefiles.
  • Buffer sizes have now been standardised in the sources.

New in Agena 1.0.4 (Nov 22, 2010)

  • Since rare crashes have been reported during initialisation (in Windows XP SP 3 and OpenSolaris 134, in some circumstances), garbage collection is now turned off in the initialisation phase. These rare segmentation faults occured in OpenSolaris when running the Agena binary in its harbouring directory as root, and in XP when clicking on the Agena desktop icon with local admin rights.
  • Introduced the -d switch to the command line options in order to print information during initialisation of Agena.
  • Introduced proper error handling if memory could not be internally allocated to: `trim`, `upper`, `lower`, `os.curdir`, and `strings.rseek`.
  • Removed potential memory leaks in the initialisation C functions agenaL_initialise and agenaL_setLibname, and in `io.write*` and `print`.

New in Agena 1.0.3 (Nov 15, 2010)

  • The new function `protect` calls a procedure in protected mode and catches any possible error so that computation is not interrupted. In case of an error, it sets the error string to the global variable `lasterror`. It is related to `pcall`, but does not return the status code as the first result.
  • `attrib` now returns correct results with empty structures. With empty structures, the function wrongly counted one assigned hash element before.
  • `attrib` now return the number of bytes occupied by tables, sets, and sequences along with the new 'bytes' key . The number of bytes returned is based on sometimes contradictory information available on the net.
  • `replace` crashed Agena if the resulting string exceeded 512 bytes. This has been changed.
  • `assume` now returns 'Assumption failed.' instead of 'assumption failed.'
  • The new C API function lua_setglobal2 sets the value at the top of the stack to a global name. Contrary to lua_setglobal, the value is not popped.
  • Code cleaning of lobject.h (Table structure), and lapi.c (actnodesize macro). Bugfix to C API function agn_deletertable in case Agena is compiled with non-void lua_assert. Change to the return value of the savestate function that is used during initialisation to prevent the (slight) possibility of stack corruption.

New in Agena 1.0.2 (Nov 7, 2010)

  • The new `os.setenv` procedure sets environment variables on the operating system level. The function has originally been written by Mark Edgar.
  • In Windows, `os.getenv` now calls a native Windows API function in order to get the values of environment variables. The Windows code has been written by Mark Edgar.
  • The new `os.environ` function returns all assigned environment variables in a table. The function has originally been written by Mark Edgar.
  • `io.open` now adds the FILE pointer, the name, and the mode of a successfully opened file into the new table `io.openfiles`. `io.close` deletes the entry from `io.openfiles` if the file could be successfully closed.
  • When called with no arguments, `io.read` now returns an error if called with no arguments in AgenaEdit (in an attempt to read the keyboard).
  • If `io.anykey` and `io.getkey` are called in AgenaEdit, a proper error message is displayed.
  • One of the initialisation subprocedures has been changed to avoid possible stack corruption (although problems never occured).
  • os.isMac('ppc') now works on PowerPC machines.
  • Chapters 4 and 6 of the Primer and Reference have been revised and extended. An index has been added and a lot of cosmetics have been done, as well.
  • Stored correct version information to the Windows executable.

New in Agena 1.0.1 (Sep 20, 2010)

  • With structures, the `inc` and `dec` statements only worked correctly with one-dimensional tables or sequences. This has been changed.
  • The `has` function returned wrong results with tables if its second argument is a number and if this number is a key of the table scanned. This has been changed: Only if the key is not of type number, then the table indices are scanned, as well.
  • Corrected error message of `arccosh`.
  • The prettyprinter now outputs complex values including `undefined` in the real or imaginary part as just `undefined`. Note that internally, the complex value is not simplified this way but left untouched.

New in Agena 1.0 (Aug 14, 2010)

  • The following functions now accept multiple arguments: `isboolean`, `isnumber`, `iscomplex`, `isnumeric`, `isstring`, `istable`, `isset`, `isseq`, `ispair`, `isstructure`, `isposint`, `isnonnegint`, `isnegint`.
  • All aliases for deprecated function names are no longer automatically initialised at start-up. Enter `readlib 'compat'` to activate them. Deprecated names of functions in the linalg package can only be used by uncommenting the alias assignments at the bottom of the 'lib/linalg.agn' file.
  • Optimisations and corrections in the manual and in the Quick Reference.
  • Updated language scheme files.

New in Agena 0.34.1 (Jul 13, 2010)

  • AgenaEdit has been updated to version 0.1.1 in the Mac OS X, Linux, and Windows editions:
  • Added `restart` button to the Agena output windows to reset the Agena environment.
  • Added license information to Help/About window.
  • Added Agena icon to application.
  • Added keyboard shortcuts for `break` and `restart` button in the Agena output windows.
  • The restart facility has also been added to the editor menu.
  • Added system information window to the help menu.
  • `linalg.isAntisymmetric` has been renamed to `linalg.isantisymmetric`, `linalg.isVector` to `linalg.isvector`, and `linalg.isMatrix` to `linalg.ismatrix`.

New in Agena 0.33.2 (Jun 28, 2010)

  • Added the new `gamma` function to the base library.
  • The new `math.prevPrime` and `math.nextPrime` functions return the largest prime less than and the smallest prime greater than the given argument, respectively.
  • The new baselib functions `isBoolean`, `isComplex`, `isNumber`, `isPair`, `isString`, `isTable`, `isSet`, and `isSequence` check their arguments for the respective type. `isNumeric` checks for numbers or complex numbers, and the `isStructure` function checks whether its arguments are tables, sets, sequences, or pairs.
  • The new baselib function `isNegint` checks for a negative integer. `isNonnegint` checks for either 0 or a positive integer. `isPosint` checks for a positive integer.
  • `finite` and `even` now return `fail` if their argument is a complex value, before they issued an error.
  • With this release, `int` works on complex numbers, as well.
  • Tuned the `binomial` function in the Windows edition by 12 %.
  • Improved treatment of complex `undefined`!(+/-)`infinity` situation.
  • `mapm` package: most functions crashed Agena if a negative precision has been given. This has been fixed.
  • The `root` function returned wrong results in the complex domain in all versions of Agena. This has been fixed by completely rewriting the function. root(n, 0) with n a number and root(0, n) with n a negative integer returned `infinity` instead of `undefined` - this has been changed, too.
  • In DOS, Haiku, and OS/2 (i.e. the plain-ANSI editions), the `arctan2` function returned wrongs results if at least one of its arguments was complex. This has been fixed.
  • The `log` function sometimes returned `undefined` instead of a finite number. This has been changed.
  • In Haiku, the mapm package could not be initialised. This has been fixed.
  • The Windows uninstaller now does not delete the agena/lib/agena.ini file any longer if it resides in the agena/lib folder.
  • Updated the language scheme files and extended/corrected the manual.

New in Agena 0.33.1 (Jun 20, 2010)

  • Added two new hyperbolic functions: `csch` and `sech` and two new inverse hyperbolic functions: `arccsch` and `arcsech`.
  • The `beta` function has been added ( beta(z, w) = exp(lngamma(z)+lngamma(w)-lngamma(z+w)), with special treatment if z and w are integers).
  • Added `os.alldirs` which returns the names of all subdirectories on the file system that are part of a given folder.
  • With `gdi.plotfn`, the new option 'square' causes `plotfn` to use the same scale for the y-axis as given for the x-axis.
  • With `gdi.plotfn`, the new option 'maxtickmarks' allows to control the maximum number of tickmarks plotted on both axes.
  • With too large function values, `gdi.plotfn` printed too many tickmarks and labels on the axes. This has been changed.
  • With complex arguments x, y, the `arctan` operator did not return the imaginary unit of the result in the non-ANSI versions (i.e. Windows, Mac, Solaris, Linux). This has been fixed by using a modified version of Stephen L. Moshier's implementation of the complex arctan function available in the Cephes Math Library which is portable across various platforms contrary to the respective platform-dependant implementations.Also, in the plain-ANSI versions (DOS, Haiku, OS/2), if x = 0 and y < 1 and y an integer, the result was incorrect. This has been fixed, as well.
  • In the complex domain, the `arccoth` function wrongly returned Pi as the imaginary part of the result if the imaginary part of its argument was 0 and the real part of its argument was greater than 1. This has been changed.
  • In the complex domain, `arccosh` returned a wrong result if the imaginary part of its argument was 0, and the real part of its arguments was in ]-1, 0[. This has been changed.
  • In the complex domain, `arcsinh` returned a wrong result if the real part of its argument was 0, and the real part of its arguments was a negative integral < -1. This has been changed.
  • In Windows, `erf` and `erfc` sometimes returned wrongs results. This has been changed.
  • In Haiku, `homedir` is assigned to '/boot/home' if on the operating system level the environment variable 'HOME' has not been set.
  • Cosmetics to the warning messages that are issued if libname could not be determined at initialisation and to two general error messages.

New in Agena 0.33.0 (Jun 14, 2010)

  • The new `xbase` package can read and write xBase files compatible to the dBASE III standard.
  • The `binio` and `ads` packages can now handle files of up to 2^63 bytes. Before they could handle only files with sizes of up to 2^31 bytes.
  • The new `io.lock`, `io.unlock`, `binio.lock`, `binio.unlock`, `ads.lock` and `ads.unlock` functions lock a file from read and write access by other Agena functions or even other applications provided the latter use a locking protocol.
  • The baselib function `read` can no longer be overwritten by `with`.
  • The new `package.checkClib` checks whether a package stored to a C dynamic library has been initialised. If not, it returns a warning printed on screen and creates an empty package table. Otherwise it does nothing.
  • The Haiku port now supports dynamic link libraries.

New in Agena 0.32.4 (Jun 9, 2010)

  • In the plain-ANSI editions of Agena (e.g. for DOS, OS/2, and Haiku), `arcsin` and `arccos` in rare circumstances returned incorrect results in the complex domain. This has been largely fixed.
  • The `**` operator returned `infinity` instead of `undefined` if the base was 0 and the exponent non-positive. This has been changed.
  • The `^` operator returned `infinity` instead of `undefined` if the base was 0 and the exponent was a non-positive integer. This has been fixed.
  • In the ANSI editions (e.g. for DOS, OS/2, and Haiku), `erf` and `erfc` have been rewritten in C and now are 3.5 times faster than the former Agena language versions.
  • EnvPrint.ZeroedCmplxVals is now unassigned at invocation of Agena.
  • The baselib `attrib` function could be overwritten by invoking "with 'ads'", provoking errors when trying to print structures thereafter. This has been changed by `hiding` a copy of `attrib` in the environment.

New in Agena 0.32.3 (May 31, 2010)

  • The `calc.diff` function has been rewritten in C and is at least 3.1 times faster than the former Agena version.
  • The `calc.xpdiff` function has been rewritten in C and is at least 6 times faster than the former Agena version.
  • `calc.sections` has been ported to C and thus is around 17 % faster.
  • `calc.regulafalsi` has been ported to C and thus is around 40 % faster.
  • The `calc.fminbr` helper function has been ported to C and thus has become 2.6 times faster.
  • Due to tuning of `calc.xpdiff`, `calc.diff`, `calc.sections`, `calc.regulafalsi`, and `calc.fminbr`, the `calc.zero` function has become 4.6 times faster, and `calc.minimum` and `calc.maximum` have become 4.8 times faster.
  • The new `calc.fresnelc` and `calc.fresnels` functions compute Fresnel integrals.
  • The integer division operator did not work correctly if the right operand was negative. This has been fixed.
  • `bisEqual` now accepts either two tables or two sequences, before it could compare sequences with tables.
  • The `kernel` function has been extended with the new option `debug` that prints further debugging information if the initialisation of a C dynamic library failed.
  • `fractals.draw`: The third argument now requires positive values and issues an error otherwise. Before, the function turned into an endless loop.
  • Some chapters in the manual have been corrected.

New in Agena 0.32.2 (May 26, 2010)

  • The new `calc.intde` function computes an approximation of the integral of a function. It is at least 4 times faster, and produces more accurate results than `calc.gtrap` by using Double Exponential (DE) Transformation, also known as Tanh-sinh quadrature. The code used has been originally written by Takuya Ooura, Kyoto.
  • The new `calc.intdei` function computes the integral of a non-oscillatory function over (a, infinity). The code used has been originally written by Takuya Ooura, Kyoto.
  • The new `calc.intdeo` function computes the integral of an oscillatory function over (a, infinity). The code used has been originally written by Takuya Ooura, Kyoto.
  • The new `calc.integral` function is a wrapper around `calc.intde`, `calc.intdei`, and `calc.intdeo`.
  • The new `calc.Si` procedure computes the sine integral. The new `calc.Ci` computes the cosine integral. The new `calc.Shi` function computes the hyperbolic sine integral. The new `calc.Chi` function computes the hyperbolic cosine integral. The new `calc.Ssi` function computes the shifted sine integral. All these functions have been written in C using Stephen L. Moshier's Cephes Math Library.
  • The new `calc.dawson` function computes Dawson's integral using Stephen L. Moshier's Cephes Math Library.
  • The new `calc.Ei` function computes the exponential integral for positive arguments, using Stephen L. Moshier's Cephes Math Library.
  • The new `calc.Psi` function computes the Psi (digamma) function, using Stephen L. Moshier's Cephes Math Library.
  • The new `calc.dilog` function computes the dilogarithm function, using Stephen L. Moshier's Cephes Math Library.
  • The new `calc.polygen` function creates a polynom p(x) = c[n]*x^(n-1) + c[n-1]*x^(n-2) + .. + c[2]*x + c[1] from of its coefficients c[k] and returns it as a new function p(x) >>.
  • The random number algorithm used in `math.random` has been changed. Before, `math.random` could only generate up to 32768 unique numbers in [0, 1). Now, it can generate 2*_Env.MaxLong unique random numbers in [0, 1).
  • `math.randomseed` has been extended to support the new RNG algorithm used by `math.random`.
  • The new `math.norm` function converts a number x in the range [a, b] to one in the range of [c, d].
  • The new `os.isHaiku` function checks whether Agena is being run on Haiku.
  • The `BesselJ` and `BesselY` either produced wrong results with complex arguments or even crashed Agena (observed with Sparcs). This has been fixed. The functions now return correct results.
  • The `lngamma` operator returned imprecise results with roundoff errors with arguments 1!0 and 2!0. This has been fixed.
  • The core algorithm to compute the complex error function and the complementary complex error function has been replaced with a more precise algorithm written by Takuya Ooura, Kyoto.
  • Corrected the error texts of some mathematical functions.
  • The Windows installer by default will now copy all Agena components to the user's hard disk.
  • The source files have been slightly modified to also compile under Haiku/GCC 4.3.3.
  • Some chapters in the manual have been corrected.

New in Agena 0.32.1 (May 18, 2010)

  • With kernel('longtable') = true, the `print` function outputs table key~value pairs in ascending order of the table keys.
  • The `erfc` complementary error function now also works in the complex domain.
  • `approx` now applies Donald Knuth's simplified relative approximation algorithm on complex values, as well.
  • The new `expx2` baselib function computes either exp(x*x) or exp(-x*x) while suppressing error amplification that would occur from the inexactness of the exponential argument x*x.
  • The new function `strings.toBytes` converts a string into a sequence of numeric ASCII values.
  • Corrected error messages of `kernel` function.
  • In some very rare situations, the `enum` statement did not work well with indexed names passed after the `from' keyword. This has been fixed.
  • On Little Endian platforms, the `save`, `read`, `binio.writenumber`, and `binio.readnumber` functions sometimes did not correctly write or read floats to/from binary files. This issue has been fixed. The `debug.doubleendiantest` functions has thus been removed. Exchangeability of the files between Big and Litte Endian platforms works fine.
  • The binary files produced by the `save` function are imcompatible to older releases of Agena, including Agena 0.32.0.
  • Added Lua 5.1.4 patches 7 and 8 to fix minor bugs in `io.read` and `strings.format`.

New in Agena 0.32.0 (May 15, 2010)

  • EnvPrint.ZeroedCmplxVals will now be set to true at invocation of Agena.
  • New: All _Env* settings are reset by the `restart` statement to their original defaults, whereas those settings the user defines with the `kernel` function will never be modified or deleted by a restart.
  • Auxiliary Agena functions are now stored in the global table `agena_auxiliary` to prevent wasting the global namespace.
  • The agena.sch, agena.lang, and agena.xml language scheme files have been updated.
  • The lib/utils.agn file is no longer supplied since all utils functions written in Agena have been transfered to the lib/library.agn file.
  • Internal preparations for future new `kernel` settings.
  • All error messages of the ads package have been standardised.
  • Bug fixes:
  • The `inc` and `dec` statements produced wrong results if the first and the second arguments were both indexed names. This has been corrected.
  • In some very rare situations, the `insert/into` and `delete/from` statements did not work well with indexed names passed after the `into' or `from' keywords. Instead of entering or deleting the given objects, the name of the index (a string) has been added or deleted. This has been fixed.
  • User-defined types for pairs are now properly output by the `print` function.
  • The `read` function did not correctly read sequences with user-defined types. This has been fixed. Also it now automatically closes the file if it contained format errors.
  • To prevent file corruption, the `save` function now deletes the file - if it exists - before it will write to it.
  • `ads.writebase` only automatically expanded the size of a base if _EnvVerbose has been set true. This has been changed.

New in Agena 0.31.7 (Apr 26, 2010)

  • The new `io.nlines` function counts the number of lines in a file.
  • The new `utils.readcsv` function imports a CSV file.
  • Some utils package functions (those written in Agena) could only be used by running `readlib` or `with` before. This has been changed.
  • `utils.writeCSV` has been renamed to `utils.writecsv`. (An alias to the old `utils.writeCSV` is provided to ensure backward compatibility.)
  • Table keys had not been sorted in ascending order as intended by the `print` function. This has been changed.
  • The `save` function now returns an error if an object that cannot be stored to a file has been passed (e.g. procedures, threads, userdata). It also returns an error if the object to be written is self-referencing (e.g. _G).
  • `os.fstat` did not return the correct size of files > 4 GBytes in Solaris, Linux, and Windows. This has been fixed.
  • The ads package did not work well on some 64-bit architectures and caused segmentation faults. This has been fixed by replacing all C longs in the ads sources with int32_t's. The error affected Mac OS X, but neither Solaris 10 for Sparc, x64 Solaris 10, nor Win 7 64-bit. Whether x64 Linux architectures or older Win 64-bit platforms had been affected by this bug, is not known.
  • The `binio.readlong` and `binio.writelong` functions produced binary files that could not be exchanged between some 32-bit and 64-bit systems. The error affected Mac OS X, but neither Solaris 10 for Sparc, x64 Solaris 10, nor Win 7 64-bit. Whether x64 Linux architectures or older Win 64-bit platforms had been affected by this bug, is not known.
  • The global environment variables _EnvMaxLong and _EnvMinLong now contain the maximum and minimum values for the C data type int32_t. Before, it was the maximum and minimum values of type long which on Mac OS X 10.6 has a different width than on other 64-bit platforms, e.g. Sun Sparc Solaris 10.
  • `debug.system` now also returns the number of bytes used for C types int32_t and long long ('int32_t' and 'longlong' keys).
  • In OS/2, the number of free bytes available was no longer output at initialisation. This has been changed.
  • The OS/2 and DOS editions have been compiled with GCC 4.4.2 and 4.4.1, respectively, and thus contain substantially less bugs in complex arithmetic than previously. The OS/2 portions of the C code of the os package has been adapted to compile under GCC 4.4.2 without warnings.
  • The `pointer` function now also works on complex numbers in DOS and OS/2.
  • Pairs are now properly dealt with in the Agena Quick Reference.

New in Agena 0.31.6 (Apr 19, 2010)

  • The new `homedir` environment variable contains the path to the user's home directory.
  • The new `io.pcall` function makes communication with other programmes much easier by combining `io.popen`, `io.readlines`, and `io.close` into a single call.
  • `unpack` crashed with sequences if the third argument denoted an out-of-range key. This has been changed.
  • Standardised error messages.
  • Extended the chapter on sequences in the manual (table of available functions).
  • Added the new jEdit language scheme file agena.xml to the schemes folder and updated the Proton and gedit scheme files.

New in Agena 0.31.5 (Apr 12, 2010)

  • `tables.put` has been renamed to just `put` and now also supports sequences. (An alias to the old `tables.put` is provided, however, to ensure backward compatibility.)
  • `tables.remove` has been renamed to `purge` and now also supports sequences. (An alias to the old `tables.remove` is provided, however, to ensure backward compatibility.)
  • The functions `tables.bintersect`, `tables.bisEqual`, `tables.bminus`, and `tables.duplicates` have been renamed to `bintersect`, `bisEqual`, `bminus`, and `duplicates`. (Aliases to the old function names are provided, however, to ensure backward compatibility.)
  • If Agena could not find the main Agena library during initialisation, it now prints the path where it tried to find the library but did not succeed.
  • The `getentry` function did not work with sequences as described in the manual. Contrary to not issueing an error if a sequence index did not exist, it issued an error. This has been changed. In the situation described, `null` is now returned.
  • The `print` function issued an error with too large tables and sets. This has been changed. Large tables and sets are now output without errors.
  • When given the `mouse~true` option, `gdi.plot` on some UNIX platforms did not properly detect whether the right mouse button had been pressed. This has been changed.
  • `os.isMac` has been extended to optionally query whether Agena is being run on either a PowerPC or Intel CPU.
  • The new C API function `lua_seqrawget2` does not issue an error if a sequence key does not exist. Instead, it returns `null`.
  • The new C API function `lua_seqrawgeti` pushes a sequence value onto the stack. It does not invoke metamethods.
  • The undocumented functions `tables.getn` and `tables.setn` have been removed.
  • The mapm DLL for Windows has been re-compiled.
  • Added a new 64x64 pixel and 128x128 Agena programme icons to the share folder (Solaris, Linux, Windows).
  • The manual and the Quick Reference XLS have been improved.

New in Agena 0.31.4 (Apr 7, 2010)

  • The `==` operator did not return correct results with larger tables. This has been changed.
  • The -p option sometimes did not work as expected. This has been changed.
  • `os.listcore` crashed Agena if the directory name passed was '/'. This has been fixed.
  • `os.fstat` returned negative sizes for very large files. This has been corrected.
  • In Windows, `os.battery` falsely returned the respectively opposite value on whether the battery was being charged or not. This has been changed.
  • In Windows, `io.anykey` did not clear the keyboard buffer so that when calling it again or when calling `io.getkey` after running `io.anykey`, these functions got confused. This has been changed. (In UNIX, io.anykey has been working fine.)
  • In Sun x86 Solaris 10, the `fractals` functions `lbea`, `bea`, `cosxx`, and `esctime` have now been implemented in C. Please make sure that if you compile the fractals.c source file in Solaris 10 x86, you use GCC 4.4.x or higher, otherwise Agena might crash if calling one of the fractals C functions that use complex arithmetic.
  • When given the `mouse~true` option, `fractals.draw` and `gdi.plotfn` on some UNIX platforms did not properly detect whether the right mouse button had been pressed. This has been changed.
  • Added information to the manual on how to correctly evaluate the button state of a mouse with `gdi.mouse` (application of bitmasks to the third return of `gdi.mouse`).
  • `fractals.draw` now correctly handles FRACTINT map files that include tabs, e.g. chroma.map. It now also checks whether a correct FRACTINT map file has been passed. If not, it issues a proper message specifying the incorrect line and column of the file read.
  • `fractals.draw` now accepts the new option `update` which determines the number of rows after an image is being flushed to a file or window during computation. In Sun x86 Solaris and Linux, by default the image is updated each 10th row, in all other operating systems, including Sun Solaris for Sparcs, the default is 1 like in previous releases of the package. This behaviour in Sun x86 Solaris and Linux can be switched off by setting the global environment variable _EnvFractOptimised to false or null.
  • With the fractals package in Sun x86 Solaris and Linux, update ~ 0 is the fastest, but when outputting to a window, it does not plot anything while the fractal is being computed (of course, if computation finishes, the fractal will be displayed). Sparcs do not show any effect when changing the update rate, at least with XVR-1200 VGAs.
  • os.isSolaris has been extended to optionally query whether Agena is being run on either a Sparc or Intel CPU.
  • Corrected error messages of the bitwise operators &&, ||, ^^, and ~~.
  • The agena.ini.sample file has been renamed to .agenainit.sample in the Mac distributions.
  • Updated language scheme file for Proton.

New in Agena 0.31.3 (Mar 30, 2010)

  • Added the fractals package to easily draw fractals in Solaris, Mac, Linux, and Windows.
  • On Solaris and Linux, `gdi.mouse` now returns standard values for pressed mouse buttons (the same as the Mac and Windows editions do).
  • When given the -v option, Agena now does not execute the initialization files any longer.
  • On UNIX or Mac, the file names of the initialization files must always be `.agenainit`, whether they be in /usr/agena/lib or the personal folder.
  • The binary Mac distribution for Intel CPUs runs around 30 % faster than previous releases.
  • The `io.getkey` function is now available in the Mac OS X edition.
  • On Mac, `os.system` now returns complete information about the operating system and CPU type. Note that it returns information on the Darwin kernel, and that the first entry in the resulting table now is `Darwin` instead of `MacOSX`.
  • `os.memstate`, `os.freemem` and `os.beep` now support Mac OS X.
  • `io.anykey` is available on all platforms, but returns `fail` on DOS and Mac. Thus, `gdi.draw` will not throw errors any longer on Mac when using the `mouse` option.
  • `os.listcore` has been extended to return file, directory, or link names only. '.' and '..' now are never returned.
  • `os.list` did not recognise any options and returned an empty list instead. This has been fixed. Also, options can now be combined. '.' and '..' as the first argument are now properly recognised.
  • `os.curdir` now automatically replaces backslashes in the path determined with slashes.
  • `os.fstat` and `ads.attrib` crashed Agena if the date of a file exceeded Tuesday, January 19, 2038. This has been fixed by either returning an empty table for the date key (os.fstat), or 0/0/01 00:00:00, (ads.attrib).
  • `utils.calendar` crashed Agena if its argument was void, negative or too big. This has been changed. In addition, if a date is beyond Tuesday, January 19, 2038, the correct date is returned.
  • The new functions `os.screensize` and `os.mousebuttons` return the current screen resolution and the number of buttons of the attached mouse, respectively (Windows only).
  • The agena.ini.sample file has been renamed to .agenainit.sample in the UNIX/Mac distributions.
  • A new makefile for Solaris is now being shipped with the mapm Agena binding to fully compile the original MAPM sources written by Michael C. Ring.

New in Agena 0.31.2 (Mar 10, 2010)

  • The mapm package for arbitray math precision is now also available in the DOS edition of Agena.
  • The number of digits used by the mapm package is initialised to 17 digits at start-up of Agena for DOS or OS/2 Warp. Before, the default was 1 digit.
  • The C code for the MAPM binding has been standardised. Before, the DOS and OS/2 source files differed from the one for UNIX and Windows.
  • Small enhancements to the Windows and Mac OS X installers.
  • On Mac, the documentation is now available in Library/Documentation/Agena instead of /Users/Share/Agena.
  • The sin, cos, arcsin, arccos, and arctan functions returned -0 instead of 0 as the imaginary unit, which led to wrong results if the return of these functions had been applied to other functions such as ln (i.e. the sign of the imaginary unit of the result of these other functions was incorrect). This has been fixed by setting the imaginary unit -0 to 0 in the return of sin, cos, arcsin, arccos, and arctan.
  • The arcsin and arccos functions returned wrong results for complex arguments z, if abs(real((z))) < 1. This has been fixed.
  • In OS/2, most complex arithmetic functions returned undefined. This has been fixed.
  • Note that in OS/2 and DOS, in the complex domain there are still issues with the arccos and arcsin operators which return undefined in certain situations.
  • The Windows, i386 Solaris 10, and Linux versions have now been compiled with GCC 4.4.x (and without xmath86.h) which reduced the number of errors in complex arithmetic significantly. In fact, elaborate complex math test cases return zero errors. The Sparc version has been compiled with GCC 4.3.3 for Sun Sparc and has less bugs in complex number arithmetic than the 0.31.1 release had.
  • Renamed the following include files: config.h -> agncfg.h, chelpers.h -> agnhlps.h, aauxlib.h -> agnxlib.h.
  • On Mac, gdi.mouse now returns standard values for pressed mouse buttons.

New in Agena 0.31.1 (Mar 4, 2010)

  • The precedence of the assigned, unique, and type operators has been changed from 8 to 11 (highest).
  • Removed unneccessary warnings of with function when activating the math package.
  • Sources have been extended to compile under Mac OS X. (A binary Mac OS X edition of Agena is also available.) The following functions are not available in the Mac edition or return fail on Mac: io.anykey, io.getkey, os.beep, os.memstate, os.freemem. os.system does not return the version number, revision, and CPU.
  • The new os.isMac function determines whether Agena is run on Mac OS X.
  • os.system returns ['MacOSX', ....] if run on Mac OS X.