November 15th, 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).
September 12th, 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.
September 5th, 2011If in the parameter list of a procedure user-defined types had been specified, in procedure calls no errors were issued and the procedure has been executed instead, in the following cases:
· a) a table, set, sequence, pair, or procedure - without being of a user-defined type - has been passed,
· b) no value at all has been passed for the parameter concerned. This has been fixed. Also, all respective error messages have been standardised.
September 1st, 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.
March 7th, 2011Semantic 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.
February 14th, 2011Patches 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.
January 23rd, 2011This release includes bug fixes, extensions, and an improved manual:
· `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.
January 12th, 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.
Four 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.
· In Windows 7, printing the contents of the root directory did not work, i.e. os.list('c:') returned the contents of 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.
January 9th, 2011This release includes bug fixes:
· 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.
Four 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.
· In Windows 7, printing the contents of the root directory did not work, i.e. os.list('c:') returned the contents of 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.
January 3rd, 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.
December 25th, 2010New extended features:
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.
December 19th, 2010· This release features new functionality and a cleansed namespace.
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.
December 17th, 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.
December 11th, 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.
November 21st, 2010Bug fixes:
· 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`.
November 15th, 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.
November 7th, 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.
September 20th, 2010This is a bug fix release:
· 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.
August 17th, 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.
August 12th, 2010· includes a fixed version of the linalg package which was not properly compiled before.
July 13th, 2010AgenaEdit 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 licence 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`.
July 7th, 2010· Agena is now shipped with an editor called AgenaEdit. It provides syntax-highlighting, basic facilities to copy, paste, delete, find and replace texts, can open and save files, and jump to specific lines in the code.
· It also can run the code you entered (even parts of it) by calling Agena and printing results in a separate window.
· AgenaEdit is in its infancy - any useful feedback to improve the editor is highly appreciated.
· As a language-consistency measure, the following function names which include upper-case letters have been changed such that all capital letters in the names have been replaced by lower-case letters.
· Aliases are provided to ensure backward compatibility, but they may be deleted in the next major release (0.35).
· This refers to: `isBoolean`, `isComplex`, `isNegint`, `isNonnegint`, `isNumber`, `isNumeric`, `isPair`, `isPosint`, `isString`, `isTable`, `isSet`, `isStructure`, `loadClib`, `toNumber`, `toSeq`, `toSet`, `toString`, `toTable`, `isEqual`, `bisEqual`, `strings.toChars`, `strings.toBytes`, `strings.isAbbrev`, `strings.isAlpha`, `strings.isAlphaSpace`,
· `strings.isAlphaNumeric`, `strings.isEnding`, `strings.isFloat`, `strings.isLowerLatin`, `strings.isLowerAlpha`, `strings.isUpperLatin`, `strings.isUpperAlpha`, `strings.isMagic`, `strings.isLatin`, `strings.isLatinNumeric`, `strings.isNumber`, `strings.isNumberSpace`, `package.checkClib`, `math.isPrime`, `math.nextPrime`, `math.prevPrime`, `math.toDecimal`, `math.toRadians`, `utils.isLeapYear.
· The function name `isSequence` has been changed to `isseq`. An alias is provided to provide backward compatibility but may be deleted in Agena 0.35.
· Improved check of optional arguments in `gdi.options`.
June 27th, 2010· This update includes various patches and new functions.
· 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.
June 21st, 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.
June 14th, 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.
June 9th, 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.
May 31st, 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.
May 26th, 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.
May 26th, 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`.
May 15th, 2010Syntax changes:
· Optional arguments of the form `option = value` are supported now in function calls. The old form `option ~ value` is still recognised. If you need to conduct a Boolean equality operation in a function call, such like f(a=b), where `a=b` shall result to a Boolean, use the new function `isEqual`: f(isEqual(a, b)).
Function improvements:
· The `save` function now produces smaller files, especially with strings. The new file format is incompatible with previous versions, so you cannot read in binary files produced with older Agena releases.
· The `read` function now uses a subroutine written in C resulting in an overall increase in speed of 10 to 20 %.
· User-defined types for tables are now supported by the `read` and `save` functions.
· The new 'libnamereset' option of the `kernel` function replaces the _EnvLibnameReset environment variable. Whereas _EnvLibnameReset has been unassigned after a `restart`, the setting is no longer changed after a restart.
· The new 'longtable' option of the `kernel` function replaces the _EnvLongTable environment variable. If set to true, each key~value pair in a table will be printed at a separate line. If set to false, tables are printed like sets or sequences, i.e. in one consecutive line. The setting the user chose will no longer be deleted after a `restart`.
· Improved error messages of the fractals package.
New functions:
· The new `binio.readshortstring` and `binio.writeshortstring` functions read and write strings of up to 255 characters in binary format.
· The new `isselfref` function determines whether a table, set, sequence, or pair is self-referencing, such as the global table _G.
· The new `setbit` baselib function sets or unsets a bit in an integer.
Other Changes:
· _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.
Compatibility:
Renamed some global environment variables to avoid crowding the global namespace:
· _EnvEps has been renamed to Eps.
· _EnvMinLong has been renamed to _Env.MinLong.
· _EnvMaxLong has been renamed to _Env.MaxLong.
· _EnvBufferSize has been renamed to _Env.BufferSize.
· _EnvPathSep has been renamed to _Env.PathSep.
· _EnvMore has been renamed to _Env.More.
· _EnvWithVerbose has been renamed to _Env.WithVerbose.
· _EnvRelease has been renamed to _Env.Release.
· _EnvGdiDefaultOptions has been renamed to _Env.GdiDefaultOptions.
· _EnvFractintColorMaps has been renamed to _Env.FractintColorMaps.
· _EnvFractOptimised has been renamed to _Env.FractOptimised.
· _EnvWithProtected has been renamed to _Env.WithProtected.
· The _EnvIoForceError and _EnvVerbose environment variables have been removed.
· All aliases that provide backward compatibility to older math, tables, or utils functions have been removed.They are now included in the lib/compat.agn file so you may initialise them manually by running this file from within your agena initialisation file, e.g. run '/lib/compat.agn'.
· The binio ans ads packages no longer check the _EnvIoForceError or _EnvVerbose environment variable and all functions quit with an error instead of returning fail.
· Files created by `save` are not compatible to those created with older Agena versions.
C API:
· The new `agn_getenv` C API function returns an entry in the global environment table _Env.
· The new C API functions `agn_setemptyline`, `agn_getemptyline`, `agn_setlibnamereset`, `agn_getlibnamereset`, `agn_setlongtable`, `agn_getlongtable` set and read kernel settings.
· Functions `agn_isverbose` and `agn_isioforceerror` have been removed.
April 26th, 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.
April 17th, 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.
April 12th, 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.
April 7th, 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.
March 30th, 2010· Added the fractals package to easily draw fractals in Solaris, Mac, Linux, and Windows.
· When given the -v option, Agena now does not execute the initialization files any longer.
· The binary Mac distribution for Intel CPUs runs around 30 % faster than previous releases.
· `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).
March 30th, 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 and 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 installers.
· 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 used by 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 with the OS/2, DOS, and Sparc releases, there are still issues in the complex domain 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 Solaris 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.
February 22nd, 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: ioanykey, iogetkey, osbeep, osmemstate, osfreemem ossystem does not return the version number, revision, and CPU
· The new osisMac function determines whether Agena is run on Mac OS X
· ossystem returns 'MacOSX' if run on Mac OS X
February 15th, 2010· The following functions from the math package have been moved to the base library for language consistency: arccosh, arccoth, arcsinh, arctan2, arctanh, argument, besselj, bessely, binomial, ceil, conjugate, cot, coth, csc, erf, erfc, fact, fma, frac, frexp, heaviside, hypot, irem, ldexp, log, log10, modf, roundf, secAliases are provided so that you still can use these functions with the `math.` prefixThe aliases will be removed in the next major release.
· infinity is no longer allowed as an initial or last value to a for/to loop, and neither as the step size, for it implied that the loop counted indefinitely which was not the case.
· The to limit must now always be given to for/to loops.
· Operations with unary mathematical operators produced wrong results if the result has been raised to a power with the ^ and ** operatorsThis has been fixed.
· Updated language scheme files.
February 12th, 2010· The new function strings.isFloat checks whether a string contains a float.
· The new function strings.gmatches is a wrapper around strings.gmatch and returns all occurrences of a pattern in a string in a new sequence.
· When pressing CTRL+C during the console output of a table, set, or sequence that included other tables, sets, or sequences, the interpreter sometimes did not position the prompt correctly and also did not print separating lines between prompts. This has been fixed.
· The new kernel option 'emptyline' controls whether an empty line is printed between two input regions. By default, an empty line is printed. By issuing the statement `kernel(emptyline~false)`, two prompts are not separated by an empty line. This can always be revoked in a running session.
· The _EnvPrint.NoNewLine setting has been removed. Use the new kernel option 'emptyline' instead.
· The print function now accepts two options: 'delim' which denotes the character sequence separating two strings, and 'nonewline' which prevents the print function from issuing a newline after output completed.
· Removed a potential memory leak in the io.write and io.writelines functions.
February 12th, 2010· Agena now supports arbitrary precision for real numbers through the mapm binding to Mike's Arbitrary Precision Math Library, which has been written by Michael C. Ring.
· The new function linalg.swaprow swaps rows in a matrix.
· The new function linalg.swapcol swaps columns in a matrix.
· The getentry function has been implemented in C and thus is 5 times faster than before.
· math.isPrime is around 4 % faster than before.
· The new function countitems counts the number of occurences of an item in a structure. The procedure accepts either the item itself to be counted or a function that evaluates to true in order for something else to be counted. It is at least twice as fast as a combination of size and select. The function may invoke metamethods.
· The gdi package includes a number of new functions that allow to plot geometric objects easily. See chapter 7.19.7 for a tutorial.
· If you pressed CTRL+C during operation of the instr operator, Agena crashed. This has been fixed.
· strings.seek will be removed in the next major release. Use the instr operator instead for it is 45 % faster.
· Fixed a bug in gdi.options that occurred when a wrong type has been passed.
· The manual has been improved.
February 12th, 2010· In gdi.plotfn, labels were not plotted correctly in either Windows XP or in other versions of Windows running NVIDIA VGAs. This has been fixed. Solaris and Linux do not seem to have been affected even when runnung NVIDIA cards.
· When printing tables and sets, Agena printed an excess comma and a blank right after the last value at line breaks. This has been fixed.
· If a string has been assigned to the new environment variable _EnvPrint.EncloseStrings, then Agena now outputs strings with the prepending and appending string assigned to _EnvPrint.EncloseStrings at the console.
· The names of boolean _EnvPrint* environment variables have been changed (to syntax _EnvPrint.*). See Appendix A5. The old names are no longer supported.
· The setting of _EnvPrint.EmptyLine had no effect. This has been fixed.
· If using the mouse option with gdi.plotn, plotting of the x and y positions can now be also cancelled by hitting a key.
· gdi: `ink not defined` error messages are no longer printed on screen.
· Improved internal step size detection in for/to loops for step sizes that are larger than the maximum integer representable on your machine.
· The speed of the float operator has been increased by 13 % in the Windows version.
· The new linalg.mzip functions zips together two matrices by applying a function to the respective elements.
· zip and linalg.vzip now accept more than two function arguments.
· The new function linalg.augment joins two or more matrices or column vectors together horizontally.
· The new function linalg.stack joins two or more matrices or row vectors together vertically.
· The new baselib getentry function returns an entry from a table or sequence without issuing an error if one of the given indices does not exist (`attempt to index a value` error). In case of an invalid index, null is returned.
· The macros linalg.isantisymmetric, linalg.isdiagonal, linalg.isdiagonal, linalg.isidentity, linalg.ismatrix, linalg.issquare, linalg.issymmetric, and linalg.isvector have been removed.
· Matrix subtraction with the binary minus operator did not work. This has been fixed.
· If you want to scalar-multiply a matrix A with a number n, the new syntax is: n*A, not A*n.
January 4th, 2010· The new function io.anykey checks whether a key (any key) is being pressed (available in Solaris, Linux, and Windows).
· A second procedure called calc.xpdiff to differentiate functions has been added to the calc packageIt produces better results with powers and trigonometric functions than calc.diff.
· calc.minimum and calc.maximum have been improved by checking possible extrema with both calc.diff and calc.xpdiff.
· The new dimension baselib function creates sparse vectors and sparse matrices with arbitrary index rangesAn optional initialiser may be given, too.
· calc.zero now sorts its return and also uses a fall-back method to improve results.
· The new tables.entries function returns all elements (not the keys) of a table in a new table array.
· When printing tables at the console, the output is now sorted in ascending order of the keys.
· When printing sets at the console, the output is now sorted.
· The Windows installer has been improved, supports multi-user setup, and also offers to copy the Agena include files to your disk.
January 4th, 2010· In all OS versions, Agena now supports multi-user configurations by searching for an (optional) initialization file in the user's home folder at programme start-upAgena still first tries to read the agena.ini file in the main Agena folder before looking for the personal initialization file.
· for/to loops now automatically use an advanced precision algorithm (an adaption of Kahan summation) if the step size is non-integral: This in many situations prevents Agena from stopping iteration before the last iteration value has been reached (try "for i from -4 to -3 by 0.1" in previous versions)Also Agena in most cases does not return for/to-iteration values with roundoff errors any longer.
· The new nseq baselib function returns a sequence of numbers over an interval with a given step sizeThe return is much more precise with step sizes that are not integers by using the same new algorithm used in for/to loops.
· gdi now has a function to significantly increase the performance of the package: gdi.autoflush allows to set or unset autoflush modeThe latter gives quite a performance boost on x86 based systems.
· The new gdi.mouse function returns information on the current position of your mouse and its button state.
· The new function gdi.system sets the user's coordinate system and its scalings.
· The new 'mouse' options to gdi.plotn prints the current position of the mouse to the consoleClick the right mouse button to finish.
· binio.sync corrupted filesThis has been changed.
· The -p command-line switch to set the path to an alternate main Agena library folder did not work any moreThis has been fixed.
· The -n command-line option suppressed loading the main Agena library fileThis has been changed.
· calc.minimum and thus calc.maximum missed some possible extrema, this has been changedThe procedures sometimes also returned a point multiple timesThis has been fixed, as well.
· calc.fseq now uses the Kahan summation algorithm to prevent (or at least minimize) roundoff errorsBefore, right borders have not been processed in certain situations, and elements inserted had roundoff errors.
· calc.fsum now uses a modified Kahan algorithm conceived by Kazufumi Ozawa which is more precise than the original one.
· Patched calc.fminbr, such that if a minimum is exactly at one of the given borders, the border is returnedThus, the results of calc.minimum and calc.maximum, which use calc.fminbr, have been improved, as well.
· gdi.plotfn: In case of errors, the function now tries to prevent to open empty windowsPlotting axes and labels has been improved, as well.
· When printing sequences, Agena sometimes printed a comma and a blank right after the last value at line breaksThis has been fixed.
December 29th, 2009· readlib and with now also check the folder pointed to by mainlibname for Agena libraries. The new search sequences are: current working directory, mainlibname, libname. The search sequence used by readlib is output on the console if the last argument is true.
· Added labels, xscale, and yscale options inspired by the TI-84 calculator to gdi.plotfn. Plotting of the `0` label has been improved, as well.
· The new tables.allocate function sets the specified keys and values to a table.
· Standardized error messages in all packages.
· map, select, and remove did not work correctly in some cases with table arrays, and always did not work correctly with dictionaries. This has been fixed.
· maptoset crashed Agena if called with a dictionary. Also it did not work correctly with some sorts of table arrays. This has been fixed.
· As previously documented, zip did not work with dictionaries. This has been changed.
· linalg.checkvector might have crashed if anything but a vector has been passed. Although this error never occurred, a fix has been provided.
November 2nd, 2009· Parameter lists of procedures now accept names of user-defined types (see settype).
· Multiple indexes can now be separated by commas, e.g. a[1, 2] is equal to a[1][2].
· The new instr operator searches for substrings within a string, supports regular expressions in the search pattern und also optionally starts from a given position in the string. It is twice as fast as strings.find. The function was named after a similar function in the Sinclair QL.
· The new subs function substitutes values in tables, sets, and sequences.
· The new formatting function _EnvPrint.Procedure has been added to allow the user to control how procedures and procedures with a user-defined type are output at the console.
· The new & operator concatenates strings. The current .. concatenation operator will gain a new meaning in one of the coming releases, so it is advised to no longer use it.
· The bitwise operators band, bnot, bor, and bxor have been renamed to &&, ~~, ||, ^^ to resemble the bitwise operators on the Sinclair QL and in C. The old bitwise operators (band, etc.) are still supported for backward compatibility but will be deleted in one of the coming major releases.
· The garbage collector inadvertently deleted user-defined types. This has been fixed.
· map, select, and remove did not copy user-defined types to the new sets. This has been fixed.
· remove did not copy user-defined types and metatables with tables and sets. This has been fixed.
· The C API function agn_setutypestring has been removed. Use agn_setutype instead.
November 2nd, 2009· The new toSet baselib function converts a string into a set of its characters, and a table or sequence into a set.
· io.readlines has been patched to process lines with more than 2048 characters. The function now also issues an error if internal memory allocation fails. Internal buffer size has been decreased from 2048 bytes to 512 bytes. You may change this by assigning another value to AGN_IOREADLINES_MAXLINESIZE in the agnconf.h file and recompiling Agena.
· io.readlines now also accepts file handles. When using file handles, as opposed to file names, please note that you must open and close the file manually before and after using io.readlines (with io.open and io.close).
· io.readlines no longer returns an empty table if the file does not exist. Instead, it issues an error.
· toSeq now returns an error instead of fail if it does not receive a string, set, or table.
· The baselib function used has been extended and can return memory usage in bytes, kbytes, and gbytes. It is a C function now.
· The undocumented gcinfo function has been deleted. Its functionality has been taken by used.
· The new C API function agn_usedbytes returns the number of bytes used by the system.
· Corrected wrong error message of toTable.
· Renamed C API function `agn_isioforcerror` to `agn_isioforceerror`.
November 2nd, 2009· xor has been extended to check for non-null and null constellations so that they can also process non-boolean values similar to the and, or, and not operators.
· Expressions like 'text'[1] and 'test'$(1) are now supported by the parser. Before, the string first had first to be stored to a name in order to subscript it.
· The manual has been updated. Also, a crash course has been added to the doc directory.
· The C API functions agn_ncall and agn_ccall now issue an error if the type of return of the Agena function call is not a number or complex value, respectively. This affects calc.fseq and calc.fsum.
· The C API function agn_ccall is now also available for the strict-ANSI and the DOS versions of Agena.
· The strict-ANSI versions of Agena, and the DOS and OS/2 versions do not try to initialise external/dynamic C libraries any longer.
· Provided a separate makefile to compile the strict-ANSI versions of Agena (compiled with the LUA_ANSI option) so that the stats, calc, linalg, and ADS packages can now be used (they are now compiled into the Agena executable). Before, these packages could not be used in the strict-ANSI versions of Agena. See the `makefile.ansi` for instructions on how to compile under GCC.
· Improvements to the Linux installers: at uninstall, all the Agena directories are now deleted. The RPM installer now also prints a hint at installation to properly set the AGENAPATH environment variable.
· Improvements to the Solaris installers: the PKG installer now also prints a hint at installation to properly set the AGENAPATH environment variable.
September 5th, 2009· Added the error function math.erf, and the complementary error function math.erfc.
· Added the Bessel function of the first kind math.besselj, and the Bessel function of the second kind math.bessely. The order is given by the first argument, the argument as the second argument.
· If the new environment variable _EnvIoForceError is set to a non-null value (the default), the io.open, io.readlines, and the various binio functions quit with an error instead of just returning normally.
· binio.readbytes and binio.readchar returned an empty sequence instead of fail in case the file to be read did not exist. This has been changed: fail or an error is now returned.
· arcsin and arccos are now operators and thus around 40 % faster.
· Added the xor operator which performs a Boolean exclusive-OR on values which evaluate to or are true, false, fail, and null.
· Added the atendof operator which checks whether a word ends in a given phrase and returns its position as a number. The operator returns null if the strings have the same length, at least one of them is the empty string, or the word does not end in the given pattern.
· hasrtable now only returns true, if it has a read-write remember table (updated by the return statement).
· The new function hasrotable determines whether a function has a read-only remember table (that cannot be updated by the return statement) and returns true or false.
· The new operators gethigh and getlow retrieve the higher and the lower bytes from a number (i.e. C double).
· The new operators sethigh and setlow set the higher and the lower bytes to a number (i.e. C double).
· The new operators band, bor, bxor, and bnot conduct bitwise and, or, exclusive-or, and complementary operations on numbers.
· The new `kernel` function configures settings of the Agena kernel. Currently it can change the way the bitwise operators internally work (usage of signed or unsigned integers), and how numbers are printed.
· With real numbers x, math.argument now returns Pi instead of 0 if x < 0.
· Because of a bug in the underlying ANSI C library functions, arcsin and arccos produced wrong results with complex numbers if their imaginary part was zero in UNIX systems. This has been fixed.
· math.isPrime reported false with number 2. This has been corrected.
· As opposed to the manual, abs returned 2 with fail. Now it returns -1 as documented.
· The bits package has been removed.
· Added the new C API function agn_isioforcerror which checks whether _EnvIoForceError has been set to a non-null value.
· The new C API function agn_setbitwise determines whether the operators band, bor, bnot, bxor, and shift internally calculate with either signed or unsigned integers.
· The new C API function agn_getbitwise returns the mode set by agn_setbitwise.
· The new C API function agn_setdigits sets the number of digits used for printing numbers.
· The new C API function agn_getdigits determines the number of digits used for printing numbers.
· Internal: Removed deprecated "REPL" entry from luaP_opnames.
· The Windows installer has been improved by now checking for a previously installed version of Agena, by preventing that the installer is started if another instance of it is already running, and by some other small improvements.
September 5th, 2009· The new `math.fraction` function splits a number into its numerator and denominator.
· The new `math.nextafter` procedure returns the next machine floating-point number of its argument in a specified direction.
· `calc.fseq` has been extended to accept an optional step size.
· The new `calc.minimum` function returns possible minimum locations of a univariate function.
· `math.approx` returned wrong results with GCC compiled binaries because of a buggy C library function (fmax). This has been fixed. `math.approx` now uses a combination of a simple distance measurement for values near 0, and the approximation algorithm already implemented for comparing larger values.
· Version information and an icon are now compiled into the Windows binary.
· Added --large-address-aware switch to the Makefile in a hope that correct values for free physical RAM are returned in the Windows versions of Agena on computers with > 2 GBytes RAM and
September 5th, 2009· Minor improvements of the error messages issued by `io.write` and `io.writeline`.
· Revised the manual and included examples for the io, calc, and linalg packages.
September 5th, 2009· Agena quits in Windows if a line beginning with a hash and ending with a colon has been entered. This has been fixed.
An input like:
· > for i to 10 do
· > print(i)
> i:
· > od;
· confused the stack. Now a syntax error is issued if a value shall be printed using the colon notation and if the colon notation is not used in the first line of input.
· A complex division by 0+0*I now returns `undefined` on all platforms.
September 5th, 2009· `toNumber` now also converts strings with complex values into genuine complex values.
· Extended `math.approx` to compare complex values, as well.
· Patched `math.approx` to return correct results.
· Patched `math.arccosh` to return correct results if its argument x is in [-infinity, 0].
· The `ln` operator returned `-infinity` instead of `undefined` if its argument is 0+0*I. This has been fixed.
· `math.arccoth` returned wrong results if its `real` argument x was less than 1 or x = -1+0*I or x = +1+0*I. This has been fixed.
· Patched `math.ceil` to work correctly with real numbers.
· The `gammaln` and `int` simply returned their argument if it were not a number. Now these operators return an error if no metamethods have been defined.
· Fixed an issue when compairing a number and a complex values that are both `undefined`. In this case, the equality check returned `false`. Now `true` is returned.
· `math.binomial` now returns `undefined` if at least one of its arguments is not an integer.
· Patched `math.gcd`: If at least one of its argument is not an integral number, the function now returns 1.
· Patched `math.lcm`: If ots second argument is 0, 0 is returned instead of `undefined`.
· Patched `max` and `min`: If the functions received an empty sequence, Agena crashed. This has been fixed. The functions now in general return `null` if they receive an empty table or sequence.
· `stats.median` crashed if it got an empty sequence. This has been fixed.
· Fixed crippled error message of `math.root`.
September 5th, 2009· The built-in module system inherited from Lua has been largely removed. The `require`, `module`, `seeall`, and all the other functions of the Lua `package` module are not available any longer. (`require` did not work in Agena due to faulty file path assembly, anyway.) Use readlib instead.
· `readlib` and `with` now first try to find a library in the current working directory. If this fails, then libname is traversed. Also packages loaded are now registered in the `package.loaded` table.
· The ' and " characters to denote strings now do have the same meaning. If you use a single quote to enter multline strings, backslashes to denote the end of a line are no longer needed.
· Changed behaviour of the split operator if its left-hand operand is equal to the right-hand operand or if the right-hand operand is the empty string: In these cases an empty set is returned instead of a sequence of two empty strings, or an error message, respectively.
· The functionality of the former C library function `strings.put` has been added to the `replace` operator, which is twice as fast. An alias for the old function name is available so that you can still use it (but at the expense of the speed gain).
· The new `os.drives` function returns all logical drives available to the local computer (OS/2 and Windows only).
· The new `os.drivestat` function returns information on a given logical drive on the local computer (Windows only): file system, label, total size, free size, and drive type (fixed, removable, etc.).
The structure of the output of `os.fstat` has been changed, and the amount of information it determines has been increased. Additional returns are:
· File attributes as an integer (C type mode_t), indexed with the key 'perms'.
· File attributes as a string similar to that in UNIX, e.g. '-rw-rw-r--:-----', indexed with key 'bits'.
· In OS/2 and Windows, the file attributes 'hidden', 'readonly', 'archived', and 'system' are also returned in the subtable with key 'owner'.
Changes to the table returned by `os.fstat`:
· File mode is now indexed with key 'mode' (formerly key 1).
· File size is now indexed with key 'length' (formerly key 2).
· The new function `os.fattrib` changes the file mode using symbols known from UNIX or DOS instead of asking for octal numbers. The Windows and OS/2 versions also support OS-specific hidden, archived, readonly, and system file attributes.
· `os.beep` has been extended for the UNIX and DOS versions of Agena and now accept the number of seconds the loudspeaker shall issue a sound.
· Added Lua 5.1.4 patch 5 of `debug.getfenv` to the codebase.
· If the new environment variable _EnvLibnameReset is set true, then the `restart` statement resets libname to its original value defined in the OS environment variable AGENAPATH.
· `readlib`, `loadClib` and `with` now add the packages loaded to the `package.readlibbed` set.
September 5th, 2009· os.remove and os.move returned true even if the file to be moved or deleted did not exist. This has been changed.
· stringarray userdata could not be properly garbage-collected. Since this data structure is used by strings.diamap, and strings.diamap along with its substitution userdata array is defined in the library.agn file, repeatingly restarting Agena consumes more and more memory (without freeing it later). This has been fixed.
· In Windows and OS/2, os.fcopy now correctly sets all OS-specific file permission attributes of the original file to the new file.
· In Windows, os.memstate stated the same value for total virtual and total physical memory sizes. This has been fixed.
· When printing structures, ANSI C NaN values (Not a Number, known in Agena as undefined) were printed in the C fashion, e.g. `1.#QNAN`. This has been changed.
· In the OS/2 version, Agena now prints the number of free virtual RAM in kBytes at start-up.
· os.freemem is now supported in the OS/2 version of Agena and returns the free virtual RAM.
· At start-up, the Agena welcome message is now printed before the library.agn and agena.ini files are loaded.
September 5th, 2009· The split operator now supports delimitors that consists of more than one character, i.e. 'agena::language' split '::' -> seq('agena', 'language'). Also, Agena does not crash or run out of memory any more if an empty string is passed for the delimitor.
· Changed Agena initialisation to allow switches to work as expected: First, libname is assigned. Second, the library.agn and agena.ini files are read; and third, program options are run.
· When printing complex values that are elements in structures (tables, sets, sequences, pairs), Agena issued an error. This has been fixed.
September 5th, 2009· If libname included more than one path, then the readlib function printed misleading error messages in case a package could not be found while traversing libname. (The library could be initialised properly, however.) This has been fixed. Also improved error handling when trying to read non-existing linked C libraries or when executing Agena library files that are syntactically incorrect.
· Optimised function toTable a little bit.
· stats.median crashed with tables. This has been fixed.
· stats.minmax now returns fail if a sequence or table with less than two elements has been passed.
September 5th, 2009· Pairs can now be indexed in read operations with the integers 1 and 2.
· The manual has been updated. Especially, Chapters 4.6 (Arithmetic), 4.7 (Strings), 4.10 (Sets), and Chapter 4.11 (Sequences) have been revised.
· A mimetype language description file `agena.lang` has been added to the /schemes folder.
· All installers unfortunately overwrote the existing agena.ini file during installation. This has been changed.
· Renamed the following linalg functions: isantisymmetric to isAntisymmetric, isdiagonal to isDiagonal, isdiagonal to isDiagonal, isidentity to isIdentity, ismatrix to isMatrix, issquare to isSquare, issymmetric to isSymmetric, and isvector to isVector. Aliases for the old function names are available so that you can still use them.
September 5th, 2009· The for/in loop now also accepts the null value. In this case, the loop does nothing, and Agena proceeds with the statement following the loop.
· The os.fexists function has been renamed to os.exists to show that the function checks for the existence of files and directories. The old function name (os.fexists) can still be used via an alias automatically loaded at startup of Agena via library.agn.
· The biniolib.c C source file has been renamed to binio.c.
· The manual did not mention that for/in loops can also work on iterator functions. This has been changed. Also Chapters 4.9 (Tables) and 4.10 (Sets) have been revised.
· The readme.os2 file has been updated with correct instructions regarding additions to config.sys.
· The attrib function sometimes did not correctly determine whether a table array contained holes. Thus printing table arrays containing holes sometimes produced wrong output, i.e. the keys where not printed at the console. This has been fixed.
· If you set _EnvLongTable to true, then Agena did not print an empty line above the next prompt. This has been fixed.
September 5th, 2009· The number of bytes to be read by binio.readbytes can only be given by the environment variable _EnvBufferSize. This has been fixed - the user can now specify the number of bytes to be read with the optional second argument.
· os.chdir, os.rename, os.rmdir, os.remove, and os.mkdir issued wrong returns but did their job correctly: in case of a failure, the functions returned true instead of fail. In some other cases - depending on the operating systems - it returned fail even if there were no errors. This has been fixed.
· The os.rename function has been renamed to os.move to intuitively show that the function can rename a file and also move it to a new location on the file system. The old function name (os.rename) can still be used via an alias automatically loaded at startup of Agena via library.agn.
· The os.fstat function now also determines file and directory permissions (read, write, execute rights). In case of an error, the function returns fail instead of an empty table.
· The os.fcopy function now also sets the file permissions of the original file to the new file.
· A WarpIn installer is now provided for the OS/2 distribution.
July 20th, 2009· Added the `binio.readbytes` and `binio.writebytes` functions which read and write a sequence of bytes, respectively. Both functions are much faster than `binio.readchar` and `binio.writechar` when working on a larger number of bytes.
· Added the `os.fcopy` function which copies files. It has been implemented in C to ensure maximum performance. The user has some control by changing the internal buffer size with the new environment variable _EnvBufferSize.
· For simplicity, the enviroment variable `_EnvAgenaPath` has been renamed `libname`.
· The enviroment variable _EnvPrintNewLineAfterInput has been renamed _EnvPrintEmpyLine, because the former name was somehow confusing.
· Added the environment variable _EnvBufferSize which contains the default number of bytes for file operations (used in os.fcopy, for example).
· `os.md` has been renamed to `os.mkdir`, `os.rd` to `os.rmdir`, `os.rm` to `os.remove`, `os.cd` to `os.chdir`, `os.ls` to `os.list`, `os.pwd` to `os.curdir` and `os.lscore` to `os.listcore`. For backward compatibility, aliases have been added to the library.agn file so that the old names can still be used.
· The `isnull` operator finally has been deleted. Use the `unassigned` operator instead.
· The `bottom` and `top` keywords have been deleted. They have been substituted by `left` and `right`, respectively. Thus, now use `pop left from ...` instead of `pop bottom from ...`, and `pop right from ...` instead of `pop top from ...`.
· The `getbottom` and `gettop` operators have been deleted. They have been substituted by the `left` and `right` operators, respectively.
· Some few optimizations to the C source code.
· Added updated nedit.rc scheme for the nedit text editor to the Solaris installer.
· The agena.ini is no longer shipped with the installers to prevent overwriting your own personal agena.ini file when updating Agena to a new release. Instead, the agena.ini.sample file is distributed which you may rename to agena.ini to play with the initialisation feature.
· Tuned `tables.bisEqual`, `tables.bminus`, `tables.bintersect` and `tables.duplicates` by not deeply copying its arguments if they do not need to be sorted internally.
· Tuned tables.duplicates by 8 %.
· File and directory names returned by os.ls are now sorted. Also, the * magic character is now interpreted correctly (one or more repetitions). os.ls now recognizes the ? magic character in file names (exactly one character of any type).
July 20th, 2009· io.write and io.writeline sometimes crashed Agena if called without arguments within procedures. This has been fixed.
· If a structure (table, set, sequence, or pair) contained another structure with a circular reference, then Agena issued an error when printing the contents of the structure with print because of stack overflows. This has been fixed.
· If _EnvLongTable is true then when printing _G, the last but one and the last entry were printed on the very same line. This has been fixed.
July 20th, 2009· Settled problems with stack overflows when printing self-referencing structures on the console.
· The iolib package now provides the __tostring metamethod to properly print file handles returned by io.open (file(xyz) instead of userdata(xyz)). The __gc metamethod has also been added to the iolib package.
· tables.bisEqual, tables.bminus, and tables.bintersect now do not modify their arguments in case they need to be sorted internally.
· Included Lua 5.1.4 bug fix #3: Wrong code generation for some particular boolean expressions.
· Example: print(((1 or false) and true) or false) # --> 1, but should be 'true'. This has been fixed.
· Included Lua 5.1.4 bug fix #4: luaV_settable may invalidate a reference to a table and try to reuse it. This has been fixed.
July 20th, 2009· for/in iteration over strings is now up to 10 % faster.
· for/in now returns a proper error message if the object to be iterated is not a structure or a procedure.
· Tweaked for/in iteration over sequences a little bit (max. 1.5 % faster).
· os.ls now supports jokers within paths. Thus you may select subsets of files in a directory, e.g. "os.ls('*.c')" to select all files with suffix '.c'.
· All dump/undump functions inherited from Lua were deleted. Thus, strings.dump is no longer available.
· binio.open no longer evaluates the _EnvVerbose setting and thus ignores it.
· Removed support for an experimental second ADS sequence type from the ads package.
· Removed the following unused C API function: agn_isutype.
· Optimized internal type check for remember table value insertion.
· Optimized internal type check in set comparisons (=, subset, xsubset).
· If the pop statement encountered an error, a wrong line number has been displayed. This has been fixed.
· The pop statement could sometimes not be used within procedures. This has been fixed.
July 20th, 2009· Introduced the new unassigned operator that will replace isnull in the future. It is advised that you exclusively use unassigned in your code. This is a language consistency measure. The isnull operator will be deprecated.
Added facilities for stack programming. They exclusively operate on sequences:
· The pop bottom from statement deletes the entry with the smallest key (actually key 1), thus popping the first entry from the stack and shifting all other elements down.
· The pop top from statement deletes the entry with the greatest key, thus popping the top entry from the stack.
· The getbottom operator returns the entry with the smallest key in a sequence, thus returning the entry on the bottom of the stack.
· The gettop operator returns the entry with the greatest key in a sequence, thus returning the entry on the top of the stack. (With the already existing insert/into statement you can put a value on top of a stack.)
Agena now provides a means to read user-specific initialisation, standard library and package files from different locations. The environment variable _EnvAgenaPath can now contain one or more paths separated by semicolons, e.g. 'd:/agena/lib;c:programmeagenalib'. Agena searches all paths in _EnvAgenaPath at initialisation or when invoking a new package:
· The way Agena reads the library.agn and agena.ini files at initialisation and in case of a restart has changed: Agena searches all paths in _EnvAgenaPath from the left to the right for the above mentioned files. If it finds one and can execute it successfully, then all paths left in _EnvAgenaPath are skipped for the processed file.
· The readlib and with functions search all paths in _EnvAgenaPath from the left to the right for the package files. If a package could be loaded successfully, then all paths left in _EnvAgenaPath are skipped. readlib continues with finding and loading other packages, if their names are given to the function as optional arguments.
· readlib no longer accepts full filenames as input, e.g. `/usr/agena/lib/calc.agn'. Use run instead.
· If a package exists of both a C DLL/SO file and an Agena text file, then readlib and with now expect them to be stored in the very same folder; otherwise, a package may only be partially initialised. This behaviour has been introduced to avoid confusion.
· The Windows version now has a further fallback if it cannot find the system environment variable AGENAPATH during initialisation: It searches for the Agena main library folder by querying the Windows `ProgramFiles` system environment variable, and tries to set _EnvAgenaPath to it if the user has read access permissions. In UNIX, _EnvAgenaPath now is set to /usr/agena/lib only if the user has read permissions for this folder.
· If _EnvAgenaPath could not be determined at startup, Agena now enters into interactive mode instead of just quitting. A proper help text is displayed to help the user with reconfiguration.
· The facility to read a configuration file at startup by querying the "LUA_INIT" system environment variable has been removed, as in most cases you would have problems if Lua is installed on your system and the variable is set to be used by Lua.
· The new C API function agn_tostring converts a stack value to a value of C type const char*.
· Fixed a bug that reset _EnvAgenaPath when running restart.
· binio.open and ads.openbase now issue a proper error message if the user does not have the proper rights for files that already exist.
· io.fexists now only returns true if the file exists and the user has at least read permissions for this file.
· Updated scheme files for Proton and Nedit.