TXR Changelog

New in version 109

June 23rd, 2015
  • Features:
  • New anaphoric macros ifa and conda.
  • New function have, synonym of true. Usefully expressive with anaphoric ifa.
  • Bugs:
  • equal-based hashing function is improved so list and vector permutations do not collide to the same value.
  • cat-str function detects overflow in the calculation of the total string length to allocate, and throws an exception.
  • Fixed neglected null termination in mkstring function.
  • Fixed garbage collector crash introduced in TXR 108, when traversing syntax_tree member of the parser_t structure.

New in version 108 (June 15th, 2015)

  • Features:
  • POSIX poll function exposed.
  • Entirely new macro-based framework for syntactic places (forms denoting locations that can be assigned): better featured, extensible than previous hard-coded hacks.
  • New macro: define-modify-macro.
  • New pset operator: assign to places in parallel.
  • rplaca and rplacd handle vectors and strings.
  • replacement sequence in replace function can now be a vector.
  • symbol-value retrieves bindings of symbol macros.
  • boundp returns true for symbol macros.
  • New functions: makeunbound and fmakunbound.
  • New concept: deletable places: locations that can not only be accessed, but which can be deleted. Existing del operator which contained special case hacks is now powerful, general macro that can delete any deletable place.
  • New defparm operator to accompany defvar.
  • symbol-function, symbol-value and fun forms are assignable places.
  • Debug instrumentation code made light weight, leading to big improvement in the execution speed of TXR Lisp.
  • New functions catenated-stream-p and catenated-stream-push.
  • Bugs:
  • Fixed exception being thrown when trying to print (lambda . atom).
  • Dangling unquotes and splices now receive source location info.
  • Fixed memory corruption caused by disabling garbage collection for too long.
  • Better syntax checking in flet, labels, lambda, defun, quote.
  • Addressed clash between flip operator and flip function by renaming latter to flipargs.
  • Fixed regression in Verison 106 causing apply calls not to diagnose the too many arguments case, and allow a stack overrun.
  • chr-str-set checks for literal strings, which cannot be modified.
  • Fixed runaway recursion in keep-if* and remove-if*.
  • Fixed mismanagement of dyn_env variable leading to spurious retention of memory in TXR builds configured without debugger support. (Bug exposed by the lighter weight debug support.)
  • Critical bugfix in handling of hashes having both weak keys and values, leading to memory corruption.
  • New function: load for loading TXR Lisp files. TXR Lisp programming can now take place using multiple files containing code that doesn't have to be wrapped with @(do ...).
  • @(load) and @(include) directives can also load TXR Lisp now.
  • TXR files which have a .txr suffix can be invoked without the suffix now; this is automatically resolved.
  • New --lisp command line option makes TXR source files which have no filename suffix be treated as TXR Lisp code rather than TXR Pattern Language.

New in version 107 (April 26th, 2015)

  • Features:
  • Change in representation of promise objects. The force function now detects recursion and throws an error.
  • New mlet macro: a step beyond Scheme's letrec.
  • A trivial optimization in the keywordp function more than doubles the interpretation speed of TXR Lisp.
  • Bugs:
  • Fixed regression in the garbage collector introduced in October 2014, TXR 100. This would cause runaway memory growth, due to the garbage collector creating unnecessary new heaps.

