agena >> `The Power of Procedural Programming` What are the Changes ? ---------------------- 2.4.3, February 18, 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. 2.4.2, February 15, 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. 2.4.1a, February 03, 2015 - The `lower` and `upper` operators have been tuned by around 6 %. - Applied changes to some source files to reduce compilation problems with GCC >= 4.6. - The Windows version has become around 5 % faster (measured by comparing test suite runs) by recompiling the sources with GCC 4.6.2 and the -O3 switch. - The eCS, Solaris, Windows, Linux, Mac OS X, and DOS versions have been recompiled. - This release has been Valgrind-checked on x86 Linux and Mac to ensure there are no memory leaks. 2.4.1, February 01, 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. 2.4.0, January 11, 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 Linux edition. - `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). 2.3.4, December 28, 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. 2.3.3, December 05, 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) - 1. 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 - 1). 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. 2.3.2, November 26, 2014 - The new function `os.uptime` returns the number of seconds a system has been running. It is available in eComStation - OS/2, Windows, and Linux. - 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). - On Windows, `os.memstate` now also returns information on the current committed memory limit for the current process and the maximum amount of memory the current process can commit ('freepagefile' and 'totalpagefile' keys, respectively). - `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. 2.3.1, November 23, 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 Windows Portable installation ZIP file now contains up-to-date C libraries, the DOS Portable installation ZIP file contains up-to-date versions of the bags and linalg libaries. 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. 2.3.0, November 08, 2014 - The new `<<<` operator shifts bits to the left (multiplication with 2), the new `>>>` operator to the right (division by 2). The `shift` operator performing bit shifts to either direction is and will still be maintained. - The new functions `stats.dbscan` discovers clusters of 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 `xml` package, an expat binding, is now also available in the eComStation edition. The original WarpIN installer missed parts of this library, please download the fixed agena-2.3.0a-os2.wpi installer, which also includes an updated crash course and manual. - 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 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. 2.3.0 RC 3, October 26, 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 any - optional - non-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 userdata - this 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 usually 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. 2.3.0 RC 2, September 30, 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. 2.3.0 RC 1 eCS - OS/2 Warp 4 edition, September 08, 2014 - The eCS edition does not yet feature the 'net', 'xml', 'gdi', and 'fractals' package. Every other package that is indicated in the Primer amd Reference as a 'plus package' does not need to be intialised with the 'import' statement, since they have been directly compiled into the Agena executable. 2.3.0 RC 1, August 14, 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. 2.2.6, July 27, 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. 2.2.5 Library Update 1, July 22, 2014 For instructions on how to easily install the update, have a look at the read.me file residing on the root of the agena-2.2.5-update1.zip archive. This archive can be downloaded from the Binaries/Agena 2.2.5 folder and can be used on all platforms. - 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`. 2.2.5, July 20, 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. 2.2.4, July 16, 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. 2.2.3, July 07, 2014 - `gdi` package: improved display of axes tickmarks and axes labels. - The new function `gdi.pointplot` plots one or more graphs of points. - `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. Also, 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 some `stats` functions. 2.2.2, June 29, 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. 2.2.1, June 23, 2014 - This version is functionally equivalent to 2.2.0 Library Update 2 instead that all patches listed have now been compiled into the binaries and are no longer being implemented in the Agena language. Installers are provided for x86 Solaris, Windows, DOS, x86 Debian Linux, and x86 Mac OS X only. 2.2.0 Cumulative Library Update 2, June 23, 2014 For instructions on how to easily install the update, have a look at the read.me file residing on the root of the agena-2.2.0-update2.zip archive which can be downloaded from the Binaries/Agena 2.2.0 folder and used on all platforms. This ZIP file is a cumulative update. - The `divs` package now tries to avoid to return fractional numerators or denominators. - The `divs` package now supports the `**` operator to raise a fraction to an integer power. The `==` and `~=` equality operators are now supported, too. Furthermore, the equality operators (`=`, `==`) internally no longer convert fractions to floats before conducting a check. To compare a fraction and a simple Agena number for strict or approximate equality, use the new `divs.equals` function. - The `int` operator is now supported by the `divs` package and computes the integer quotient of the numerator of a fraction divided by the denominator. -`stats.extrema` and `stats.obcount` each defined a global variable of no use. This has been fixed. - The `libusb` package is now briefly documented in the Primer and Reference. - Restructured parts of Chapter 7 of the Primer and Reference. Added a comment on metamethods and relational operators to Chapter 6.19. - The configuration utility which prepares the build of the Agena C sources has been patched (file `config.c`). This is only of concern to those users who wish to compile the Agena sources themselves. - The test suite has been extended and also takes 50 percent less time to complete all the checks (see file agena-2.2.0-update2-testsuite.7z in the Sources download subdirectory). 2.2.0 Update 1, June 19, 2014 For instructions on how to easily install the update, have a look at the read.me file residing on the root of the agena-2.2.0-update1.zip archive. This archive can be downloaded from the Binaries/Agena 2.2.0 folder and can be used on all platforms. - Fixed `math.norm` for it returned incorrect results if the left border of the target interval was not equal to 0. - Fixed: `io.eof` returned the opposite of the expected result. - 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`. 2.2.0, June 16, 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 - The Windows version of Agena now includes a libusb 1.0 binding that has originally been written by Tom N. Harris for Lua 5. No documentation is provided, please check the libusb man pages, as the binding provides 1:1 functions. - `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. - Recompiled AgenaEdit for Windows. - 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 -> 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. 2.1.8, April 28, 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 Windows, the function to automatically determine the path to the main Agena library at start-up by looking for the directory containing the agena.exe binary, sometimes did not work. This has been changed. - 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. 2.1.7, April 09, 2014 - When specifying types in the parameter list of a procedure, Agena when calling the procedure only checked the first data type and sometimes returned confusing error messages otherwise if more than one data type has been defined in the parameter list. This has been fixed. - `xbase.attrib` now returns concise information on all supported dBASE 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. 2.1.6, April 08, 2014 - `os.system` can now detect Windows 8.l and Windows Server 2012 R2. - In the portable Windows edition, it is no longer needed to set the AGENAPATH environment variable in XP or later. - 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. 2.1.5, March 09, 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. 2.1.4, March 02, 2014 New operator - The new '~=' operator checks for the approximate equality of objects, using Donald Knuth's numerical method. The operator is very useful to cope with round-off errors in floating point operations. To change the epsilon threshold, please use the environ.kernel/eps facility, changing the value of the global system variable `Eps` will not work due to performance and consistency reasons, e.g.: > environ.kernel('eps':1e5); To check the current setting of the '~=' epsilon setting, just enter: > environ.kernel('eps'): Miscellaneous - `calc.fsum` has been extended to also process multivariate functions. - The new C API function `agn_getepsilon` returns the setting of the accuracy threshold epsilon used by the '~=' operator and the `approx` function. `agn_setepsilon` sets the threshold. Improvement of the `linalg` package - The new function `trace' determines the trace of a square matrix using Kahan-Ozawa summation to prevent (or at least minimize) roundoff errors. - The new function `getdiagonal` returns the diagonal of a square matrix. - The new function `mulrow` multiplies each element of a specific matrix row by a number. - The new function `mulrowadd` multiplies each element of a specific matrix row by a number and adds it to the respective element of another matrix row. - The new function `submatrix` returns submatrices, or individual columns as row vectors. - `diagonal` has been rewritten in C and has become 40 % faster. - `ludecomp` has been rewritten in C, and due to a new algorithm used its output is much more consistent to that of Maple V Release 4 and TI Nspire CX CAS. The pivot vector now is of type vector instead of sequence. It also returns a fourth value, `fail`, if the matrix is singular. - Instead of issueing an error if a singular matrix has been found, `gsolve` now returns `infinity` if an infinite number of solutions has been found, and `undefined` if no solutions exists. It returns `fail` if it could not determine whether no or an infinite number of solutions exist. - The '__writeindex' metamethod for vectors now issues an error if a given index is not an integer. - For consistency, the '==' operator now checks matrix or vector components for strict equality, and the '~=' operator approximate equality. Please also have a look at the '__aeq' and '__eeq' metamethods in the lib/linalg.agn library file. - The new functions `maeq` and `meeq` conduct matrix equality checks, the former checking approximate equality of the respective matrix components using Donald Knuth's algorithm, the latter conducting a strict equality check of the respective components with out any tolerances. Likewise, the new `linalg` functions `vaeq` and `veeq` do the same with vectors. - `veq` and `meq` and their respective metamethods to check for the approximate equality of vector and matrix components have been deprecated. They are still available but might be removed in future releases of Agena. Please use the '~=' operator instead, which is also faster. - `backsubs` has been deprecated, please use `gsolve` instead. For backward compatibility, an alias is provided. - Some error messages of the `linalg` now indicate the name of the function where a vector check failed. 2.1.3, February 21, 2014 New Functions - The new function `calc.polyfit` returns a sequence of coefficients of an nth-degree polynomial of a sample, using polynomial regression. It tries to reproduce polynomial trend lines known from spreadsheet applications. There is no limit on the degree, but a degree of 7 or more is not regarded appropriate. - The new function `calc.linterp` conducts a Lagrange interpolation. - The new function `linalg.gsolve` performs Gaussian elimination and returns a solution vector plus the reduced linear system as an upper triangular matrix. It is at least ten times faster than `linalg.backsubs`. - The new C API function `agn_geteps` returns the setting to the Agena system variable Eps (epsilon). Miscellaneous improvements - Optimised `calc.fminbr`. - Error management of `beta`, `frac`, `math.zeroin`, and `calc.polygen` has been improved. - `os.difftime` now is Year 2038-ready. - `calc.sections` determining subintervals where a change of sign of a given function has been found, is now documented. - Some few C source files and library.agn have been cleansed, there have been no technical or functional changes. - The `gzip` package has been recompiled using the latest zlib 1.2.8 package. At least in Windows, this also results into a much smaller package binary. - The index of the manual has been extended: new main topics `Statements` and `Data Types`, and improvement of the overview on mathematical functions, and a hint on how to compare `linalg` objects. Bug Fixes - A bug in the simple equality check of tables with filled array and hash parts has been fixed, e.g. [4, 1, 'a'~2] = [5, 1, 'a'~2] no longer returs `true`. - `linalg.add`, `linalg.sub`, and `linalg.scalarmul` did not correctly operate with non-integral vector components. This has been fixed. Also tuned `linalg.add` and `linalg.sub` by 20 %, and `linalg.scalarmul` by 10 %. - See also entry to `linalg.meq` below for a fix on the equality check. - Applied Lua 5.1.5 patch 2: "When loading a file, Lua may call the reader function again after it returned end of input." Improvement of the `linalg` package - The multiplication metamethod for matrices has been extended to also support multiplication of two matrices. Also, with scalar multiplication, the scalar may now also be passed as the second operand. Also, the underlying matrix multiplication algorithm has been rewritten in C and now is at least four times faster. - `linalg.scalarmul` has been extended to accept scalar and vector in any order. The vector scalar multiplication metamethod now allows to pass scalar and vector in any order, as well. - `linalg.dotprod` has now been implemented in C and thus has become 40 % faster. - `linalg.det` has been reimplemented in C and has become much more accurate. It also is twenty times faster now. Contrary to the former implementation, it returny 0 with singular matrices instead of issueing an error. - `linalg.inverse` has been reprogrammed in C and has become at least ten times faster. - `linalg.transpose` is now written in C. With square matrices, it has become 30 % faster, with other matrices, it is now three times faster. - A new metamethod to compare two matrices has been added to the `linalg` package to fix a bug when comparing normal with sparse matrices. Also, Donald Knuth's approximation method is used to compare matrix elements (see the `approx` function for information on how this works). See also `linalg.meq` in the manual. - A new metamethod to compare two vectors has been added to the `linalg` package. It uses Donald Knuth's approximation method to compare vector elements (see the `approx` function for information on how this works). See also `linalg.veq` in the manual. - Optimised `linalg.swapcol`, `linalg.swaprow`, and `linalg.identity`. 2.1.2, January 20, 2014 New expressions, operators, and functions for general use: - In parameter lists, Agena can now validate up to two basic types for a given argument with the Maple-like arg :: { type[1], type[2] } parameter extension. Thus, for example, proc(x :: {number, complex}) checks for both rational and complex numbers x. User-defined types are not supported by this new feature. - Memory management to handle parameters and local procedure variables has been changed. Thus, for example, Agena consumes 7 percent less memory after start-up. - The new `nan` operator checks whether a number or complex number evaluates to `undefined`. - `finite` now can also check complex numbers. - `conjugate` has become an operator and is three times faster than before. - `arcsec` is now an operator and has become 33 % faster. - The new function `cabs` returns the real and imaginary absolute value of a complex number. - The new function `net.smallping` conducts low-level network connection attempts to a server to see whether it is alive and also determines round-trip times. - Improved error handling of `cot`, `coth`, `sec`, `csc`, `arctanh`, `arcsec`, `arccsc`, `arccsch`, `arccot`, `csch`, and `sech`. They thus have become 5% slower. - `stats.prange` crashed Agena when it had to sort a structure at first. This has been fixed. Operators for faster computation of fractals (see the `fractals` package): - The new `cosxx` operator implements FRACTNT's v16 buggy cosxx function, i.e. if cos(x + I*y) = a + I*b, then cosxx(x + I*y) calculates a - I*b (i.e. the imaginary part of the result has the wrong sign). The function usually produces beautiful fractals, and is 33 % faster than the former `fractals.cosxx` function, which has been removed. - With a complex number z = x + I*y, the new `bea` operator returns the complex number bea(x * I*y) = sin(x)*sinh(y) + I*cos(x)*cosh(y), and `undefined` if a number is passed. The function produces beautiful fractals, and is 33 % faster than the former `fractals.bea` function, which has been removed. - The new `flip` operator swaps the real and imaginary parts of a number. It always returns 0 with numbers. It is 1.6 times faster than the former `fractals.flip` function which has been deleted. 2.1.1, January 03, 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. - On Macs, the agena-2.1.1a-mac-intel.pkg installer now also includes AgenaEdit. 2.1.0, December 30, 2013 - 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. In general, any statements where an exception might be expected can be put into a `try` clause. If an error is issued, generated by an explicit call to the `error` function or to any other expression, function, or statement, control immediately jumps to the corresponding `catch` clause if present or to the end of the `try/yrt` statement if no `catch` clause has been given, ignoring any other subsequent statements in the `try` clause. > try > for i to 3 do > print('before', i); > if i = 2 then error('oops') fi; > print('after', i) > od > catch err then > print('error', i, err); > yrt before 1 after 1 before 2 error 1 oops The `protect/lasterror` error dealing facilities are still and will always be supported. The new control statement also works with the `break`, `skip`, `redo`, and `return` statements flawlessly. - The new `redo` statement restarts the current iteration of a `for/to` and `for/in` loop from the beginning. Example: > flag := true; > for j in [10, 11, 12] do > print('before', j, flag); > if flag and j = 11 then > clear flag; > print(' -->', j, flag, 'jump back') > redo > fi; > print('after', j, flag) > until j > 12; before 10 true after 10 true before 11 true --> 11 false jump back before 11 false after 11 false before 12 false after 12 false - 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. 2.0.0, December 01, 2013 - 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. Examples: > for i to 5 do > print(i) > as i < 3 1 2 3 > for i in [1, 2, 3, 4, 5] do > print(i) > until i >= 3 1 2 3 - The new `do/until` loop iterates until a certain condition is met: > c := 0; > do > inc c; > print(c) > until c >= 3 1 2 3 - 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: > for i do > print(i) > od - The new `onsuccess` clause in `if` and `case` statements executes a chunk if at least one of the conditions is true. Examples: > flag := false; > if 1 = 0 then > print(0) > elif 1 = 1 then > print(1) > onsuccess > flag := true > else > print(-1) > fi; 1 > print(flag); true > flag := false; > if 1 = 0 then > print(0) > elif 1 = 0 then > print(1) > onsuccess > flag := true > else > print(-1) > fi; -1 > print(flag); false > flag := false; > a := 2; > case a > of 1 then > print(1) > of 2 then > print(2) > onsuccess > flag := true > else > print(-1) > esac; 2 > print(flag); 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. Examples: > create table a; > a.b: null > a.b.c: Error in stdin, at line 1: attempt to index field `b` (a null value) > a..b..c: null > create table a; > a[1]: null > a[1][2]: Error in stdin, at line 1: attempt to index field `?` (a null value) > a..[1]..[2]: null - 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. 1.12.9, November 05, 2013 - The new functions `io.getclip` and `io.putclip` exchange texts between Agena and the clipboard (Windows only). - `stats.prange` has been rewritten in C and has become up to 1.5 times 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. 1.12.8b, October 30, 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