New in version 104 (February 9th, 2015)

  • Features:
  • Symbol macros are now shadowed by lexically scoped functions, when referenced from the interior of a form which uses Lisp-1 semantics (a [] bracketed form, a form based on the op family of operators, or explicit use of the dwim operator).
  • New function, abort.
  • TXR now doesn't terminate abnormally (abort) on unhandled exceptions, but only terminates unsuccessfully. This provides a better experience on the MinGW-based Windows target, where we get an annoying dialog box on abort.
  • New *uhandled-hook* variable can be used to register a user-defined function which is called when an unhandled exception occurs.
  • New arithmetic function, trunc-rem.
  • When the numbered arguments of partial application under the op family of operators are interpolated into a string quasiliteral, modifiers may now be applied. For instance (op prinl `@{1 20} @{2 20}`) denotes a function which prints its two arguments in twenty-character-wide fields separated by a space.
  • Improvements in Windows installer: reduced broadcast delay in registerting environment variable. Improved messages in this area.
  • A txr-win.exe can be built now which avoids creating a console window. This is included in the installer.
  • Bugs:
  • Fixed bug in quasiliteral string evaluation in TXR Lisp, in conjunction with op arguments like @1, @2, ... When a value interpolated from one of these arguments looked like a form, it was mistakenly subject to recursive processing and variable substitution as if it were part of the quasiliteral target syntax.
  • Fixed a serious bug in the op macro and all related operators like do and ap, in the handling of situations with missing argument numbers was broken: such as when @3 is referenced, but not @1 or @2 (which must generate a function of at least three arguments, which ignores its first two). This key feature was discovered to be utterly broken.
  • Fix in internal representation of exceptions: (throw 'x "foo") is now the same as (throwf x "foo").

New in version 100 (December 19th, 2014)

  • Features:
  • New functions: chr-isblank and chr-isunisp
  • New generic less and greater functions, which are also used as default functions in sort, find-max, max-pos, and others.
  • New directives @(line) and @(chr) for binding or asserting the current line number or character position.
  • Lisp expressions allowed on left side of @(bind) and @(rebind) now.
  • New function lcm (lowest common multiple).
  • The gcd function now takes zero or more arguments instead of exactly two.
  • New @(include) for parse-time loading of code, useful for loading macros which are needed later in the same file.
  • Beginning of library external to TXR executable: macros txr-if, txr-when and txr-bind for more convenient access back into the pattern language from TXR Lisp.
  • New combinator function notf for negating a function.
  • Bugs:
  • Fixed December 2011 regression affecting @(freeform) directive.
  • Fixed GC-safety bug in abs-path-p function.
  • Fixed breakage in scanner and parser introduced in August. Caught by C++ compiler.
  • Fixed inappropriate printed rendering of list objects produced by interpolated TXR Lisp expressions in @(output) blocks, and in the quasiliterals of the pattern language. (TXR Lisp quasiliterals not affected.) Users who depend on the old behavior not wanting to fix their programs can use --compat 99.
  • Bugfix in the gcd and lognot functions: neglecting to normalize some bignum result to the fixnum type.
  • Bugfix in @(eof) directive: not matching the end of interactive streams.
  • Fixed abort due to assertion going off when GC is disabled and the array of new generation objects runs out of space. This could happen during large parses.
  • Fixed parser stack overflow and inefficiencies when handling large TXR programs.
  • Bugfix in match_fun causing memory accesses to automatic storage that has been released, as well as an invalid longjmp.
  • Hash table reorganization is prevented during hash table traversal, so existing items are not skipped or visited twice.

New in version 99 (October 7th, 2014)

  • Features:
  • Variables in the pattern language can be bound to regexes, in which case they perform regex matches when matched against input.
  • Representation for compiled regexes is streamlined.
  • Regex objects now print in regex notation.
  • Bugs:
  • Fixed August 11 regression affecting 96 through 98: broken matching of unbound variables followed by bound variables.
  • Fixed one more problem with andf function: (andf) not returning t.

New in version 97 (September 11th, 2014)

  • A few GC-related fixes after code review.
  • Fixed @(load), broken in TXR 94.
  • Fixed broken @{var mod} syntax Lisp quasiliterals, broken in TXR 96.

New in version 80 (February 18th, 2014)

  • Features:
  • TXR now nicely handles null characters in text stream inputs. They are internally encoded to the Unicode value U+DC00, which will map back to a single null byte on output (that being existing behavior).
  • TXR now has Lisp macros: the defmacro operator is implemented, with destructuring lambda lists and all.
  • New operators tree-bind and tree-case for pattern binding similar to Common Lisp's destructuring. This piggybacks off the defmacro infrastructure which we now have.
  • Big improvement in debuggability: the unhandled exception error message now gives source code location information.
  • New functions pos, pos-if, posq, posql and posqual for finding item positions in sequences.
  • Predicate function is now optional in the some, all and none functions.
  • hash-uni and hash-isec functions take a join-func argument which lets you specify how elements from two tables are merged.
  • new hash table functions inhash and hash-update-1.
  • two hashes can now be tested for deep equality using equal.
  • Bugs:
  • Removed bogus optimization from hash table implementation.
  • Syntactic fix: input like 1.0a no longer parses as a floating-point number followed by a symbol, but is diagnosed as an error. Syntax like 123a continues to work as before: it denotes one symbol, not 123 followed by a.
  • Bugfix in type check for "cobj" class objects that would crash if given non-heaped values like fixnum integers.
  • Corrected problems in the code walking and expansion of lambda and defun forms.
  • Fixed failure to propagate line number info through the abstract syntax of string quasiliterals.
  • Doc bugs: missing descriptions of gethash and gensym.

New in version 79 (February 13th, 2014)

  • Features:
  • New functions comb, perm, rcomp and rperm for calculating repeating and non-repeating combinations and permuations of sequences (lists, vectors and strings). Hashes are supported by comb function.
  • Bugs:
  • Hardening of code for handling excessively large vectors.
  • Bugfix in quasistring handling in TXR Lisp.
  • Bugfix in if function (not the if operator).

New in version 78 (February 6th, 2014)

  • Improvements in the apply function, reduce-left, and reduce-right, and improved design and implementation of optional arguments.
  • Lists, vectors, and strings are now generally function-callable, not only under the dwim operator. Some new functions were added.
  • Bugs in the do operator were fixed along with some other problems.

New in version 77 (January 30th, 2014)

  • Features:
  • More streamlined parser containing fewer hacks, and fewer obscure cases that don't work.
  • @'expr syntax now works as expected in directives for evaluating quoted TXR Lisp expressions.
  • In nested uses of the do and op operators in TXR Lisp there is now a way to refer to the outer parameters from the inner nestings, using compounded meta syntax like (op (op @1 @@1)), where @1 is argument 1 of the function denoted by the inner op, and @@1 is argument 1 of the outer function. Each additional @ "escapes" out one level of nesting of the op syntax.
  • New update and hash-update functions.
  • The interfaces of reduce-left and reduce-right functions has been improved, making them easier to use, while mostly retaining backward compatibility.
  • New functions remove-path and rename-path for removing and renaming filesystem objects.
  • Catenated streams, previously an internal feature, are exposed now via the make-catenated-stream function.
  • Scope rule change for expressions that provide default intialization for optional arguments. These eexpressions now have the parameters in scope, and so now uses like (lambda (x : (y (length x))) ...) are possible where y is initialized with (length x) if the argument is not supplied. Previously, parameter x would not have been considered to be in scope of the expression (length x).
  • Bugs:
  • Fixed neglected handling of result form in dohash syntax.
  • In the object printer, the handling of syntax like @(sys:var x ...) was ignoring any additional ... forms, and rendering as @x.
  • Fixed possible race condition in tail streams, whereby when a file rotates, the stream prematurely follows the new file, neglecting to read the last piece of material just added to the previous file.

New in version 76 (January 24th, 2014)

  • Features:
  • New time functions: time-fields-local and time-fields-utc for obtaining broken-down time from Epoch seconds.
  • New group-by function for constructing a hash from a list when the list elements can be partitioned into equivalence classes tied to keys, rather than treated individually.
  • Sweeping changes in TXR List to allow vectors and strings to be manipulated in many situations as if they were lists. Functions like car, cdr and mapcar work on strings and vectors.
  • New command line options -e and -p for evaluating TXR Lisp expressions more conveniently from the command line.
  • The and, or and if special operators are now also provided as functions, so they can be indirected upon functionally.
  • New functions conses and conses*, useful for iterating over a list similarly to Common Lisp's maplist function.
  • New do operator (unrelated to @(do) directive) similar to op, but geared toward doing imperative things involving special operators.
  • Bugs:
  • @(require ...) directive was not expanding its forms prior to evaluation.

New in version 75 (January 17th, 2014)

  • Features:
  • Two new stream functions: unget-char and unget-byte. Some streams now support ungetting a byte or character, which was a glaring omission in the API, without which some common scanning tasks are awkward.
  • TXR Lisp functions with optional parameters can now specify expressions to give those arguments values when the arguments are missing.
  • New operators in TXR Lisp: append-each and append-each*.
  • Change in the Lisp structure printer. The special structure generated by the read syntax @sym and @(...) now prints back in the same syntax, rather than as (sys:var sym) and (sys:expr ...).
  • Bugs:
  • Fix in put-byte function: before invoking the underlying operation, it was testing whether the put-char operation exists for the stream, rather than the put-byte operation. This would result in a crash if the stream supports put-char but not put-byte.
  • Mistake in calculating bitmasks for regex character class ranges, resulting in incorrect behavior for ranges whose upper range is a character code corresponding to the last bit of a word in the bitmask array, e.g. [A-\x7f], resulting in failures to match 32 or more characters in the upper end of the range.
  • Missing documentation filled in for the functions throw, throwf and error.

New in version 74 (January 14th, 2014)

  • Features:
  • Maintenance: builds on Cygwin, MinGW and Mac OS X 10.7.3.
  • New math functions: n-choose-k, n-perm-k, cum-norm-dist.
  • lisp-parse function renamed read; old name is obsolescent.
  • In the TXR pattern language, the @ escape can now evaluate a non-compound TXR Lisp expression also. Previously compounds like @(+ 1 1) were supported, but atoms like @foo were not.
  • Bugs:
  • Small fix in how exponent fields of printed floating point values are normalized. Across all platforms, there are now no leading zeros after the 'e'.

New in version 73 (January 9th, 2014)

  • Features:
  • The new lisp-parse function scans TXR Lisp expressions at run-time out of strings and streams, which means that TXR can now more easily keep persistent, complex data in text files.
  • Bugs:
  • Fixed signal-handling-related performance issue caused by excessive calls to the sigprocmask function.

New in version 72 (December 19th, 2013)

  • Features:
  • Syslog functionality: openlog, closelog, syslog, setlogmask. Plus: the *stdlog* stream for logging directly to syslog.
  • Stream properties.
  • logand and logior functions become variadic.
  • Signal handling support. TXR Lisp code can catch POSIX signals.
  • Syntax changes in the area of symbol names. Package prefixes are supported now, like foo:bar (symbol bar in package foo).
  • Bugs:
  • Nonsensical error diagnostics in intern and delete-package, in the case when a package doesn't exist.
  • defvar is documented now and behaves more similarly to the Common Lisp defvar.
  • seek-stream with a zero offset was reporting the current offset instead of seeking regardless of the value of the whence argument.

New in version 67 (July 15th, 2013)

  • This minor maintenance release adds some new functions and a new directive.

New in version 66 (May 18th, 2013)

  • This version adds many new features, bugfixes, and completion of the reference manual.

New in version 65 (April 21st, 2012)

  • This version has been ported to OS X, FreeBSD, and NetBSD, supports a few popular regex tokens, exposes the regex compiler as a function (allowing programs to build and use regular expression syntax trees), provides new ways of iterating over hash tables with lazy lists, adds some time functions, improves seeding of PRNG, and fixes a bug related to argument processing in @(next) directive.

New in version 62 (March 24th, 2012)

  • Floating point support has been introduced, allowing TXR to be more suitable for scientific data munging, making this a major milestone.
  • Some new functional combinators have been added.
  • There is a small refinement in URL/percent encoding/decoding.
  • A showstopper bug in recently introduced quicksort routine has been repaired, affecting vector/string sorting.

New in version 059 (February 29th, 2012)

  • This is a bugfix release.

New in version 058 (February 26th, 2012)

  • TXR programs can now be split into modules.
  • Embedded TXR Lisp can now call back into the pattern language.
  • Exception handling is now exposed in TXR Lisp.
  • Optional arguments are supported in TXR Lisp functions.
  • The braced variable substitution syntax in output has been extended to do arbitrary expressions, and its indexing notation is now generic over vectors and strings.
  • More generic sequence functions have been added to the library, including a generic sort.
  • There's a new del operator for deleting sequence elements/ranges and hash elements denoted by the bracket syntax.

New in version 057 (February 14th, 2012)

  • "Freeform" scanning (treating an arbitrarily sized remainder of the input as one big string) is now possible in constant memory.
  • Bugs in hex and octal character constants, the format function, and printing of string objects were fixed.

New in version 056 (February 6th, 2012)

  • This version fixes incorrect UTF-8 decoding of a valid character range, and closes security issues related to UTF-8 decoding and re-encoding.
  • A regression that broke computed field widths in release 55 is fixed.
  • Hex and octal escapes in string literals and quasiliterals are now recognized like the documentation says.
  • The [...] notation now has evaluation semantics for symbolic arguments which are like Lisp-1.
  • An operator called op has been introduced for writing simple lambdas with a currying syntax with numbered and implicit arguments.

New in version 055 (January 30th, 2012)

  • This version introduces a new square bracket syntax that performs an intuitive operation based on the type of the first object.
  • It provides Lisp-1 style calls for functions (no call operator) and array indexing and slicing for lists, vectors, strings, and hashes.
  • Indexed elements and slices are assignable.
  • Indexing and slicing can be used in the output template language and in string quasiliterals.

New in version 054 (January 23rd, 2012)

  • The main improvement in this release relates to the debugger.
  • It is now possible to step into, over, or out of expressions, and see a complete environment and backtraces.
  • A lazy version of "append" has been added to the embedded Lisp.

New in version 053 (January 12th, 2012)

  • New functions and operators were included in the Lisp dialect for lazy list processing and parallel iteration.
  • Variable substitutions in output and quasiliterals can have computed field widths.
  • A showstopper bug in the evaluation of built-in global variables was fixed.

New in version 052 (January 8th, 2012)

  • This version adds a new fuzz directive for imperfect matches over a range of lines, similar to the context line fuzz in the patch utility.
  • The gather directive has been extended with an optional until/last clause to limit its range.
  • New mod and modlast directives in repeat/rep specify alternative output when the repeat count is equal to some n modulo m.
  • repeat/rep take an argument which nominates a variable which holds the repeat count.
  • A gensym function has been added to TXR Lisp.
  • Bugfixes have been made.

New in version 051 (December 29th, 2011)

  • This version fixed several bugs, including a showstopper in bignum integers on 32-bit platforms.
  • There are improvements in the areas of pseudo-random number generation and lazy list processing.

New in version 050 (December 24th, 2011)

  • This version contains several critical bugfixes.
  • There is some new functionality, including a new API for pseudo-random-number generation.
  • More documentation has been written.

New in version 049 (December 20th, 2011)

  • First cut at horizontal match functions.

New in version 048 (December 15th, 2011)

  • This version fixes portability bugs in the MPI library leading to incorrect bignum results and crashes.
  • It adds new functions: expt, exptmod, sqrt, numberp, evenp, oddp, abs, gcd, reduce-left, and reduce-right.

New in version 047 (December 13th, 2011)

  • Bignum arithmetic is now integrated into the language.
  • Overflow in word-sized (fixnum) integers transparently produces bignums.
  • Functions have been added in Lisp dialect for character manipulation, vectors, and association lists.
  • New special operators have been added: progn and flip.
  • An implicit named block in defun bodies, and an implicit anonymous block in for loops.
  • Minor bugfixes.

New in version 045 (December 6th, 2011)

  • This version adds many new functions in Lisp dialect, and bugfixes.

New in version 042 (November 21st, 2011)

  • TXR can now parse grammars, thanks to horizontal functions.
  • A breakpoint/step debugger has been added.
  • There are new ways of capturing text into variables, bugfixes (including ones affecting stability), and a Vim syntax highlighting file.

New in version 040 (October 21st, 2011)

  • A small semantics change.
  • An important GC bugfix affecting some platforms.
  • Refactored for better performance and maintainability.
  • Native (non-Cygwin) Win32 port.

New in version 039 (October 11th, 2011)

  • Ported to Cygwin.
  • Important bugfixes.
  • A number of new features.

New in version 037 (September 27th, 2011)

  • A filtering syntax for variable substitutions, user-defined filters, minor semantic tweaks, and bugfixes.

New in version 035 (October 6th, 2010)

  • Fixed the gc-related bug and a regression bug in basic query logic.

New in version 033 (January 27th, 2010)

  • Since version 028, there has have been a few GC fixes, a bunch of regex work. Check it out!

New in version 019 (October 22nd, 2009)

  • There is a new freeform directive for unstructured matching across multiple lines.
  • Variables can be bound to regexes and used for matching.

New in version 018 (October 19th, 2009)

  • Important bugfixes were made.
  • The @(skip) directive was discovered not to be yielding the correct line past the material that was matched, allowing subsequent query forms to go over the same material.
  • A regression in @(collect) was found: looping infinitely in the case that the collect body succeeds without matching anything (and yields the same match position); it now moves by one line in that situation.

New in version 017 (October 19th, 2009)

  • A bug in exception subtype definition (defex) was fixed.
  • A tail recursion optimization was done in the garbage collector.
  • The -f option was added for specifying a query file, allowing more options to follow.
  • More documentation on exceptions was written.

New in version 016 (October 19th, 2009)

  • A throw directive for user exceptions and user-defined hierarchical exception types (subtype-supertype exceptions).
  • Catch clauses can now have parameters, and throw passes arguments to catch.
  • The -f command line option was renamed to -c.

New in version 014 (October 5th, 2009)

  • Queries can now define functions.
  • Functions can nest and recurse.
  • Definitions have dynamic scope.
  • A new "cases" directive has been added, which is like "some" but with short-circuiting semantics. This is useful for controlling function recursions.
  • String literals have been added to the syntax.
  • Arguments in function calls can be string literals.
  • There are some small bugfixes.

New in version 013 (October 1st, 2009)

  • Some minor garbage collection issues fixed.
  • Infinite looping bug fixed.
  • New @(trailer) directive.
  • extract.y (match_files): Implemented trailer directive.
  • extract.l (version): Bump to 013.
  • lib.h (trailer): Declaration added.
  • lib.c (trailer): External definition added.
  • (obj_init): Initializer trailer with interned symbol.
  • txr.1: Documented @(trailer) and bumped version to 013.