TXR 257 2021-04-22 Features - parser: - Invalid UTF-8 bytes and characters now allowed in literals and regexes. - Treated using rules consistent with behavior of text streams. - doc: - General improvements in documentation, many due to of Paul A. Patience. - build: - Test suite no longer requires .expected files which are empty; they materialize on-the-fly and make cleans them away afterward. - streams: - stream-max-len behavior changes for strings. Some small bugs fixed in this area. - structural pattern matching - new @(scan) operator for finding a match over a list - new defmatch macro for defining new pattern operators - new pattern operators @(end) and @(sme) defined using defmatch - TXR: - Debug output for @(gather) directive reports exact list of variables that were not bound. - compile/eval: - compile-error macro now prints error on *stdout* in addition to throwing exception. - upshot of this is that this helps editors navigate to the error. - previously this worked for warnings, not errors. - new binding operator: mac-env-param-bind - port status: - TXR ported to OpenBSD, amd64. - internal: - New C function dis that can be used debugging TXR with gdb to disassemble VM code. Bugs: - compiler: - (call (fun f) ...) forms not registering the reference to f, causing lambdas to be incorrectly lifted to a scope where they lose access to a needed lexical function. - incorrect handling of trailing arguments in immediately-called lambda. - bad diagnostic in compile-file when output file can't be opened. - constant-folded (call ...) expressions not quoted. - bug in dead code elimination (optimization level 6) causing references to nonexistent assembly language labels. - bug in frame elimination (optimization level 2) not initializing some registers in code that can execute more than once due to loops. - GC: - Bug in sys:gc function fixed, whereby it wrongly resets the internal flag which requests a full collection, leading to corruption (since that flag is sometimes set for reasons of correctness). - regex: - The regsub function was found to have destructive behavior, contrary to documentation. - lib: - fixed a bug causing the functions base-name, dir-name and TXR's sysrooting calculations to be wrong on platforms where sizeof(wchar_t) is 2 (Windows/Cygwin) and on MacOS. - fixed the bogus assumption in the code, introduced in 2015, that there are platforms with four-byte wchar_t which don't align L"..." literals to four byte boundaries, and that MacOS is one of them. - continuations: - fix stack alignment on amd64 under clang. - discovered during OpenBSD port, but not an OpenBSD problem. - build: - make referenced in a few places instead of $make, causing some nuisance error messages on platform where GNU Make is gmake. TXR 256 2021-04-07 Features - Compiler: - Compiler now checks number of arguments in a function call against its definition. - Doc: - numerous improvements in the manual, especially HTML output. - New library function doc for documentation lookup: - (doc) -> open manual with default browswer - (doc 'cons) -> open manual to specific symbol - INSTALL document maintained. - Awk: - :name argument not restricted to symbol, but any valid object usable as a block name. Bugs - Compiler: - fixed incorrect constant folding of call function. - some instances of misleading diagnostic wording fixed. - fixed regression in source location info propagation - causing errors not to have location information in some cases - caused by recent optimization work. - OOP: - fixed lack of hygiene in qref operator with regard to a.?b syntax, causing mutiple evaluations of a. - GC: - fixed bug in weak hash processing dating back to the initial weak hash implementation in 2009. - Awk: - The value of the rs (record separator) variable being wrongly compiled as regex syntax even if it is a string object that must be a fixed pattern. - Lib: - bug in UTF-8 decoding function - affecting situations when buffered bytes are decoded as utf-8 (I/O streams not effected). - incorrect behavior when invalid bytes are present; valid UTF-8 not affected. - func-optparam-count: function was returning bogus value for interpreted functions. TXR 255 2021-03-26 Features - TXR has been ported to Arm64 Mac OS Darwin (Apple M1). - lib: - argument to cat-str treated via sequence iteration for better efficiency on non-lists. - likewise for the poll-list argument in poll. - compiler: - optimization improvements - The VM's T registers can now be used for function arguments, promoting further optimizations, and eliminating the need to allocate a variable frame for arguments. - several other optimization improvements. - code improvements in compiler. - FFI: - float type used as variadic argument in deffi and deffi-cb now promoted to double, preventing a programmer pitfall. - VM: - execution of VM code is now interruptible by signals, most notably the SIGINT generated by Ctrl-C. - this is done in a way that shows vanishingly low overhead. Bugs - ffi: fixed missing support for retrieving ushort type from misaligned buffer - tests: - on Mac OS, the socket-basic.tl test passes on the stock OS configuration, not requiring limit on UDP datagram size to be relaxed via sysctl. - make -j retest now works reliably via a recursive invocation. TXR 254 2021-03-10 Features: - compiler: - elimination of function calls that produce unused values. - this compiles down to just "nil": (let ((x (cons y z))) (set x (cons u v)) (set x nil) x))) - elimination of unused accesses to globals - elimination of unused lambdas. - optimization control: new variable *opt-level*, valued 0-6. - lib: - new functions join and join-with to complement the tired old cat-str for joining strings and characters. - (join-with ":" "a" "b" "c") -> "a:b:c" - (join "a" "b" "c") -> "abc" Bugs: - broken sort function over vectors and strings - failing to return the sorted object TXR 253 2021-03-06 Features: - build: - parallel builds allowed with ./configure --parallelmake - after above, make -j is supported. - recommended for development, not distro builds. - compiler: - new optimizations - order of optimization passes rearranged - new peephole patterns. - Pattern-matching Ackermann 48 times faster than interpreted - functional combinator expressions are now automatically hoisted to load time. - E.g. [chain .foo car list] is now computed once when the code is loaded, and then referenced. Bugs: - compiler: - mistake in (if (equal ...) ...) pattern corrected, allowing corresponding reduction to take place. - fixed bug in frame depth calculation when load-time forms are involved. - fixed bug causing redundant dead code to be added to load-time. - hashing: - fixed bug causing hash-equal to produce zero for floats and bignums - equal-based hash tables using bignums or floats as keys are affected. TXR 252 2021-02-28 Features: - compiler: - new optimizations introduced: - elimination of frames for non-captured lexical variables - elimination of blocks in self-recursive functions - more compact frame size for closures - strength reduction of equal (helps pattern matching) - list construction optimization: - e.g. (cons 1 (cons 2 3)) -> (list* 1 2 3) and more - other algebraic reductions. - aggressive constant-folding of over 300 library functions. - new control-flow and data-flow analysis: - removal of dead registers - elimination of inefficiently used temporary registers - comprehensive dead code removal - structural pattern matching - internal code cleanup, improvements and improved diagnostics for hash patterns. - syntax: - obj.[fun ...] syntax changes meaning; it is now method dispatch. - obj.[method ...] is to [fun ...] as obj.(method ...) is to (fun ....) - improved diagnosis of invalid dotted forms. - library: - list-builder methods now return the object, allowing chaining like (new list-builder).(add 3).(get) - vm: - backwards compatibility jump: TXR 251 generates version 6 object files (.tlo) and will not read older ones. - Some obsolescent instructions have been removed from the instruction set. - TXR Pattern Language: - function calls, including indirect calls via @(call ...) are now considered non-matching directives, thus not calling for the input source to be opened. Bugs: - math: - fixed out-of-bounds memory access in or and xor functions when the arguments are bignums. - build: - bug fixed: not dealing with spaces in configuration arguments when generating ./reconfigure script - printer: - obscure bug in printing lambda expressions fixed, triggering function lookup and expansion at print time. - compiler: - fixed internal error in compiler when compiling certain cases sys:switch forms generated in certain cases of caseq/caseql. - assignment to a function binding being internally marked as an a free variable reference by the compiler, rather than a free function reference. - incorrect compilation unwind-protect form when the protected form is trivial, like a literal constant. - TXR Pattern Language: - fixed broken implementation of @(call ...), in several independent aspects. TXR 251 2021-02-08 Features - structural pattern matching: - now allows back-referencing with existing variables outside of the pattern, greatly improving expressiveness. - new @(with) operator, allows match between side pattern and side object in parallel with main pattern and main object. - @(let) renamed to @(as). - clauses of @(and) now in same scope allowing back-referencing. - redesign of lambda-match, using special argument matching rather than a list pattern against the argument list. - functions based on pattern matching now perform much better - new :match parameter macro: - adds pattern matching to any function in any situation - supports mixture of regular arguments and pattern matching. - predicate pattern syntax and semantics redesigned. - predicates now have multiple arguments - variable can be inserted anywhere in a predicate call, including dot position - variable can be omitted, giving rise to the object being passed as the rightmost argument to the predicate call - @(op ...) pattern is removed: - not necessary due to improved predicate handling. - compiler: - new optimizations - error location reporting improved. Bugs - structural pattern matching - fixed bad hygiene in match-case due to not using gensym. - lib: - fixed crash in nullify and iterable, when argument is a C object that is not a struct. - fixed long-standing bug in multi-sort: when the list(s) are empty, it must return a list of empty lists, not nil. E.g. [multi-sort '(nil nil nil) less] now returns (nil nil nil) as documented, and not nil. TXR 250 2021-01-31 Features - structural pattern matching: - new @[...] predicate operator. - can capture object, as well as value of predicae - better code generation - compiler: - jump threading optimization - dead code removal - peephole optimizations Bugs - structural pattern matching: - numerous new test cases introduced showing various breakage, and fixed. - code substantially refactored - @(or ...) pattern handled in new way. - compiler: - fixed totally broken treatment of append-each operator - destructively catenating lists - not observing append semantics w.r.t. generic sequences. - sub-str: now subject to compatibility; -C 215 or lower restores the behavior of always copying the input string, even when sub-str covers the entire string. - lazy strings: instance of invalid substrucure sharing fixed in lazy-sub-str, causing incorrect behavior, showing up as strangeness in @(freeform) processing and anything else relying on lazy-sub-str. - fixed broken @(rebind) directive. - not removing variables from environment if left hand side is a pattern with multiple variables. - wrongly removing right hand side variable from environment. TXR 249 2021-01-24 Features: - structural pattern matching: - variables can now back-reference so that (@a @a) matches a two-element list whose items are equal. - @(some) and @(all) operators work with any sequences, not just lists. - New pattern-matching @(coll ...) operator for collecting from a sequence those objects which match. - New @(hash ...) operator for matching hash tables on keys, values or both. - Matching ranges using range objects is now supported, e.g. #R(@a @b) matches a range, and binds a and b to its from and to. - Trivial patterns (those containing no operators or variables) are now handled more efficiently. E.g. the pattern (1 2 3) or #(1 2 3) will just be tested using equal as an atom, rather than compiled into individual tests over the elements. - hashing: - hash-revget now uses equal equality for finding matching values in the hash table, rather than eql. Bugs: - structural pattern matching: - fixed order of evaluation problem in @(require) - iter-step: no longer traverses into terminators of improper lists, which caused situations like (each ((x '(1 2 . 3))) ...) to iterate indefinitely. - fixed a regression which caused carrayp, hashp, random-state-p, regexp and struct-type-p to indicate true as 1 instead of t. - internally, the way t is initialized when TXR starts up has also been improved as a result. - parser: - fixed badly designed low-precedence of the @ token: the one applied to expressions as in @(foo). - printer: - fixed the print/read ambiguity that both (rcons @a @b) and @(rcons a b) printed as @a..@b. - @(rcons ...) now prints as @(rcons ...) and never as the x..y notation, so only (rcons @a @b) prints as @a..@b. - we also know that only (rcons @(a) @(b)) prints as @(a)..@(b), and thanks to the parser fix mentioned above, @(a)..@(b) parses as (rcons @(a) @(b)). - places: - The function name call-delete-expander was wrongly in sys package, rather than the usr package, as documented. - Addressed runaway recursion in place expansion logic, causing, for instance the expansion of (let (a) (set a #1=(#1#))) to recurse infinitely. - manual: fixed wrong 2020 date. TXR 248 2021-01-20 Features: - hashing: - new hash-key-of function: get all keys that map to the specified value. Bugs: - compiler regression: incorrect reduction of (and ) forms to t instead of . TXR 247 2021-01-19 Features - lib: - structural pattern matching introduced. - prog2 macro introduced. - progn, prog1 and prog2 are now also functions. - build: - configure's test for how to define inline functions fixed. - hopefully this will fix things for Brew. - linker options and library flags are now separate; there is a new platform-ldlibs configure option. - LDLIBS variable is now honored, not just LDLIBS. - gc: - finalizers now registered during finalization processing may be called in the same phase, if they are eligible. Bugs - show-stopper regression in mapcar/maprod. TXR 246 2020-12-31 Features: - Library: - shuffle and nshuffle functions take optional random state argument now. Bugs: - gc: - bug in finalization leading to assertion in garbage collector. - affects situations in which finalizers are explcitly called, rather than naturally occurring during garbage collection. - flaw in object finalization logic causing unnecessary full generation to be requested. - awk: - fixed regression in fconv macro (probably dating back several years): - the conversion shortcuts like i, x, o, r became unavailable due to being sys: symbols rather than usr: symbols. TXR 245 2020-12-24 Features: - Android is now a supported target platform: builds in termux environment. - TXR executable builds as PIE, which is mandatory on Android. - test suite passes nevertheless: PIE-related has not been observed. - System Interface: - env-hash now returns the same hash object every time it is called, whose contents are updated by setenv, unsetenv and getenv. - Build: - C compiler now operated in C99 dialect, except in maintainer mode. Bugs: - math: bad edge-case in int-flo function affecting 64 bit systems. - time: do not offer a make-time-utc function if we have neither timegm nor setenv in the C library; we don't simulate setenv with putenv any more. - printer: don't print leading zeros in characters printed in hexadecimal. TXR 244 2020-10-10 Features: - Build: - Dropped dependency on Bison/Byacc and Flex: - TXR now ships the generated parser and scanner source. - The --maintainer option must be given to congfigure to enable regenerating these sources, otherwise the shipped ones are used. - Lib: - New trim-left and trim-right functions for removing a suffix. - Time-related functionality moved out of lib.c into a new time.c module. - New time-nsec function for nanosecond-precision time. - PRNG uses nanoseconds now in seeding, rather than microseconds. - Listener: - New quip function produces a randomly selected humorous line, suitable for printing out of the ~/.txr_profile startup file. - Compiler/VM: - movi family of instructions (move immediate operand into register) are deprecated and no longer used by the compiler. - It is cheaper to the integer or character operand in a D register already, since no instruction needs to be executed to get it into a register. - The downside is that code which uses a large number of small integer literals can now run out of D registers, whereas previously it woudl have not run into any limit. Bugs: - output-side @(repeat) was still not finding Lisp variables embedded in braced expansions. - fixed two defects in the implementation of the WELL512a pseudo-random-number generator. - compat option (-C 243 or lower) restores broken PRNG behavior for reproducibility of old PRNG sequences. - regression in two-or-more-sequence form of mapcar: it was not converting the output to the type of the leftmost sequence. TXR 243 2020-09-01 Features: - TXR: - output-side @(repeat) directive more intelligent: - now identifies variables referenced in Lisp code - many uses of :vars now unnecessary - variables identified in expansion pass now, before query execution - OOP: - diamond problem in multiple inheritance addressed. - duplicate inheritance bases no longer cause multiple calls to :init, :postinit and :fini handlers. - Lib: - new reject funtion, complements select. Bugs: - FFI: - several bugs addressed in the allocation of bitfields. - documentation of Bitfield Allocation Rules also updated. TXR 242 2020-08-14 Bugs - TXR: fix serious regression introduced in TXR 235, affecting correctness of behavior in multiple places. - listener: fix regression introduced in TXR 239, causing funny behavior when invoking Tab completion on keywords and qualified symbols. TXR 241 2020-08-08 Eleventh Anniversary Edition Features - MIPS (32 and 64 bit) is a a target platform now. - Lib: - New list-seq, ved-seq and str-seq functions. - New maprodo function: like maprod, but returns nil. - New each-prod, collect-each-prod and append-each-prod operators: - traverse cross product of the sequences rather than in parallel. - crc32 has initial crc argument, allowing multi-step crc32 calculation over multiple objects. - New iterable predicate function for detecting whether object is iterable. - Structs: - New iteration protocol - comes in two flavors, using either two or three methods. - System Interface: - New strerror and strsignal functions. - Argument of exit now optional, defaulting to success. - New opendir, readdir and closedir functions for lower-level directory traversal (complementing ftw and glob). - stat family of funtions can now fill an existing struct. - TXR: - @(if)/@(elif)/@(else)/@(end) syntax now supported in @(output). - @(if test then [else]) Lisp form still supported. - Listener: - new *-1, *-2, ..., *-20 macros for referencing prior values relatively. - Symbols: - packages can now be created weak. If a symbol is reachable only through a weak package, it can be garbage-collected. - FFI: - new cptr-get and cptr-out functions for accessing through a cptr. - Networking: - New address parsing functions inaddr-str and in6addr-str. - support for port number and / prefix notation. Bugs - listener: bogus permission complaint when .txr_history file missing. - structs: - static slot handling in autoload leading to spurious errors. - autoload on instance slots also to prevent spurious no such slot errors. - parser: - minor omission in syntax error diagnostic logic leading to internal token values being printed as if they were characters. - TXR: regression in vertical-horizontal fallback (see 7006ede9). - printer: bugs in printing uref and qref syntax. - parser: - fixed breakage on some platforms like newer Mac OS X due to Flex scanner containing an #include in the middle of lex.yy.c, after we have included our headers which define numerous macros. - eliminated calls to isatty from the lexer. - cygwin: - broken cat-str and split-str family of functions when using a character object as a separator. TXR 240 2020-06-06 Features - New iteration paradigm for sequences. - iter-begin function takes an iterable, returns an iterator. - iter-more tests whether iterator has more items. - iter-item gets first available item - iter-step takes an iterator, returns either new iterator, or the same iterator, mutated. - integrated into sequence processing functions. - works for sequences, as well as integers and ranges. - e.g. [mapcar list '(a b c) 1] -> ((a 1) (b 2) (c 3)) - each, collect-each, ... operators work with this paradigm. - mapcar, mappend, mapdo, maprod, maprend now optimized: - work well with sequences of all types - allocate parallel iterators on the native stack Bugs - maprod bug: wrongly reducing to mapcar, rather than mappend in the one-sequence case. - fixed interpreter segfault on (each ()) expression. TXR 239 2020-06-02 Features - Minor optimizations in library: - many instances of internal (format nil ...) calls replaced with cheaper string catenation operations. - consing reduced in the compiled implementation of string quasiliterals. - search, rsearch and update functions switched to seq_info. Bugs - compiler: showstopper bug fixed: operators in the each family, and the dohash operator were missing the implicit anonymous block. - vm: fixed interal bug: when diagnosing the situation that an anonymous block is not visible, format was called with excess arguments, hijacking the situation with a different exception. - lib: fixed broken rsearch function, and a minor flaw in the diagnostic generated by search and rsearch for a wrongly typed key object. - signals: fixed mismanagement of the sigaltstack memory. - streams: improved dubious integer format string detector logic that is invoked at global initialization time. TXR 238 2020-05-18 Features - Compiler: - optimization of load-time and fine-tuning of its semantics. - compiler now does lambda lifting: lambdas that don't reference lexical variables are created one time at load-time. - Now almost no penalty for moving a defun into a labels/flet, unless capture is introduced. - Lib: - Functions countqual, countql, countq, count-if, some, all, none now use the sequence iteration, so they are more efficient on non-list objects. - This is part of a slow-moving, on-going effort. - sort and shuffle are now non-destructive - the original destructive functions are available as nsort and nshuffle, respectively. - compat mode (value 237 or lower) restores destructive behavior. - New assert macro: something that has been conspicuously missing. - System Interface: - isatty function exposed. Bugs - sockets: bug in formatting IPv6 textual address. - symbol-function: fix failure to expand lambda expression arguments. - compile function no longer wastefully expands already expanded input. - configure: ./configure --help no longer clobbers ./reconfigure script. TXR 237 2020-04-26 Features - I/O: - get-line-as-buf function: read a line from a text stream as a buf object: saves storage compared to a string. - poll function now enables async signal handlers invocation, allowing it to beinterrupted. - Parser: - improvement in buffering of stream reads in lexical analyzer speeds up parsing. - compiled files (.tlo) load something like 75% faster. - Math: - relational functions =, <, >, <= and >= now work on sequences of numbers. - /= function avoids consing. - Sockets: - poll is now used for timed out connect and accept; select is a fallback if poll is not detected at config time. Bugs - Sequences: - uninitialized memory problem affecting the functions in, reverse, find, rfind, pos, rpos and tprint when used with vector-like sequences. - The function in is also affected when used with hashes. - Compiler: - fixed miscompilation of if form when the test is a constant expression that evaluates to false. - tags.tl: - fixed bug in file opening logic when following (load ...) forms. - Printer: - symbols with zero-length names now printed with package prefix, instead of nothing, so they enjoy read-print consistency. - Sockets: - broken timed-out connect fixed. - FFI: - some bugs fixed in carray code after a code review. TXR 236 2020-04-18 Features - open-file: - new "n" mode for non-blocking open. - now allows async signal delivery during open so blocking open can be interrupted. - New touch function, analogous to Unix utility. - Unicode: - map of characters that need two spaces on the terminal has been updated - now includes emoji in the U+1Fxxxx plane. - Listener: - Tab completion over Unicode identifiers works now. - Path testing functions now also accept integer file descriptor. - configure: - shell identification and re-execution logic in configure script - now avoids re-execution if the original shell seems good. Bugs - ignwarn: fixed neglect to handle warning exceptions with multiple arguments. - autoloading: definitions now trigger autoload, not only references. Otherwise if user code redefines some system entity that as not yet been loaded, a subsequent attempt to use that entity will trigger autoload, clobbering the user's definition. - open-socket-pair: fix broken function. - sockets: add missing shut-rd, shut-wr and shut-rw variables that are already documented. - unwind/signals: fixed signal mask restoring regression that first appeared in TXR 230. - txr-parse: release deferred warnings if erroring. - open-file: when "m" flag is in effect and POSIX open is used, use 0666 mode, not 0777, else the file will be created with execute permissios if the umask doesn't remove them. - regex: fix crash caused by duplicate regex character range. - vim: work around bug in Vim that causes it to treat "contains" (the name of a TXR Lisp function) as a reserved keyword in the syntax highlighting definition. TXR 235 2020-04-12 Features - Lib: - new txr-parse function, opening access to the parser for the TXR Pattern Language. - used by tags.tl. - path testing funtions now accept stream argument. - Exceptions: - unhandled non-error exception throws now simply return instead of terminating. - in pattern language unhandled @(assert) with a non-error exception behaves as failed match. - Parser: - more efficient handling of list syntax. - Listener: - Ctrl-X Ctrl-F command to force submission of unbalanced line. - dot file security tests improved. - permissions of .txr_history files checked also - if permissions on .txr_profile or .txr_history are bad, txr checks and diagnoses the user's umask. - tags.tl script: - now handles txr files: define and bind directives, as well as Lisp forms in @(do ...). - now follows load forms and processes defpackage. - each file read in new temporary package, and restores list of packages after each file. - Build: - Now builds cleanly with -Wextra under GCC 7+. Bugs - tags.tl: - backslashes not escaped in tags file. - macro-time forms not handled. - configure: - quote characters handled in config variable values. - Doc: - existing lineno argumnt of read and iread documented. - Hashing: - flaw in weak hash algorithm leading to spurious retention in situations when keys are weak, but values have reference to keys, or vice versa. - caused streams and parsers to leak. - Pattern Language - addressed spurious retention issues, causing memory growth proportional to the amount of input scanned. TXR 234 2020-03-25 Features - New base64url encoding: - :frombase64url, :tobase64url filters. - base64url-encode, base64url-decode and other functions. - Compiler: - When a TXR Lisp hash-bang script is compiled, the execute permissions are now propagated to the compiled file, too. - Editing support: - tags.tl script can now be compiled by compile-file, and no longer scans files twice. - GC: - small memory support: ./configure --small-mem. - reduces start-up footprint and size of incremental heap allocations. - Listener: - All major delete operations now yank the deleted text into the clipboard. - Hashing: - hash-uni function has two useful new functional arguments in addition to the join function. - Lib: - apf and ipf functions take additional arguments which are retained and inserted into the apply call. - search function now available under the name contains. - contains reverses the arguments: (search seq it) -> (contains it seq) - OOP: - more efficient stored argument in method and umethod. - (mapcar .(foo 1 2 3 ...) objlist) now allocates one special object that stores the 1 2 3 ... args compactly, rather than consing a list. - more use of this mechanism will be made going forward. Bugs - Regression in open-process dating to TXR 228. - The hash-count value of weak hashes was not maintained when the garbage collector removed lapsed entries. This was broken from the start; never implemented. - tags.tl: correctly take advantage of FTW_ACTIONRETVAL on glibc. - listener: - Del key not copying to clipboard, rendering it inequivalent to Ctrl-D. - Ctrl-W, when deleting a visual selection and the previous word, not recording undo history properly. TXR 233 2020-03-08 Features: - Lib: - crypt function now validates arguments rigorously before calling underlying C library function, which likes to crash with bad arguments. - new meq, meql and mequal functions for testing whether left argument is equal to any of the remaining arguments. - new assq and assql functions, so TXR Lisp now supports Ashwin Ram's (cdr (assq key a-list)) as written. - New "cumulative" option type in getopts: - multiple occurrences of cumulative option are accumulated into a list. - Vim support: - New utility: tags.tl is a utility for generating Vim-compatible tags from TXR Lisp sources. - can work in conjunction with ctags: ctags can add tags to a file generatd by tags.tl and vice versa. - Vim syntax files: the : character is no longer an identifier constituent. - Cygwin: - run and sh functions now use spawnvp instead of fork. - Listener: - Now appends new entries into .txr_history instead of overwriting it, helping uses who have multiple interactive invocations of txr. - History can be saved early at any time with :save command. - If no new lines have been entered when quitting, no history saving takes place. Bugs: - fixed broken inequality string comparison: - problem caused by string comparison functions misinterpreting the return value of cmp-str, which happens to work in the expected way on newer Glibc versions. - affected functions were str<, str>, str<=, str>= and less; indirectly, anything using any of these by default like sort, sort-group and so on. - @(line) directive now obtains correct line number in horizontal mode instead of zero. - chmod tests now work on platforms where sticky bit manipulation is restricted. - Fixed broken semantics of less comparison for symbols, allowing both (less a b) and (less b a) to be false, when a and b are different symbols having the same name. - Fixed breakage in getopts: processing of short options. - Fixed missing fnm-extmatch variable (related to fnmatch function) which should be defined on platforms that have FNM_EXTMATCH. TXR 232 2020-02-09 Features: - POSIX: - chmod function now supports symbolic modes of the chmod utility - chmod and stat nown work on streams and file descriptors - fstat now just alias for the same function as stat - added utimes, lutimes functions for updating timestamps - added mkfifo function - added chown and lchown - added rmdir - ftw now throws exception on failure - new copy-file and copy-files funtions - new recursive processing functions: - recursive copy: copy-path-rec - can copy symlinks, preserve timestamps, perms, ownership - recursive chmod: chmod-rec - recursive chown: chown-rec - recursive delete: remove-path-rec - Packages: - new merge-delete-package function - Build: - config.log file no longer generated by configure - New reconfigure script is generated - run reconfigure to conveniently repeat the same configuration - Exceptions: - New retry and skip exceptions under restart hierarchy - Buffers: - file-get-buf now has optional byte count and offset params - file-put-buf takes optional offset argument - new function file-place-buf: like file-put-buf but doesn't truncate if file exists - I/O: - new mode supported by open-file: "m": open for modification: - like "w" but doesn't truncate when file exits - E.g. "m+b": open for writing and reading, binary, don't truncate - Misc: - ensure-dir returns nil when directory already exists, t otherwise - with-resources macro takes multiple cleanup forms for each resource - New coded-length function for calculating UTF-8 length of string - open-files and open-files* now take an optional mode argument - numerous documentation fixes Bugs: - Fixed regression: @(skip :greedy) broken. - FFI: broken handling of undimensioned character arrays (no UTF-8 conversion) - mknod: third argument now optional, as documented - ensure-dir: fail if object exists and is not a directory - compiler: bug in compilation of catch form, causing "frame level mismatch" exception - packages: fixed lack of documented defaulting of package argument in several functions - copy-file: now detects source object is a directory, and avoids creating the target object in that case before failing - the internal c_str function now rejects symbolic arguments - some functions in TXR that were documented as requiring strings had the undocumented feature of accepting symbols, due to this behavior of c_str - listener now catches exceptions during gathering of completions, preventing TXR from bailing in that case - fixed incorrect return value of fill-buf and fill-buf-adjust - buf-set-length was not consistently setting newly allocated bytes to the requested initial value TXR 231 2020-01-12 Features: - compiler: - New function: compile-update-file for compiling a file only if necessary. Bugs: - gc: - aarch64 corrupt behavior due to not scanning for roots sufficiently far into the topmost (lowest address) stack frame. - build: - problem building on musl: sysif.h header referencing undeclared type off_t. - build breakage on big endian systems when libffi disabled. - double definition of FLO_MAX_DIG in config.h when configuring under musl. - misleading diagnostic when the name of builtin macro is defined as a function or vice versa. - incorrect FFI test cases (targeting glob function), leading to crash on musl. - hash: - equal-based hashing not traversing the key field of a tree node. TXR 230 2019-12-20 Features: - build: PIE (position-independent executable) builds are disabled. - PIE caused a crash in non-local transfer logic. - causes an 22% or more penalty on 32 bits x86. Bugs: - FFI: fixed bug in implementation of newly added zchar type. - mitigated crash in non-local control transfer logic (extended_setjmp) caused by PIE executable compilation - PIE is now enabled in some leading distros. TXR 229 2019-12-14 Features - OOP: - multiple inheritance now supported. - FFI: - FFI structs now allow initforms in slots. - limited evaluation semantics - New zchar type for defining arrays char that are optionally null terminated. - math: - hyperbolic functions and their inverses added. - buffers: - buf-list function: convert buffer to list of bytes. - buffers support list ops like car, cdr. - getopts: - new define-option-struct macro for simplified specification of command line options. - path testing: - new path-dir-empty test for empty directories. - disassemble: improvement in output. Bugs - issue with .? not parsing as a top-level expression. - listener: serious bug in balanced line check. - intern-fb: bug in optional argument handling. - load: wastefully gathered source loc info for .tlo files. - OOP: serious stability bug in static slot inheritance logic. TXR 228 2019-11-19 Features - Syntax: - New null-safe slot access operator .?: - a.?b means: (if a a.b), with a evaluated once, of course. - .?b means (lambda (arg) (if arg arg.b)). - Hashing: - New hash-invert function for reversing a hash table (values become keys and vice versa). - New hash-reset function to restart a hash iterator, possibly with a different hash. - Lib: - New identity* function; like identity, but with flexible arguments. - Expander: - expansion now interruptible with Ctrl-C - System Interface: - stat function now exposes high resolution time stamps. - open process supports a new < > syntax in the mode string, for arranging file descriptor redirections. - E.g. redirect stderr of gcc to stdout, like shell's 2>&1: (open-process "gcc" "r>21" '("foo.c" "-c")) - new open-subprocess function - like open-process but allows caller to specify Lisp funtion to execute in child process, before the specified program is executed. - executing a program is optional in open-subprocess - GC: - GC now gives memory back to malloc when all objects in a heap block are freed; on GNU/Linux this results in a munmap which gives back the memory the OS. - Buffers: - new functions for buffer-integer conversion: buf-int, buf-uint, uint-buf, int-buf. - FFI: - These carray functions were renamed: carray-unum, carray-num, unum-carray and num-carray. - "num" changes to "int" Bugs - Expander: - fixed a situation producing bogus undefined variable warnings. - Evaluator: - bugfix: eval was expanding the form in a null macro environment, yielding spurious warnings when eval is used with an eval argument. - now expands in a macro environment derived from the passed-in eval environment. - op macro: - Wrongly producing backwards-compatible behavior for compat values up to 255, rather than up to 225. - System Interface: - bugs fixed in path-file-p, path-dir-p, path-symlink-p, path-blkdev-p, path-chrdev-p, path-sock-p, path-pipe-p as well as path-strictly-private-to-me-p. - close-on-exec regression: not setting close-on-exec flag for pipe. TXR 227 2019-10-26 Bugs - showstopper in configure script TXR 226 2019-10-25 Features - New data types: binary search trees and their nodes. - buffers: - now comparable for inequality with less function. - convenience functions buf-str and str-buf for converting between a string and a buffer holding UTF-8. - gc: - Heap objects are now more strictly aligned in memory, allowing for a faster in-heap test in the garbage collector. - hashing: - Better use is made of the hash seed for lists and vectors. - New feature: eq-based hash tables. - Performance improvements: recompile time of the .tl files in stdlib improved by 10%. - eval & environments: - symbol-function supports lambda expressions. - accessors now provided for additional function properties: - number of fixed and optional args - is the function variadic - op: - new @rec metavar for self reference, allowing anonymous recursion - do behavior revised in light of mismatch between documentation and implementation. - new macro ldo: version of do that inserts left argument. - lib: - copy-cons now copies lconses and is more efficient. Bugs - Build: added forgotten "alloca.h" header into version control. - Improved overflow detection in string catenation. - gc: - fixed bug in heap bounding box calculation, making the in-heap test less efficient. - func-get-name: bogus return for nil argument. - stdlib: numerous incorrect uses of compile-error. - circle notation: - on read, not handling circular refs in hash userdata. - lib: - memory leak in bit function. - fixed buggy type tests that application code could subvert. - affects hashes, carrays, random-state objects, regex char sets and struct types. - hash: - use unsigned type ucnum consistently for hash values. - do not negatively index into hash table vector. - traversal limit observed when traversing keys that are vectors and hashes. - strings keys now subject to traversal limit, at a rate of 4:1: four characters count as traversing one node in the object graph. - eval: - eval function wrongly passed eval environment to macroexpand. - lib/vm/compiler: - not handling excess number of function arguments, leading to overflow in the fixparam field in the function object. TXR 225 2019-09-11 Features - Lib: - tailp function added - Unicode BOM character object now prints as #\xFEFF rather than #\ followed by a literal zero-width non-breaking space. - OOP: - cons cell used in non-cached slot lookup now recycled. - access to common special methods like length now optimized. - objects with length or car method now recognized as subtypes of sequence. Bugs - Interpreter: - issue between in let* and continuations: copy-env throws error. - list-builder: - significant rewrite of some internals. - fixed broken self-appending and deviation from append semantics. - Type system: - subtypep now reports string and lcons as subtypes of sequence. - objects with only length method now reported as sequences. - Lib: - Incorrectness in digits and digpow functions. - bracket function incorrect when some or all arguments passed via apply mechanism. TXR 224 2019-08-29 Features - compiler: - load-time now optimized away if top-level form. - argument of load time top-level form if load-time is - improved code generation for destructuring. - case of wasteful nil-initialization of local variable elided. - lib: - list-builder now has dequeue capabilities: - delete item from head and tail - new buildn macro to complement build: - returns last form instead of constructed list - new functions find-symbol, find-symbol-fb: - find symbol in package, with or without fallback lookup. - new function intern-fb: - like intern, but with fallback lookup. - new function cptr-buf: - obtaining cptr object referencing buffer contents. - MD5 digest support. - State-object-based, multi-step SHA-256 and MD5 digesting. - More efficient SHA256 string hash (not using string-byte-input stream). Bugs - lib: - regression in where function: not working for non-list sequences. - parser: - symbols no longer interned within object suppressed by #; notation. - uninitialized flag field in parser structure: - affects TXR 157 through 223. - affects circular notation like #1=(#1#) embedded in the pattern language. - cosmetic issue in bad character diganostics from lexical analyzer. - build: - remove_flags configure option was broken; - compiler flags were duplicated in the commandline. - unwind: - GC problem: neglect to GC-protect global unhandled-error structure. - compiler: - miscompilation of infinite for loop: (for init (nil) step ...) - where terminating condition is explicitly given as (nil ...) rather than implicitly as (). - destructuring: - error mismatch diagnostics indicating wrong substructure. - inappropriate special handling of colon args to optional params. - incorrect scoping for optional param init-forms in destructuring. - trace: - failure to remove trace from traced function being redefined. - redefinition of a traced method resurrects old version, clobbering new. TXR 223 2019-08-14 Celebrating Ten Years! Features - Pattern Language: - small performance improvement in @(collect) and @(coll) - important semantics improvement in :vars feature of @(collect)/@(coll). - lib: - base-name now takes second optional argument: suffix to strip away. - just like POSIX basename command - compiler: - better code generation for immediately-called lambda - improved code from pop macro - listener: - faster history saving due to taking advantage of buffered I/O instead of flushing each line. Bugs - Fixed issues in compilation of immediately-called lambda: - incomplete optional parameter support. - evaluation order problems. - subtle scope problems. - reverse function no longer complains about a # object when given an unsuitable argument. - added missing autoloads for a number of macros: - test-set, test-clear, compare-swap, test-inc and test-dec - because of the way compilation of the library works, these documented operators were unavailable even when their containing module was loaded due to some other symbol. - fixed regression: lack of file and line number reporting for unbound variables. TXR 222 2019-07-30 Features - FFI: - type.a.b.c syntax for navigating struct and union types. - for instance given (struct foo (x int)): - foo.x denotes int - (sizeof foo.x) is same as (sizeof int) - elemtype is a type operator now, not only macro: - (struct foo (x int) (y (elemtype foo.x))) declares y of type int. - elemsize and elemtype work on enums. - worked previously, now documented. - structs and unions may now be self-referential: - (struct foo (datum int) (next (ptr (struct foo)))) - type system will convert a Lisp linked list to C, and vice versa. Bugs - FFI: - null pointers handled in "in" operation: - e.g. when struct argument passed into a C function contains pointer that is nulled out. - struct is converted back to Lisp. - parser: - fixed failure to pinpoint start of unterminated expression, when it starts on line 1 of the stream. TXR 221 2019-07-23 Features - FFI: - Structures with flexible array at the end ("flexible structures") are now supported. - FFI types now have a dynamic size. - this can be explored with two-argument form of sizeof operator, which takes a prototype Lisp object as an argument. - (sizeof (array uint32) #(1 2 3)) -> 12. - Previously undocumented ffi-out function is now documented. - hashes: - New hash-zip function for constructing a hash from a separately given sequence of keys and sequence of values. - lib: - relate function optimized with hashes. Bugs - FFI: - Buffer operations ff-put and others now work with variable length arrays instead of accessing out of bounds. - TXR: - Fixed 2019-04-21 regression causing the file name to be missing from error messages. TXR 220 2019-07-08 Features: - New make-byte-input-stream function for abstracting byte streams creation over objects of different kinds. - sha256: - program can specify buffer where sha256 is placed to avoid allocating a new one. - sha256, crc32: - stream hashing operations internally use recycled I/O buffer. - New function buf-put-buf: more efficient way to plant one buffer's contents into another. Bugs - @(define): fixed problem in parametr list code walk, leading to spurious undefined variable warnings. - @{var1 var2}: fixed November 2011 regression: not working when var2 is bound to a regex or string list. - Broken carray-replace repaired. - overlapping use of replace family of functions: - semantics addressed in documentation - implementation fixed to avoid overlapping memcpy - compile-file: - no longer silently ignores top-level forms that are atoms or that macro-expand to atoms. - top-level atoms are compiled to produce diagnostics; then the compilation result is discarded. TXR 219 2019-07-01 Features - Base64 functions now work on buffers. - New sha256 and crc32 functions. - Sequences improvements: - numerous internal changes for better maintainability and performance - buffers and carrays considered sequences - (append #b'...' #b'....) works - nconc ditto - nullify function handles hashes, buffers and carrays - empty function handles buffers and carray - in function allows testfun and keyfun on hashes - defset now provides temporary variable for store value, so store form doesn't have responsibility of once-only evaluation. Bugs - lnew: two regressions fixed. - at-exit-do-not-call: logically reversed return value fixed. - seq-begin: due to bug, worked only with lists. - :key parameter macro: fixed bug causing key values to go to wrong variables. - various macros that use the constantp function were calling it with a null environment. TXR 218 2019-06-19 Features: - Lib: - new hash-peek function. - New seq-peek function for peeking at next item in iteration. - Sequence functions sub, replace, and their list, vec and str specializiations have been substantially rewritten to tighter semantic specifications. - The sub- functions are also all accessors now. - cat-str, split-str and spl now accept character object as separator. - New bitset function for breaking integer into bit positions. - FFI: - sub-buf accessor and replace-buf function introduced. - Semantics of variable length zarray made more sensible. - carray-sub accessor is improved; the syntactic place works via carray-replace, rather than generic replace. - Compiler: - A "--lisp" argument in the hash bang line of a source file is translated to "--compiled" in compiled file's hash bang line. Bugs: - Command line: - regression: unsuffixed hash bang script wrongly treated as Lisp. - Lib: - Multiple bugfixes in replace-list, such as negative indices in index list assignment now follow the usual convention. - select function handles negative indices; internals rewritten. - logcount crashing for fixnum arguments on 64 bit builds. - FFI: - carray-replace now performs index list assignment like other replace functions. - carray-refset now allows negative indices, with usual conventions. - buffers likewise support negative indexing. - GC: - stability issues fixed in make-struct, make-package and the arithmetic function ash. - Expansion: - Several hygiene bugs fixed in defset. TXR 217 2019-06-10 Features: - Integrated POSIX fcntl function, supporting F_SETFD, F_SETFL and F_SETLK. - errno constants are now provided. - POSIX close function added. - Windows installer associates .txr, .tl and .tlo suffixes with the txr executable. - fixnum range now includes the most negative two's complement value that fits into its representation, rather than excluding it. - place macros: slight adjustment to expansion strategy. Bugs: - Fixed failure to handle most-negative integer value in situations when a Lisp integer is converted to a fixed C integer. - Fixes a regression in the minimal Windows program example, in which (defvarl CW_USEDEFAULT #x-80000000) appears. - path-private-to-me-p function was considering superuser as just another user - properly locked down root-owned file was not considered private. - same with path-strictly-private-to-me - list length: off-by-one error for huge lazy lists that overflow a pointer-wide counter. TXR 216 2019-05-20 Features - Doc: .cblk/.cble replaced by .verb/.brev and .mono/.onom. - Debugging: - crude debugger removed - work under way for new debugger - backtraces for interpreted code, enabled by --backtrace - Exceptions: - new catch** macro which provides a description of each clause - I/O and system interface: - Streams support third variant of indentation: "force indent off". - Streams support depth and length limitation on objects. - More nuanced exceptions: exception types distinguish permission from non-existence and other errors. - OOP: - New function, allocate-struct: no frills, fast allocation of instances. - New function struct-type-name. - New macros new* and lnew*: these evaluate type expression. - New "derived hook": a class function called derived is invoked when a class is the target of inheritence. - Lib: - Substring operation no-op case now returns original string instead of copying. - New window-mapdo function: non-accumulating window-map. - System: - New cptr-size-hint function informs the garbage collector of the size of a foreign array. - load function now tries suffixed versions of path first, (.tlo followed by .tl) then falls back on trying unsuffixed. - *load-path* is bound to the actual path used to open the file, rather than the unsuffixed input path. - compile-file now resolves relative paths relative to existing *load-path* value, just like load does. - it is documented that compile-file sets *load-path*. - Input file search strategy of compile-file is harmonized with that of load. Bugs - tagbody: code replication bug leading to excessively large translation instead of jumps into single code vector. - issue in interaction between @(output) and lazy-list-valued variables. - MPI: floating-point math eliminated from radix length calculation. - compiler: - bug leading to "frame level mismatch" in VM execution. - triggered by special variables used as optional parameters in lambda. - build: allow $(pwd)/configure to work. - long-running regression in apply function has been fixed. - parser: line numbers off by one for hash bang files. TXR 215 2019-03-30 Features - Math: - User-defined arithmetic types are now possible. - objects which implement certain methods accoring to the documentation can be passed into arithmetic functions. Bugs - Listener: - we now ensure that the .txr_history as well as the temporary files created by the Ctrl-X E command (edit in external editor) are readable only to the user: perms rw-------. TXR 214 2019-03-22 Features - Improved expt function - raising integers to negative integers works. - raising zero to negative exponents throws division by zero. - Floating-point error checking - Infinity and NaN results are turned into exceptions rather than propagating as # - New generic sequence iterator objects. - seq-begin, seq-next - Function where becomes lazy. - Optimization in various lazy list processing functions. - Lazy cons improvements: - New lcons-car and lcons-cdr functions can access fields in a lazy cons without triggering the update function. - make-lazy-cons takes two optional arguments to initialize the car and cdr fields - thus, propagation of state in lazy list generation can use the lcons itself as temporary storage. - OOP: - Type struct introduced: - all struct instances have struct as a supertype Bugs - Parser: - out of range floating-point tokens now trigger error rather than turn to nil. TXR 213 2019-03-08 Features - new load-for function: - loads another module conditionally on a variable, function, struct or package not being defined. - listener: - input limit raise from 1023 to 4095 characters. - new defset macro: - like defsetf in ANSI CL; define function-like syntactic places easily. Bugs - listener: - fixed some lingering line wrap glitches in optimized character append logic. - fixed buffer overflow when loading history, when lines are too large for the maximum input length. - fixed hang when evaluation produces cirular object, even though *print-circle* is on. - library symbol regression: - two library symbols regressed into the sys package: the -- delimiter in :key parameter lists and the lnew (lazy new) for instantiating structs lazily. - disassembler: - operands of getlx, setlx instructions disassembled wrongly. - compiler: - fixed two cases of incorrect handling of lambda expressions that are immediately called. - fixed (fun (lambda ...)) operator yielding an interpreted function, even though it's compiled. - core semantics: - lambda expressions are no longer fboundp. - incorrect macro environment handling when expanding tree-bind. TXR 212 2019-02-24 Features - OOP: - more efficient new operator: now avoids extraneous consing. - Printer: - changed conditions for when symbols are printed with a package prefix. - the code is also optimized, and handles more cases when symbols should be printed with the #: uninterned prefix. - Lib: - pprof macro generates much smaller code. - faster "highest bit set" calculation, using GCC primitives. - new bracket function. Bugs - GC: - fixed GC bug in the parser, in relation to parsing circular notation. - fixed GC bug in clearhash function. - fixed two GC bugs in FFI: in the enum type and cptr type. - Compiler: - Fixed miscompilation of (prof
) in cases when is known at compile-time to return nil. - Listener: - Fixed hang issue that occurs when evaluation produces a circular object even though *print-circle* is turned on. - Fixed Ctrl-X Ctrl-P not being mentioned in the "cheatsheet". TXR 211 2019-02-18 Features - App delivery: - new function save-exe. - new txr-exe-path variable. - Regex: - new functions scan-until-match and count-until-match, related to read-until-match (scanning for regex inside I/O stream). - Lib: - new functions fill-buf-adjust and buf-alloc-size. Bugs - GC: - Objects on which finalizers were invoked were being retained until the next full GC, instead of being reclaimed at the next incremental GC. - Listener: - Fixed buffer flow in reading external file. - When editing in external editor, preserve the file if it is too large to be read back into the command line. - Fixed vertical skip problem in multi-line mode, related to the recent regressions. - OOP: - When struct types are removed, their IDs are now recycled, preventing struct ID exhaustion. TXR 210 2019-02-14 Features - Hashing: - New functions hash-symdiff (symmetric difference) and hash-from-alist. - Performance optimizations. - Library: - diff, isec and uni work efficiently for non-list sequences, and support hashes. - New function symdiff (symmetric difference). Bugs - hash-uni was wrongly calling the join-func also for keys that are only in the left hash, rather than just keys that are in both hashes. - Listener regression in TXR 209: hitting Enter in multi-line mode causes ^M to appear instead of advancing to the next line. TXR 209 2019-02-08 Features - Compiler: - string literals and bignums now de-duplicated in compiled files. - caseql generates slightly better code in the integer jump table case. - new function dump-compiled-objects - allows applications to programmatically generate compiled files out of individually picked compiled forms. - Library: - The sum and prod functions now take an optional keyfun argument. - Example: add up sizes of "*.txt" files: (sum (glob "*.txt") [chain stat .size]) Bugs - Compiler: - The defvar/defparm macros didn't take into account compilation, only marking the symbol special at expansion time, but neglecting to emit the code to do that when the expansion is executed. - This works for interpreted code, of course, but under compilation it means that if we compile a (defvar x) in a file with compile-file, the resulting compiled file will produce a global lexical x, not a dynamically scoped x. - Build: - The library is no longer compiled twice: the .tlo2 files are gone. - The idea that there could be a legitimate difference in the files compiled by a partially-compiled image, versus a fully-compiled image was wrong-headed. They are in fact the same, unless there is a bug. The interpreted compiler must produce the same results as the compiled compiler, period. - In fact, there was a difference between the "stage1" and "stage2" compiled files: it was caused by the above defvar bug. - Pattern Language: - When a call to a user-defined @(function ...), all on a line by itself (vertical mode) faces the end of input (EOF), the function was not being called. - Functions were able to shadow horizontal directives. - Listener: - November 2018 regression that caused screen update glitch when a long line wraps. - The caret notation ^@ was not used for the NUL character; it was sent to the terminal as-is (ignored by most terminals), but counted by our editor as having a display width of 1. - The ^@, ^A, ... caret notation was not being used for control characters, when these were inserted at the end of the line in the optimized no-refresh case. - Parser: - In string literals, handle embedded byte properly, mapping it to \pnul. - In string literals, diagnose bad UTF-8. - FFI: - make-zstruct/znew were blowing up when the FFI struct type has padding slots, indicated by the symbol nil. - deffi-cb-unsafe macro was not being auto-loaded. - ffi-make-closure's safe-p parameter's defaulting was mishandled, causing it to be always true even when given a nil argument. - thus deffi-cb-unsafe behaved like deffi-cb. - In FFI closure dispatch, clear previous state related to exception handling, which covers situations when we return to foreign code due to an exception, but the foreign code calls down again into a closure rather than itself bubbling up to Lisp. TXR 208 2019-01-28 Features - The -f command line option can be used with the Hash Bang Null Hack. Bugs - Showstopper bug in copy-hash also affecting hash-diff. - Pattern Language: - Bug in @(next) directive's :nothrow - @(next "file" :nothrow) wrongly reading from standard input if opening "file" throws. - @(next expr :nothrow) not catches error exception thrown by Lisp code. - The documentation can be interpreted as requiring this and the expectation is intuitive. - Same with @(next :list :nothrow) and @(next :string :nothrow). TXR 207 2019-01-26 Features - Internal code structure and performance improvement in the areas of FFI, integer types and bignums. Bugs - FFI: fixed bugs in the be-int64 and le-int64 types, making these usable. - Build problem: "make install" failing for compiled .tlo files when using a separate build directory. TXR 206 2019-01-18 Features - deffi, deffi-var and deffi-sym macros now helpfully diagnose if they require a surrounding with-dyn-lib macro that is missing. Bugs - fixed bugs in vec-carray and list-carray functions. - fixed bug in addition involving a bignum and small integer. - fixed bug in random and rand function: not generating values over the full range specified by the modulus. TXR 205 2019-01-15 Features - New function square for squaring a number; faster for bignums. - FFI: - array handling is more forgiving: Lisp sequences shorter than the array can be converted without error; the array is null padded. Bugs - build: - fixed problem related to alloca.h, reproduced under the Musl C library. - compiler/assembler: - fixed several bugs that prevent the compilation of functions with deeply nested lexical scopes or large numbers of local variables, yet well within the VM limits. - FFI: - Fixed issue in (array n char) type's put operation: this FFI type does not null-terminate, but was doing it when truncating strings longer than n. TXR 204 2018-12-18 Features - New function nzerop: negates zerop so we don't have to write (not (zerop x)). - Turning off -fstack-protector gcc option foisted by some distros - improves VM performance about 7% in loop benchmark. Bugs - defvar: - fix variable being in a state of limbo if the initializing expression throws. - build: - we were ignoring the LDFLAGS variable from the make command line or environment. - character handling: - fix UTF-8 decoder bug causing failure to decode four-byte sequences correctly. TXR 203 2018-11-29 Features - Optimizations in vm. - pprint keeps colon on keyword symbols. - New functions in-range, in-range*. Bugs - logxor: broken function fixed. - caseq*/caseql*/casequal*: fixed broken handling of clauses containing multiple keys: (caseql* x ((a b ..) ...)). TXR 202 2018-11-22 Features - Some optimizations in arithmetic library, compiler and virtual machine. - New function copy-fun: - copies functions, making a duplicate of their environment. - can take a "snapshot" of a closure. Bugs - compiler: - compile function now correctly handles functions that carry a lexical environment. - interpreted environment gets compiled into VM environment. - Build issue upstreamed from Void Linux distro: - On Musl library, header is required for fd_set. TXR 201 2018-11-07 Features - load now tolerates and ignores hash bang lines instead of trying to parse them as syntax. - previously, hash bang was only supported in files invoked from the txr command line. - some internal improvements related to gc. - improved type mismatch diagnosis in many library areas - more instances of which function triggered mismatch. Bugs - compiler: - compile-file was incorrectly handling situation with a defpackage followed by symbols from that package in the same file, resulting in a file that won't load. - load: - exception no longer thrown when file is empty. - a few instances of error messages containing a quoted function name. TXR 200 2018-11-05 Features lib: - The form expander is now a public, documented feature, including expand-with-free-refs, which informs about free variables occurring in a form. - New copy-buf function, called by copy for buf objects. compiler: - Better code generation for dwim forms. - global functions and global lexical variables in dwim forms are handled more efficiently. - no more lisp-1-style dynamic lookup at run-time; compiler resolves references to function or variable bindings. - a global function in the first position is dispatched the same as a regular call, resolved at compile time to the function binding; so [mapcar list '(1 2 3)] generates exactly the same code as (mapcar (fun list) '(1 2 3)) using the gcall instruction. listener: - performance improvements in multi-line edit mode: - refresh operations are avoided for cursor movements, incomplete line warning flash, and character appends at the end of the line. - much better copy and paste experience, and better experience on slow/lagged remote connections and serial lines. - uses temporary file for saving history. doc: - HTML table of contents "collapse all" logic doesn't hide the entire table, keeping the major sections visible. Bugs: - listener: - fixed abort on window resize (regression from Unicode work earlier in the year). - history now saved using temp file which is renamed after being successfully written. TXR 199 2018-10-28 Features - compiler: - hash bang in source files translated into compiled files. - more constant folding optimizations in equality comparisons. - de-duplication of code when compiling switch form whose branches share source code substructure (the basis for tagbody). - faster access to global lexical variables via two new VM instructions. - semantics change in handling of free variables: - undeclared variables treated as lexical rather than special. - defvar/defparm now warn if the variable was already used. - OOP: - improved diagnostics in uslot and umethod. - math: - new function random-float which produces evenly-distributed pseudo-random values in the range [0, 1). - functions exposed for floating-point rounding control. - new signum function. - lib: - list-builder methods rewritten for semantics and efficiency. - op-related macros rewritten in Lisp. - hashing function for floating-point values rewritten for efficiency. - evaluation: - top level forms under evaluation and compilation handled incrementally: - thus: if (prog A B) is a top-level form, then A will be macro-expanded and evaluated before B, so B can rely on A's expansion and compile-time effects to have occurred. Bugs - compiler: - fixed miscompiled empty test in for loop. TXR 198 2018-07-06 Features - Hashes: - Hash tables and the hash-equal function now use a hashing function keyed with a seed, providing a tool against hash collision DoS attacks. - New *hash-seed* special variable, gen-hash-seed function. - make-hash and hash-equal take optional seed argument. - hashes implicitly take their seed from *hash-seed*, which is initialized to zero (for repeatability). - seeding hashes is the application's responsibility; TXR will not automaticaly seed hashes. Bugs - Listener: - crash in selection yanking. This regression is a result of the recent "unicodization" of the listener. - VM: - compiled code now follows the situation when a function binding is deleted with fmakunbound and then a new binding is introduced for the same symbol. - source location info is no longer wastefully recorded for the forms that occur in compiled files. - Hashes: - equal function broken comparing two hashes: incorrect logic. - copy-hash not copying equal function pointer, causing garbage function pointer to be dereferenced when copied hash is compared for equality. - POSIX interface: - ftw funtion discovered broken (from initial implementation). Callback mechanism allocated four words on the stack, then put five arguments there. This was previously undetected, but recent improvements in args handling now caused ftw to assert. - Awk macro: - fixed nonworking (next); a regression caused by the Lisp compiler optimizing away (block ...) construct. TXR 197 2018-05-27 Features - logcount function: - counts one bits in non-negative integers, zero bits in negative ones. - closely based on ANSI CL logcount. Bugs - listener: - regression in 196: fatal exception if .txr_history file doesn't exist. - compiler: - failure to handle block* special form, and therefore also tagbody. - awk: - autload issue: compiled file containing awk expression won't load. TXR 196 2018-05-18 Features - Both the TXR Pattern Language and TXR Lisp now allow Unicode in identifiers. - Un-braced variables like @abc in the pattern language and string quasiliterals are excluded from this change. - Braced variables and Lisp symbols, including packag prefixes, may use Unicode characters. - Unicode spaces cannot be used in identifiers, and neither can various invalid characters. - The Interactive Listener now supports Unicode input. TXR 195 2018-05-04 Bugs - Overhaul of handling of parameters that are special variables. - was not implemented at all in interpreted destructuring. - compiled destructuring implemented it by using let. - had subtly wrong scoping semantics, not affecting most code. - was broken completely due to a regression in TXR 190 - MacOS and Solaris ports: - fixed broken method for getting TXR's executable path, which caused TXR not to work unless invoked via full path. TXR 194 2018-04-30 Bugs - FFI: - issue causing inability to to encode the most negative signed 32 bit integer on 32 bit platforms, and the 64 bit one on 64 bit platforms. - compiler: - fixed situations when compiler generates immediate move instructions for integer operands that are too wide to be used as immdiate literals. - assembler: - fixed a situation in which a bignum integer was encoded as a literal using its bitwise pointer representation. TXR 193 2018-04-26 Features - compiler: - load-time special form, similar to load-time-value in ANSI CL. - evaluates an expression on file load whose value is treated as a literal object. - program doesn't have to define a top-level variable; load-time occurs anywhere in code. - code improvement in translation of - string quasiliterals - destructuring (tree bind, macro arguments, ...). - compiler now removes (block ...) constructs that look as if they are not needed. - vm: - big improvement in stack usage of running VM. - addressed some spurious retention issues. Bugs - autoload - fixed programs experiencing errors due to some library modules not loading. - caused by situations when the dependency from a library module A to B modules was keyed only to the macros provided by B, not B's run-time functions generated by the macros. - of course, compiled code doesn't refer to macros any more. - compiler: - fixed (return x) being mis-compiled as if it were (sys:abscond-from nil x). - awk: fixed multiple expansion of path/command argument in I/O redirection macros ->, ->>, <-, !> and <. TXR 192 2018-04-19 Features - compiler: - compiled files now marked with byte order indication - TXR compiled on big-endian will load compiled files made by TXR on a little-endian machine and vice-versa. - caseq/caseql/casequal optimized to table dispatch for characters and integers in dense range. - inline lambdas (lambdas that are immediately invoked) are now open-coded into let-based binding blocks. - parser: - Unterminated form errors now show the starting line number of the top-level form being read. - VM: - architectural change: display max depth reduced from 256 to 64 frames, but frames with maximum widened from 256 words to 1024 words. - object file major version bumped from 0 to 1: - compiled files from TXR 191 won't load. - lib/VM: - wasteful consing eliminated from apply function. - continuations: - documented differences in compiled vs intepreted behavior with respect to mutated lexicals. - new macros hlet and hlet* provided for binding lexical variables that are based in off-stack storage that isn't captured in continuations. Bugs - compiler: - fixed miscompilation of unwind-protect. - missing ((lambda ()) ...) call forms now handled - also optimized by open-coding. TXR 191 2018-04-10 Features - TXR Lisp now has a compiler and virtual machine. - individual forms and functions can be compiled - TXR Lisp .tl files can be compiled into .tlo object files - the Lisp parts of the library are now compiled. - TXR starts up some 3.5X faster when most of the library auto-loading is triggered. - Library: - new bignum-len function; get the "size" of a bignum efficiently. - ldiff function redesigned with more nuanced semantics. - Symbols/Packages: - package-prefix-interning now allowed in packages that have a fallback list. - application code is now read in a package called pub, not in the usr package. - usr package is devoid of spurious symbols; the Lisp library is read in the sys package. - Macros: - defmacro forms are no longer hackily evaluated at macro-expansion time: - evaluated normally, in apparent lexical env. - code which does things like: (progn (defmacro foo ...) (foo ...)). now requires (macro-time ...) around the defmacro. - optional parameters in macro-style parameter lists no longer support the colon hack for explicitly specifying a missing parameter. - only function calls have this feature now. - Printer: - improved line breaking of aggregate objects. - new function force-break exposed, related to this. Bugs - buffers: buf-get-* functions were not allowing the last byte of a buffer to be extracted. - structs: post-inits and finalization registrations are now correctly performed by reset-struct. - trace: several bugfixes in method redefinition check. - bignums: fixed broken single-digit bignum multiplication. - functions: fixed regression in function argument processing causing the failure to diagnose too many args. - expander: fixed neglect to add sequentially-bound variables to the expansion-time environment when they lack an init-form. - expander: fixed some neglected expansions in the sys:for-op special operator that implements the iteration forms like each and for. - expander: bugs/regressions in handling nil in parameter list expansion. - expander: optional parameters of functions were not being expanded in an environment in which the previous params are visible. - listener: fixed poor treatment of regex syntax in the code which prevent lines from being submitted when they are ill-formed. - gc bugs: fixed some incorrect mutations that break generational gc. - some in struct code - some in datagram socket code. - tagbody: fixed; was broken due to a regression. - packages: read/print consistency issue related to packgage prefixes fixed. - regex: read/print consistency problem related to double quote. - regex: double-free corruption bug related to use of canned character classes like \w. - hash: fixed broken with-hash-iter. TXR 190 2018-02-18 Features - Annoying limitation removed: lisp load now handles .txr files. - Listener: - new *listener-pprint-p* variable turns on use of pprint for evaluation results. - new *listener-greedy-eval-p* variable turns on a cascaded evaluation: values are subject to additional rounds of evaluation, whose results are also printed. Bugs - fixed bug "unbound function sys:l1-val" when using lop operator. - fixed expander bug causing (do set [@1 x] y) to be wrongly expanded. - autoload bugfix: symbols used for struct slots in standard library modules are now interned even if those modules are not loaded, so that they are treated properly under the package system. TXR 189 2018-02-06 Features - read an iread no longer record source code location info unconditionally - now controlled by new *rec-source-loc* special variable. - OOP: - better abstract sequence support: - new: special methods rplaca and rplacd. - sub and replace function now redirect to lambda and lambda set methods. - car and cdr fall back on lambda method now if object has no car or cdr method. - refset defined for objects that have car method. Bugs - Fixed regression in read-print consistency of hash tables. - Fixed bug in sequence classification logic that caused objects to be reported as non-sequences. - Fixed nthcdr continuing to iterate up to n even after end of list reached. - Fixed neglected autoload registration for socket functions. - Fixed bug in source location recording, causing errors in code to be rported against incorrect file names and line numbers. TXR 188 2017-12-19 Features - New funtion grade - like grade up/down operators in APL. - returns indices into sequence in sorted order. - New macro feature: lexical macros can decline expansion. - lexical macro can decline to expand by returning original form. - lexical scope is searched outwards to find and try another macro. - Big hash change: - hash function now defauilts to :equal-based. - :eql-based keyword specifies hashing based on eql. - functions which take hash arguments follow suit: group-by, etc. - Streams new feature: structure delegate streams - OOP interface for creating objects that substitute into stream I/O operations. - stream-wrap base implementation for easily wrapping and adapting streams. - New functions rlist and rlist*: express discontinuous ranges easily. Bugs - append* and mappend*: - fixed unintentional, undocumented destructive behavior - fixed non-termination on infinite lists. - tail function now handles improper lists. - macro expansion bug fixed: - neglect to expand the output of a declined macro - must be treated as a function call or possibly a special operator - either way, may have constituent expressions that need expansion - prof: deal with overflowing performance counters. - we use a 64 bit type if we have it, and convert to bignum if and when required. - trace: fixed spurious "previously traced" warning on methods. TXR 187 2017-11-18 Features - Functional library: - lop: - "left op": new variant of op macro. - inserts free arguments on left rather than right. - Control flow library: - caseq, caseql and caseql expand to better code. - Sequences library: - find, find-if, find-max, pos, pos-if, pos-max, posq, posql, posqual, rfind, rfind-if, rpos, rpos-if, rposq, rposql and rposqual: - rewritten with optimization for vectors and strings and proper support for vector-like struct objects. - Awk macro: - five new range operators - some optimizations - FFI/buffers/carray: - carray indexing handles negative indices now according to usual vector convention. - New convenience functions for I/O between files/streams and buffers. - Build: - improved handling of test targets in Makefile - in condensed mode ("CC file.o" output) if the build step fails, the failed command is printed in detail. - Windows port: - Cygnal DLL updated to Cygwin 2.9.0 baseline from 2.5.2. - Vim: - % is correctly considered a symbol constituent. Bugs - partition, partition*, split and split* handle infinite lazy lists of indices; issues in their < TXR-171 compatibility have been addressed. - tprint function and -t command line option deal with lazy lists in constant memory now. - completely broken copy-hash fixed. - Awk macro: fixed hygiene problem in expansion. - carray: stability: missing type checks added in several functions. - open-command now accepts "b" mode flag even on POSIX platforms whose popen function rejects it with a failure. TXR 186 2017-09-16 Features - math: - new cum-inv-norm function for calculating inverse of the normal distribution. - new poly and rpoly functions for evaluation of single-variable polynomials, given coefficients and domain value. - macros: - new macroexpand-lisp1 and macroexpand-1-lisp1 functions for expanding forms in an assumed Lisp-1 style evaluation context. - regex: - new regex-prefix-match function - determines whether string is a prefix of a possible match, even if it is not itself a match. - optimizations implemented to reduce NFA graph size. - printed representation of regexes based on original source code, not AST-optimized version. - command line: - txr -i now goes to REPL even if loading throws exception. - listener: - Visual feedback is now given when Enter is pressed at the end of a line that is not accepted due to unbalanced syntax. Bugs - listener: - Enter pressed in Ctrl-X context now correctly leaves Ctrl-X context (in situations when line is incomplete and not submitted). - Lisp syntax: - precedence of range .. now lower than referencing dot, so a.b .. c.d parses in intuitive way. - regex: - fixed incorrect printing of | relative to catenation - e.g. #/abc(def|ghi)/ was printing as #/abcdef|ghi/ - recent regression - syntactic places: - if form [m ...] is used as a place, m is now correctly macro-expanded in a Lisp-1 context. TXR 185 2017-08-30 Features - The op/do macro implementation has been rewritten in Lisp: - Substitution of the @1 notation to anonymous lambda argument terms now leverages local macros, so that it follows a correct code walk. - Will not get stuck in an infinite loop if quoted literals occur that contain circular structure. - Meta expressions like @foo and @(bar) can now be used in the dot position of a function call - Example: (macrolet ((sys:expr (x) ^(quote ,x))) (list . @(a b c))) -> (a b c) - related to the op rewrite, which relies on it to preserve the behavior of forms like (op fun . @1) previously implemented in op itself. Bugs - Fixed a five-and-half year old bug in replace-str, introduced between TXR 54 and 55. This affects other operations such as (append "str1" "str2"). TXR 184 2017-08-23 Features - TXR ported to 64 bit ARM8 ("aarch64"). - out-of-memory handling revised: - throws exception rather than aborting. - code for this was very old and long neglected. - lib: - set-diff is called diff now; old name deprecated - isec and uni functions provide intersection and union. - names harmonize with hash-diff, hash-isec and hash-uni - len synonym for length - spl and tok functions: variants on tok-str and split-str, with argument order more suitable for currying. - math: - new functions digpow and digits - (digpow 1234) -> (1000 200 30 4) - (digits 1234) -> (1 2 3 4) - other bases than ten via optional second arg. - new functions sum and prod for adding or multiplying sequence of numbers without having to apply or reduce through + or *. - new divides function for divisibility testing. - bit functions logand, logior and loxor allow character operands. - function bit can test bit of character - control flow: - new macros doloop and doloop* - trivial case of tagbody optimized away. - extraction language: - bi-directional string tree match semantics for non-variables in @(bind) and other contexts. - FFI: - new buf-carray-function - new functions for reading and writing FFI types from and to streams. - I/O streams: - New stream type for doing I/O from and to a buffer. - Functions for Base64 encoding and decoding from one stream to another. - length argument in truncate-stream function now optional - defaults to current read/write position - parser: - more efficient treatment of string literals. - improvements in Vim syntax coloring. Bugs: - listener: - recognizes incomplete buf literals properly as open syntax. - tagbody: - tagbody was setting up anonymous block, which it must not. - pad function - spurious instances of nil were occurring in its output. - n-ary math-functions: - were not checking the one-arg case, e.g. (+ "foo") -> "foo" which should be an error. - tok-str: - wrongly permitted a call with just one argument. - streams: - seek-stream was not working when :from-end specified. - buffers: - buf-put-uchar was broken. - parser: - fixed "yacc stack overflow" when compiled with Byacc. - fixed broken #; syntax handling when compiled with Byacc. - fixed broken handling of empty buffer literals. - buffers: - fixed infinite loop in buf_grow function. TXR 183 2017-07-19 Features - Extraction Language: - New :lists parameter in @(collect)/@(coll) - Specifies variables which are are ensured as bindings to lists, even if they match nothing, without the full blown discipline of :vars. - FFI: - carray-buf, ffi-get, ffi-put-into, and ffi-in get an offset parameter for added flexibility. - Environment: - The accessors symbol-function, symbol-value and symbol-macro can now create bindings that don't exist, when assigned, rather than throwing errors. - Storing to a (symbol-function (meth ...)) place can define a method now. - I/O: - The format function can now pad floating-point numbers with zeros, if a leading zero flag is specified on the precison. - remove-path: exception semantics adjusted. - New path-cat function for easy catenation of paths. - getopts: - New argument type :text for an option whose argument is a string that is treated as raw text, and not TXR Lisp literal syntax as with the :str type. - List/Sequence processing: - New function, relate: turns corresponding elements from a pair of sequences into a translation function. - New accessor nth, like ANSI Lisp nth. - find and pos functions optimized and improved in support of objects that implement sequences. - Filters: - New *filters* special variable exposed. This holds the named filters used in the extraction language, as a hash table. Bugs - Fixed spurious warnings occurring in some situations when functions are invoked using square bracket syntax. - Fixed runaway recursion when trace macro used to trace the * or format functions. - regex: regex printing no longer renders superfluous parentheses around character classes. - getopts: fixed broken custom option type. TXR 182 2017-07-09 Features - Lisp: - Lambda expressions are function names now, improving compatibility of TXR Lisp with other dialects. - FFI: - Support for preparing zero-filled objects for foreign functions: - New functions zstruct and zero-fill, and new macro znew. - Relaxation in cptr type allowing a nil-tagged cptr null pointer to convert to foreign pointer through a cptr FFI type bearing any tag. - OOP: - New functions provided for accessing and storing a struct type's initfun and postinitfun. - The keywords :init and :postinit can be used in the place of method names, allowing a struct type's initfun and postinitfun to be redefined using defmeth syntax, and also referenced using the (meth type slot) syntax. - Doc improvements: - FFI restructured into major section with better divisions. - Better HTML TOC: [+] [-] open/collapse UI rearranged. Bugs: - OOP: - bugfixes in static-slot-ensure also affecting defmethod. - Listener: - newlines occurring in material pasted with Ctrl-X P (result of previous evaluation) are properly treated now as line breaks. - build: configure script triest to detect deviant libffi installations, like that of Arch Linux. - call-super-method function deprecated. TXR 181 2017-07-01 Features - FFI: - new cptr functions cptr-cast and int-cptr. - new macro deffi-sym - enums can be based on types other than int. - make-union can specify an initial value, and optionally specify the member for that value (defaulting to the first member). - Lib: - New Cartesian product mapping functions: maprod and maprend. Bugs - FFI: - fixed broken "in" semantics of zarray types. - fixed failure to null terminate zarrays. - fixed broken struct/union returns on big endian. - fixed bool types reporting as integers in the printed # notation. - fixed more bugs in bitfield layout leading to incorrect placement and retrieval of bitfield values. - fixed union types reporting as struct types in the # notation. TXR 180 2017-06-25 Features - FFI: - new types: bool, longlong, ulonglong. - support for C unions. - improved support for type-tagged cptr. - some performance optimizations. Bugs - Fixed regression in horizontal @(trailer) introduced in 170. - Fixed broken append redirection operator ->> in awk macro. - FFI: - fixed broken float put operation. - fixed broken handling of cptr when parametrized by tag symbol. TXR 179 2017-06-18 Features - FFI: - carray-sub function becomes accessor. - New functions num-carray and unum-carray to treat carray as a binary blob holding an integer, which is extracted. - New functions carray-unum and carray-num, which convert the binary image of an integer into a carray. - New copy-carray function, hooked into copy function. - Listener: - Multi-line mode is now default. - New Ctrl-X ? displays "cheat sheet" of interactive commands. - Open syntax is now detected: - when Enter is pressed in incomplete expression, a line break is inserted. - Sequences: - Functions length and empty now check whether a structure has a method called length and use it. - New concept being introduced: sequence that are not vectors, strings or lists can be "vector-like" or "list-like". - A struct is a vector-like sequence if it has lambda and length methods. - reverse and nreverse handle generalized sequences: - can be applied to carray - ref and refset now work on structs, via lambda and lambda-set. - could be considered a bugfix. Bugs - Numerics: - Fixed sign-extend function, broken for bignums. - Hardened the MPI library: - Clamped the maximum digit size to prevent numeric overflows in bignum sizes and bit counts. - Introduced new MP_TOOBIG error into MPI library, which is is handled in TXR Lisp runtime. - bit count argument of ash function range checked, since it must fit into the C type int. - Fixed neglect to autload place macros. - FFI: - fixed bugs in bitfield layout. TXR 178 2017-06-12 Features - FFI: - carray objects greatly extended: - element selection with select - assignable indexing and range selection - integration with the [...] syntax, ref, refset, sub and replace. - carray-get and carray-put functions make carrays more convenient for handling C arrays across FFI. - length function supports carray. - carray-pun function lets carray be reinterpreted as an array of a different element type. - carrayp function for testing whether object is carray. - if libffi is missing at build configure time, much more functionality from the FFI module is now retained. - Buffers: - ref and refset indexing supported, along with [...] syntax. - bufp function. - Awk macro: - new fconv conversions c and cz for C notation 0x... hex, 0... octal. Bugs - Added missing overflow checks in memory allocation code in various places in library: FFI, streams, system interface. - Fixed bug in vector function, allowing the negative sizes -2 and -1 to get through. - Awk macro: - fixed broken rng (basic both-endpoint-inclusive form) - FFI: - fixed failure to trigger string conversion for arrays whose element is a character typedef rather than direct character type. - fixed broken get semantics of incomplete (zarray char), and likewise for (zarray bchar) and (zarray wchar). - was getting a vector rather than string. TXR 177 2017-06-07 Features - FFI: - bitfields: - struct members may be bitfields, using 1, 2 or 4 byte storage cells. - enums: - enum types convert between sets of symbols denoting numeric values, and FFI type int. - align operator in type language: - the alignment of types can be customized to achieve effects like packed structures, or conformance with unusual alignment requirements. - endian types: - big and little endian versions of int16, uint16, ... int64, uint64, float and double. - FFI transparently handles conversion. - new macros: alignof, offsetof, arraysize, elemsize, elemtype - numeric values in type language such as array sizes are now evaluated expressions. - new val type for transparently passing raw Lisp values. - Streams: - New put-buf and fill-buf functions for I/O based on buf type. - FFI-type-driven conversions to/from buffers combine with buf I/O, allowing TXR to deal with binary data in files and over networks. - Command Line: - new *args-eff* variable provides access to transformed command line arguments. - "Hash bang" support rewritten, and now features a "hash bang null hack": - Additional arguments to TXR may be encoded in a hash bang line after a null byte. - lib: - mkstring's argument now optional, defaulting to space. Bugs - FFI: - lingering broken assumption that alignment of pointers is the same as their size. - GC integrity issue in carray and cptr objects. - Another GC integrity issue affecting basic FFI types. - fixed incorrectly coded exception throws affecting code which misuses one of the four functions that connect FFI and buffers. - slots named nil in a FFI struct are now culled when making the corresponding Lisp struct type. - fixed broken handling of return values on big-endian platorms, related to a historic quirk in libffi. - fixed some broken conversions and range checks affecting some integer types. - fixed broken get semantics for arrays of bchar. - failure to null-terminate decoded string. - fixed clockid-t type not being defined on platforms that do have the corresponding clockid_t C type. - Build system: - "make tests" doesn't cache output of failed tests, so they are repeated when re-invoked. TXR 176 2017-05-21 Features FFI: - New tagged variant of cptr type, for improved safety. - New carray type for handling arrays of unknown size, where FFI's automatic memory handling isn't of help. - deffi-type is just called typedef - New ffi macro providing a shorthand for ffi-type-compile. - Variable length arrays that are null-terminated (zarray ) now have useful semantics: the type can extract an arbitrarily long null-terminated array from foreign memory. - Previously undocumented ffi-call function is now documented, and has undergone an API change. - deffi macro now generates Lisp functions with fixed number of arguments, so a mismatch in number of arguments is caught at the wrapper level, rather than down inside ffi-call. - New deffi-var macro for defining a Lisp variable connected to a foreign variable. Awk macro: - New (again) operator for repeating all the rules against the same record. Filesystem: - New functions dir-name, base-name and variable path-sep-chars. - New function realpath, wrapper for the POSIX one. Bugs - fixed corrupt line numbers being reported in some situations, like unbound variables inside quasi-word-list literals. - FFI: - fixed broken in semantics of buf type. - fixed broken alignment of basic types leading to wrong struct layouts. - nil value now handled by FFI buf type, mapped to null pointer. - A ffi call now releases up temporary local memory when an exception occurs in the argument preparation phase. - A ffi callback similarly releases any temporary memory allocated during the preparation of the return value, if the preparation terminates due to an exception. - Defense in the type system against incomplete (i.e. zero sized) types being passed or returned by value, or used as array elements or struct slots. - Fixed wrong documentation about variable-length arrays corresponding to pointers. - FFI calls are now checked for proper number of arguments. TXR 175 2017-05-15 Features - New: Foreign Function Interface (FFI) - Declare bindings to C-compatible functions in other software components (dynamic libraries). - Use Lisp functions as C-compatible from foreign software components. - New :prompt command in listener, nicknamed :p, which turns on prompts, useful in the plain mode listener. - stat structure has a path slot now, for convenience; - answers question: if the stat was obtained from a path, what was that path? - Built in functions and macros can now be redefined: only a warning occurs, rather than error. - New buffer data type. - Functions related to cptr type exposed. - Funtions dlopen, dlsym and related functions exposed. - OOP: - new and lnew macros now check nonexistence of base type at expansion time and generate immediate warning. Bugs - Printing issue with embdedded symbols in quasiliterals. - Fixed broken printing of quasi-word-list literals. - @{expr [index]} substitution syntax now indexes into any kind of sequence, not only lists. - Tightening in parser to reject certain unassigned syntax like #[], and better error checking over hash literals. - Bugfixes in area of processing TXR pattern language in context of user-defined package. - OOP print methods can now disable *print-circle* over recursive print calls. - Unintering built-in symbols is now possible without catastrophic results. - Fixed error in macro-expander's traversal of the special forms return-from, sys:abscond-from and block*. - Fixed bug in expander for suspend macro. - Fixed bug in the ash function when right shifting fixnum integers. - Fixed tostringp not behaving for float numbers in documented manner. - mkstring and vec-set-length defend against negative argument. - lognot and logtrunc defend against negative number of bits. - Fixed bug in --free-all logic when --vg-debug in effect. - Fixed incorrectly ordered logic in make-catenated-stream, exposing a Lisp object to premature reclamation. - Reproduced as actual issue on Darwin, under the --gc-debug GC torture test. TXR 174 2017-04-04 Features - TXR Pattern Language: - The special phrase forms like @(collect) and @(end) are now integrated with the package system. - opip macro: - forms like .a.b or .(meth x y) occurring in opip now evaluate to functional pipeline terms as expected. - Lexical syntax: - Dubious run-on lexical forms like 0.1.2 and .1.1 now diagnosed. - Time: - New functions time-parse-local and time-parse-utc. - Listener: - The -n option now has the additional effect of forcing the listener into plain input mode (no editing, history, or completion) even if the input device is a TTY. Bugs - Fixed broken support for building in separate directory. - Floating-point constant regression: .123 being misinterpreted as a slot access if preceded by whitespace. - Fixed rejection of 0.1..0.2 range syntax with floating-point operands. - Fixed a...b syntax error. This is a .. .b. - Fixed apply and iapply broken behavior: not splitting non-list sequences into individual arguments, like documentation says. - Linenoise issue fixed: when reading from a non-tty mode without editing, the continuous instantiation of a new buffere stream was causing input data to be discarded. - Scanner issue fixed: `@@1abc` was being interpreted as `@{@1}abc` rather than `@{@1abc}`. TXR 173 2017-03-25 Features - Listener: - Completion is now sensitive to slot or method context: .(abc[TAB] and .abc[TAB] searches appropriate spaces. - TXR Pattern Language - Unbound variable followed by directive is now bound to partial match result while searching for match for directive. - GC: - Finalizers may now invoke call-finalizers; behavior no longer unspecified. - Lisp code processing: - Warnings issued when expanding code that accesses nonexistent struct slots. - Not a form of type checking at all, but catches many typos. - Windows: - Improved 16x16 icon. Bugs - Lisp code processing: - Fixed missing warnings when main module is a .txr file. - Fixed missing unbound variable/function warnings for unbound symbols that are the direct operands of [...] syntax. - Fixed wrong name being printed in trace messages, when trace is used to simultaneously enable tracing for two or more functions. - Windows: - Start menu shortcut now starts in user profile dir, rather than incorrectly in TXR standard library installation dir. TXR 172 2017-03-19 Features - Argument of umask function is optional - if omitted, function returns current umask. - OOP: - new static-slot-home function - reports the base class which actually defines a slot. - Sandboxing support: - New *package-alist* variable gives application control over what packages exist over a dynamic scope. - Makes possible safe evaluation of TXR Lisp code obtained as input from untrusted source. - Special behavior worked into exception handling to close a potential sandbox hole. - Tracing: - trace now canonicalizes a method name to the base class which defines a method and produces a warning if this is different from what was requested. - E.g. (trace (meth dog speak)) is issued, but dog just inherits (meth animal speak) which is what is actually traced. - warnings issued when traced functions are redefined. - Windows: - New icons, redesigned from scratch. - SVG logo now in source tree. Bugs - Parser fix in relation to new unbound reference dot syntax: now it may be a top-level expression, so entering .a.b.c into the REPL isn't a syntax error. - Missing documentation for opt function added. - Windows: - Fixes from Cygnal: - dir and shell fields in password structure returned by getpwent are Windows paths that make sense. - HOME environment variable has same value as USERPROFILE. - Fixes issue when Windows Vim is invoked out of txr, of Vim being confused by nonsensical HOME value. - Linenoise fix: Ctrl-X Ctr-E (edit in external editor) - Now temp file closed before spawning external editor. - Fixes issue of editor reporting that the file is in use by another application and not being able to save. - Fixes issue that Vim reports the file as readonly. TXR 171 2017-03-14 Features - New unbound referencing dot syntax: .a.b.c.d corresponding to (uref a b c d) macro operator - Produces a function which curries slot references, binding them to an object passed to it as argument. - Command line: - The argument - (dash) is no longer required to specify that standard input is to be scanned; it is default behavior. - TXR access from Lisp: - last two arguments are now optional in match-fun. - OOP: - new functions struct-from-args and struct-from-plist provide slightly simplified interfaces to make-struct. - A structure's print method can now return : (the colon symbol) to indicate that it declines printing, so the built-in structure printing takes place. - suppresed by -C 170 (or lower) compat option. - Sequences library: - new rmismatch function: compares tails of sequences and reports mismatching position as a negative value. - new functions starts-with and ends-with. - split, split*, partition, partition*: now allow negative indices. - previous behavior of ignoring negative indices can be selected using -C 170 (or lower). - TXR Pattern Language: - New directive @(mdo): "macro-time do": evaluates Lisp code immediately after being parsed and disappears from syntax tree. - New @(in-package) directive, allows pattern language files to succinctly express being in an alternative package. Bugs - Fixed spurious warnings about :vars set up in @(repeat) being unbound as well as the :counter variable in @(collect). - Fixed lack of macro-expansion on the init expression in @(collect :counter (var init)). - The TXR matcher now refuses to open input sources that are streams, or standard input default, for non-matching directives, in the same manner that file name sources are treated. Thus @(next s) (where s is a stream) not cause any input to be pulles from s until a matching directive is encountered. - match-fun: @(next) in the invoked pattern function now correctly switches to the first file in the list of files passed to match-fun. - Fixed numerous instances of improperly terminated formatted printing in the TXR internals (missing "nao" argument). TXR 170 2017-02-28 Features - Horizontal-mode @(throw) directive. - Horizontal @(block)...@(end) syntax. - Second argument of trunc function is now optional: (trunc -1.5) yields -1.0. - floor and ceil functions take optional second argument, which acts as a divisor: (floor 10 3) -> 3; (ceil 10 3) -> 4. - New round function: (round 0.7) -> 1; (round 3 4) -> 1; (round 1 3) -> 0. - New functions floor-rem, ceil-rem and round-rem. Bugs - Requirements for special interaction between @(accept) and @(next), function calls, and @(finally) have been identified and implemented. - Fixed segfault (C null pointer dereference) when nil symbol used to look up a struct slot. TXR 169 2017-02-11 Features - Improvements in area of warnings and deferrable warnings. - Representation of deferrable warnings changes; the defr-warning exception type derived from warning is used. - Awk macro: - Now provides a warning when a rng expression appears to refer to a local variable or function that is unreachable due to the code relocation. - New functions rassoc and rassql. Bugs - compile-warning function: added missing catch in compile-warning functionfor continuing after warning is handled. TXR 168 2017-02-05 Features - Mutation of lexical functions is forbidden and diagnosed. - e.g. (set (fun f) ...) when f is lexical. - Improved diagnostics during place expansion and when exceptions occur at macro-expansion time. - New function rlcp-tree. - New macro whena, complements ifa and conda. - Functions remq, remql, remqual, remove-if, keepq, keepql, keepqual and keep-if were rewritten and work more efficiently for vectors and strings. Bugs - Fixed an issue in the the expansion of Lisp-1 forms as places. - Fixed ocurrence of "expansion at nil" diagnostic in some error traces. - Fixed printing of unnecessary package prefix on symbols which are visible in the current package, but not interned in it. - Fixed rehome-sym not removing symbol from hidden list of destination package, as documetned. - Fixed broken keepql function. - Fixed bug in poll function: rejecting stdio-stream type objects as non-streams due to strict type check rather than subtype. TXR 167 2017-02-02 Features - New functions defer-warning and dump-deferred-warnings. - Awk macro: - small convenience: an input source given in :inputs can now be a list of strings, which the macro converts to a stream. - Tightening in syntax: - When floating-point tokens are followed by a period and a non-period character, this is now a "trailing junk" syntax error: SYNTAX OLD BEHAVIOR NEW BEHAVIOR 1.$ "trailing junk" error "trailing junk" error 1.0.$ (qref 1.0 $) "trailing junk" error 1.0.a (qref 1.0 a) "trailing junk" error 1.0.0 1.0 0.0 "trailing junk" error 1.1. generic syntax error "trailing junk" error - Spliced symbols are diagnosed as "bad token" syntax errors SYNTAX OLD BEHAVIOR NEW BEHAVIOR :a:a :a :a "bad token" @a@a @a @a "bad token" usr:foo:bar usr:foo :bar "bad token" - These changes are not subject to -C option: code must be fixed if it contains these incorrect lexical forms. Bugs - The sort function now actually implements a stable sort over lists, as has been documented for a long time. - Missing autoload registrations for catch* and handle* added. - Parameter list macros now recognized in the parameter list of a catch clause. - Fixed incorrect printing of a symbol that is not visible in the current package due to being hidden by a like-named symbol: such as symbol must be printed with its package qualifier. - Fixed issue: Lisp files loaded from the command line were showing spurious undefined warnings that wouldn't appear if the same files were loaded with (load ...). TXR 166 2017-01-26 Features - Deferred warnings - System of deferred warnings implemented allowing forward references to functions, variables and anything else (extensible). - New error reporting convenience functions for macro writing: compile-error, compile-warning, compile-defr-warning. - A parameter list macro called :key is provided, allowing functions and macros to easily take keyword parameters. - New memp function for searching a property list. - New functions plist-to-alist and improper-plist-to-alist. - New macros catch* and handle* which provide catches and handlers access to the exception symbol. - Local macrolets established by the build macro such as add, pend, pend* and others are now functions. - Awk macro: - *stdin* now bound to current input stream. - new fname variable analogous to FILENAME. Bugs - Unbound functions diagnosed consistently between dotted (fun ... . x) forms and ordinary. - *stderr* bound on entry into the repl, so errors sent to *stderr* go to the repl's output stream. - Better error reporting for nonexistent base in defmeth. - Fixed broken supertype check in make-struct-type also affecting defstruct, a nonexistent base to be treated as if it were nil. - Fixed compound forms not being expanded in quasiliterals. This is a TXR 160 regression breaking `@(macro ...)` usage. - Muffle expansion-time warnings in op macro expander. - Fixed missing macro expansion of TXR Lisp forms in collect, coll, gather, output, and numerous other TXR directives. - doc: missing documentation for :var argument of @(next) written. - Fixed small ambguity issue in expansion of keyword args in @(repeat)/@(rep). - Fixed an expansion issue affecting output vars. - *package* subject to rebinding in @(load) just like in the Lisp load function. - Cleaned up sloppy expansion in braced variables. The argument of the :filter keyword isn't expanded. - Fixed poor expansion order of parameter list macros, and a related bug. - Fixed :whole and :form arguments in macro parameters lists not allowing destructuring (due to an exception being thrown at expansion time if their arguments are not bindable symbols). - Fixed init-forms of optional arguments being expanded in an incorrect macro environment, in which earlier arguments are not visible as they should be. - Fixed broken termination tests in take-while and take-until. - Fixed wrong form being taken as the to-be-destructured form in mac-param-bind. TXR 165 2017-01-10 Features - New Lisp concept: parameter list expander macros. - customize function behavior with attribute-like keywords which invoke custom expanders to transform bodies and parameter lists. - Throughout the TXR pattern language parser, checks against empty clauses have been eliminated. Empty clauses in numerous situations are not considered syntax errors. - The last variable in whilet can be omitted in the same way like in iflet and whenlet. Bugs - Fixed missing space between attribute keywords in the printed representation of a hash. - Windows native version picks up fix for Cygnal issue 15. TXR 164 2017-01-01 Features - Awk macro: new variable fw for delimiting records according to fixed field widths. - The last variable may now be omitted in the bindings list of iflet, whenlet and condlet, leaving just the controlling expression, not bound to a variable. - Various syntax checks over function and macro parameter lists, and variable bindings, have been moved out of run time and into expansion time. Bugs - Build: "make clean" now removes txr-win.exe - Fixed a lingering bug in the handling of special variables in parallel binding, not fixed in the work done in this area for the previous release. - Fixed a bug in the handling of optional-argument presence indicating arguments: not binding them dynamically when they are special variables. - Fixed inconsistency in the regex-source function: the source of the (compound "str") regex was reported as "str", which isn't the same thing when fed to the compiler. - Fixed completely broken quasi-quoting over #R range literal syntax. - Fixed a read/print consistency problem in quasiliterals. - Fixed a problem with catch operator form not being fixed-point stable under repeated passes through the expander. To fix the problem, catch has turned into a macro which expands to an internal sys:catch operator. TXR 163 2016-12-20 Features - New equot macro: quote after macro expansion. - CL compatibility: - New function endp. - New function mismatch. - New prog and prog* macros. - Signal handling: - If an async signal is caught and handled by Lisp code during gc, gc is canceled. - Allows recovery from segfault due to stack overflow during gc. - Exception handling: - New function find frames. - Awk macro: - New awk local macros -rng, rng- and -rng-, providing endpoint-exclusive variants of rng. - Redesigned binding of special variables. - Fixes subtle bugs - Reduces number of variable binding special forms. - Removes special var handling responsibility from binding special forms. Bugs - Method lookup doesn't throw on nonexistent slots. - Fixed find-max not handling interpreter literal strings. - Expansion bugfix in tagbody. TXR 162 2016-12-07 Features - Awk: - Awk prn macro is now a function: can be used as a functional argument - Regex: - New functions fr^$, fr^, fr$ and frr. Bugs - Awk: - fixed assignment to field list f not yielding the new value as a result, returning another object instead. - input processing loop containing no cond-action clauses was being elided, even if it contained :begin, :end, :beginfile or :endfile clauses which must be executed. - awk macro implicitly obtaining its input sources from the command line wasn't consuming the command line, causing problems when macro is used from the command line. - Syntax, input: - Fixed robustness issue in handling of out-of-range hex/octal character escapes. - This fixes a crash that could be triggered in the regex module by a regex containing out-of-range character escapes in a character class. - Stray debug printf removed from lexical analyzer. - Occurred only when diagnosing certain invalid floating-point syntax. - Fixed syntax error being reported when last item in a Lisp source file or :read paste in the REPL is an object erased with #; notation. - Syntax, output: - Fixed ^(a . ,b) being printed as ^(a sys:unquote b). - Fixed ^(,* a) and ^(, *a) both printing as ^(,*a). - Exceptions: - fixed handle macro's deviation from documented syntax. - subject to compat option. TXR 161 2016-11-28 Bugs - Regression: awk macro spews warnings. TXR 160 2016-11-27 Features - New hash table function clearhash. - TXR Lisp macro-expanding code walker now generates warnings about unbound variables and functions. - ignwarn macro provided for ignoring warnings. - macro-time macro now interleaves expansion and evaluation, so that the evaluation effects of forms occurring earlier in the macro-time form are visible to the macro-expansion-time of later forms. - New exception-subtype-map function for retrieving type symbol hiearchy. Bugs - Fixed numerous bugs in macro expander: - not including symbols in macro-time environment: - macrolet arguments - dohash key and value variables - function name in defun - the auxiliary Boolean parameters that can exist on optional parameters which indicate whether the optional argument is present. - not expanding: - mac-param-bind special forms at all. - wrongly traversing and expanding: - @var and @(expr) syntax - incorrectly expanding: - arguments of op using Lisp-2 expansion style rather than Lisp-1. - Fixed a number of library functions broken due to using nonexistent variables: test-inc macro, str-inaddr-net, str-inaddr6-net, - Fixed broken read-print consistency of quasiliterals. - example: `@@@a` would print as `@@a` which is a different object. - Fixed op and related macros not handling @rest in the dot position. - Fixed interaction between circular notation and hash literals. - literals denoting eql-based hash tables which contain themselves as keys now work. - literals denoting equal-based hash tables doing the same thing are not supported for now; they produce junk hash tables. - Build system: - Changes in 159 caused builds to fail on some systems unless lex was manually specified. - On some systems the $(LEX) make variable points to something which isn't GNU Flex compatible. - On some systems $(LEX) points to a nonexistent lex even if Flex is installed. TXR 159 2016-11-21 Features - Tweaks in generational GC. - Rounding out of package system with "fallback" concept. - TXR Lisp now has a tagbody macro. - Macro bindings now hold first-class functions. - Global macros have (macro ) function names - symbol-function works with (macro ). - Possible to (trace (macro )) to trace a macro. - Posible to (defun (macro ) args body ...) to write a raw macro expander as a plain function. - func-get-name applied to global macro expander function calculates its (macro ) name. - Trace macro now throws error if an undefined function occurs in the argument list. - The previously deprecated -b option has been revived and repurposed: - use "-b sym=obj" syntax to pre-define a Lisp variable. - Build system: - TXR now honors standard Make variables like CC and CFLAGS. Bugs - Fixed macro-expansion bug in which forms are expanded at macro time, to determine whether or not they are constant, wrongly using the global macro environment rather than the lexical one. TXR 158 2016-11-15 Features - OOP: - New feature: dirty flag bit on struct instances. Code can tell if any instance slots were modified since last time dirty flag was cleared. - Packages: - New in-package macro. Bugs - Interactive txr switches *package* to user package before entering the listener, in case the specified script file alters it. - Fixed broken bignum addition. - Fixed breakage in fixnum to bignum conversion affecting 64 bit targets. - Fixed invalid mutation of applied argument list, affecting some functions. Test case: [apply lcm (list 1)] mutates (1) to (nil). TXR 157 2016-11-14 Features - New #; syntax for commenting out Lisp object. - #: syntax for uninterned symbols now works as an input notation. - Packages: - Overhauled implementation with increased scope. - New *package* special variable holds current package. - New concepts in package system: foreign symbols, hidden symbols. - New functions: package-local-symbols, package-foreign-symbols, use-sym, unuse-sym, use-package, unuse-package, unintern. - New defpackage macro. - Improvements in Vim syntax coloring; don't forget to install new txr.vim and tl.vim files. - New convenience functions for file or process I/O in one call: file-get, file-put, file-append, file-get-string, file-put-string, file-append-string, file-get-lines, file-put-lines, file-append-lines, command-get, command-put, command-get-string, command-put-string, command-get-lines, and command-put-lines. Bugs - Fixed an infinite loop in the processing of syntactic places: regression introduced in 156. - Fixed bug in processing of nested syntactic places like [place arg] where the inner place is a macro. - Fixed regression in awk macro introduced in 156, related to the above bug: not being able to assign to a field as in (set [f 3] "foo"). The bug was there before, but the change suddenly removed the accidental circumstances which protected the awk macro from reproducing the problem. - Fixed some additional problems in circle printing, in the printing of package objects and and interpreted functions. - A few GC-unsafe mutations were found in the TXR kernel, by inspection, and fixed. No actual instability was reproduced. - Fixed a bug in the caseq, caseql and casequal macros: single-atom key values were being exposed to evaluation rather than taken as themselves. This behavior can still be obtained with the compatibility switch; but it is recommended to first see whether switching to one of the new case constructs caseq*, caseql* or casequal* is feasible. TXR 156 2016-11-05 Features - time-parse function defaults to epoch time. - new accessors nthlast and butlastn. - sub function is now an accessor. - last and butlast functions are accessors, and get optional index argument. - Awk macro: - now supports pipe/file redirection. - Function tracing support: trace, untrace macros, *trace-output* stream. - symbol-function accessor can refer to methods via (meth ...) syntax. - restrictions in dwim places relaxed: in (set [x y] z), x doesn't necessarily have to be a place. - OOP: - new lambda-set method can treat [obj ...] expressions as places when obj is a struct. - new slots function for getting complete list of slots of a struct type. - New neq, neql and nequal functions for negated equality tests: for all those times you hate writing (not (equal a b)). - New command-line argument processing library. - Improved printing of error location, and tracing locations across place expansions. Bugs - quasiquote now works properly over struct literals. - wrong return value of nthcdr place fixed. - fixed circular printer blocking unwinding. - tok-str semantics adjusted once again to eliminate spurious empty tokens in some situations. - fixed broken tok-where (regression). - fixed potential incorrect evaluation order in dwim places. - fixed bugs in circular printing that traverses hash tables and objects with print methods - *stdout* now flushed when processing unhandled exceptions, so that diagnostics sent to *stderr* appear properly ordered w.r.t. prior *stdout* output. TXR 155 2016-10-21 Features - Common-Lisp-style circle notation supported now both on input and output. - *print-circle* special variable now exists. - supported across print methods. - OOP: - print methods now take three arguments rather than two, and are called for readable and pretty printing, not only pretty printing. - env-fbind and env-vbind functions allow nil env argument to denote toplevel bindings; thus they can be used to bind global variables. Bugs - fixed regression: inability to work with places denoted by compounded referencing dot; e.g. (set a.b.c val) - fixed showstopper regression: inheritance of static slots causes assertion and crash at garbage collection time (while simply checking for a condition that is harmless in and of itself). - reduce-left: initial value pulled from the input list itself was not passed through key function. - fixed some places where a volatile qualifier on a local variable was missing, found by inspection: actual impact not determined. - Listener was sending error traces to *stderr* stream instead of the listener's configured output stream; that was causing confusing output sometimes. TXR 154 2016-10-15 Features - OOP: - Functions method and umethodk, and the macros meth and umeth, now take additional arguments which are curried into the method call. - Regex: - In the regex abstract syntax, the and and or operators are now n-ary, rather than being strictly binary. - New regex-from-trie function. - Listener: - New Ctrl-X Ctrl-P feature to paste the result of the previous evaluation into the current command line. - Time: - time struct supports gmtoff and zone fields, on systems where these are available in the C struct tm. - Hash tables: - the hash user data is now included in the printed notation for hash tables; thus, hash literals can specify user data. - new hash construction keyword :userdata supported alongside :equal-based and others, so hashes can be constructed with user data in various situations. - New function hash-userdata is an accessor (serves as a place); get-hash-userdata is deprecated. - Sockets: - address structures (sockaddr, sockaddr-in, sockaddr-in6, sockaddr-unix) now all have a family slot, so programs don't have to switch on the object type to map to a numeric address family. Bugs - Bugfix in argument handling affecting struct method calls. - Listener: - Fixed bug in Ctrl-X Enter (submit historic line and stay in history). - If the line being submitted is a duplicate, it would not submit the line, and the position in history wouldn't advance to the next. - OOP: - Fixed various situations in which abstract sequence objects (object supporting car, cdr and nullify methods) didn't work as expected. - for instance: length, sub and where functions. TXR 153 2016-10-07 Bugs - GC-related regression in static-slot-ensure fixed, affecting code which uses defmeth also, causing instability. - Fixed long-time GC-related issues in replace-struct and clear-struct which threaten stability. - Check for self-assignment in replace-struct. TXR 152 2016-10-04 Features - Licensing: - All license headers in source files reverted to BSD 2-Clause, not just the LICENSE file. - OOP: - Inheritance model for static slots has been revised. This is also a bugfix. - Range objects support a degree of arithmetic, and can be queried with zerop, length and empty. - Regexes: - Improvements in search-regex function and functions based on it: support for negative indices and more. - New rr function: regex search which returns a range, like range-regex, but better interface for currying. - New rra function: return all regex matches as range objects. - Awk macro: - New convenience clauses :set and :set-file, to reduce the verbosity of (:begin (set fs ":" ofs ":")). to just (:set fs ":" ofs ":"). Bugs - Interactive listener: - VT100 arrow key can be issued after Ctrl-X extended mode prefix: cancels the Ctrl-X and is carried out. - OOP: - New static slot inheritance model fixes issues like method redefinition with (defmeth ...) inappropriately clobbering overridden derived methods differing from the original method being redefined. TXR 151 2016-09-27 Features - Licensing: - TXR returns to unmodified BSD 2-Clause - Better code generation for simple cases of place mutation. - Regex facelift: - regex objects are callable like functions. - Support for negative start or end positions in regex matching operations. - regsub function takes functional argument for more flexibility. - Numerous new convenience regex functions: m^, m$, m^$, r^, r$, r^$, f^, f$ and f^$. - these simulate full matching and anchoring in various situations. - New regex-source function, for obtaining a regex's original AST. - Awk macro: - conditions in cond-action clauses and in (rng start-cond end-cond) expressions can be functions or regular expressions, which are invoked on the record. - New fconv conversions: iz, rz and others which yield a zero value for empty, nonexistent or junk fields. - orec variable provides access to original record, useful when rec has been modified. - rs variable can be dynamically changed now, taking effect for the next record. - paragraph mode implemented based on POSIX description and observations of GNU Awk behavior. - Library: - New functions tointz and tofloatz. - New build macro for procedural list building. - New *load-path* special variable replaces the self-load-path symbol macro (which still exists but simply expands to *load-path*). - load is now a function rather than macro. - @(load)/@(include) directives now pull parent path from *load-path* variable, rather than own source location. - loading uses stricter criteria for deciding what relative paths are automatically resolved relative to *load-path*. - Streams: - New strlist input streams: treat a list of strings as multi-line text stream. Bugs - Awk macro: - fixed broken updating assignments to awk variables, such as (push item f). - awk now exits if there are no cond-action clauses. - Regex: - match-regex function now returns match length as documented. - Broken return value of match-regst fixed. - Type of a regex object is now regex, rather than sys:regex. - Exception in pretty-printing a correct expression, due to bug in handling the & operator. - Lists: - out-of-range negative indices over lists now yield nil rather than the first item. - Command line: - -Dvar=val binding are now visible to Lisp files. TXR 150 2016-09-18 Features - Awk macro: - New ft variable to optionally specify field tokenization as alternative to field separation via fs. - New kfs variable to arrange for field separators to be retained and represented as fields. - New krs variable to keep record separator matched by rs as part of record. - New fconv operator for succinct and flexible conversion of awk fields. - Don't rebind *output* if :output clause not specified. - New place-mutating macro: upd. - New keepq, keepql and keepqual functions. - Functions remq, remql and remqual take key argument. - split-str take boolean arg to keep separators, like tok-str. Bugs - Fixed incorrect behavior of functionsremq, remql, remqual, remove_if, and keep_if on strings. - Fixed broken regex complement operator. - Fixed broken while* and until* macro expanders. - Fixed bugs in split-str and tok-str. - Windows: - TXR's standard input, output and error will now be text streams, CR-LF externally. - This comes from a fix in the Cygnal library being picked up into the installer package. - Interactive mode uses USERPROFILE env variable for location of home directory for edit-in-editor feature. TXR 149 2016-09-12 Features - Implementation of Awk paradigm in Lisp syntax, in the form of awk macro. - TXR programs can now integrate the strategies used in Awk as part of their logic. - Awk one-liners from the command line possible. - New place-mutating operators: - pinc and pdec provide post-increment and post-decrement. - test-set, test-clear and compare-swap provide a conditional update of a place with useful return value. - test-inc and test-dec provide increment combined with a test of the value. - New slet and alet macros - companions to rlet, providing more aggressive ways than rlet for eliminating unnecessary temporary variables in macro expansions. - Change in trim-str function: what it considers whitespace. - Doc improvements: - Formatting problems. - Table of contents display issue under Chrome web browser. - meta-keywords now italicized in nroff man page output, allowing them to be colorized via customizing the less pager. Bugs - Fixed regression: @(rep) wrongly complains about an empty clause when it's not in fact empty. - Workaround: use @(coll) or add parameters inside @(rep). - Fixed bug in nthcdr defplace: not obtaining macro environment in valid way, breaking the test whether the list argument is a place. - Fixed symbol macros not being expanded in the X position of (set [X i] Y) and related situations. - Fixed semantic issue in the expansion of place macros. - Place macro calls are put only through at most one round of regular macro-expansion before being tested again for place macro expansion. - This allows macros to produce place macro calls. - Changed order of calls to :postinit handlers in struct instantiation: base first, then derived. TXR 148 2016-09-01 Features - time-parse function - time-string and time-parse methods on time struct - optimization added to quasiquote expander to generate better code. Bugs - Broken defvarl and defparml marking variables special, thus behaving like defvar and defparm, respectively. - Put limit on numeric range of @ arguments in op/do syntax, because this generates huge formal parameter lists. Found by AFL(fast) fuzzing tool. - Fixed generation of huge lists by trivial cases of nested quasiquote like ^^^^^^^^^^x. Found by AFL(fast) fuzzing tool. - Fixed runaway recursion that can occur in lazy struct initialization when cycles are present. - Fixed broken Lisp macro expansion in @(if) and output-side @(repeat) directives. - Rewrote poor, incorrect documentation of @(merge) directive. TXR 147 2016-08-12 Features - 64 bit Windows/Cygwin port. Bugs - Fixed native Windows TXR trying to use HOME environment variable when run from Cygwin. TXR 146 2016-07-20 Features - Time and space optimizations in execution of NFA regexes. - POSIX uname function exposed. - Print syntax which looks like their read syntax implemented for quasistrings and quasi-word-list literals. - Windows version ships with Cygnal 2.5.1.99 for better windows native support. Bugs - Text streams are not open with stdio "t" mode on Cygwin. This was a mistaken change present in 144 and 145. TXR 145 2016-07-03 Features - The Windows installer version of TXR is now packaged with the Cygnal DLL, which is the result of a new project: http://www.kyheku.com/cygnal. Bugs - Fixed crash in getaddrinfo when host is not found. - Issues in Windows version fixed by Cygnal project: - Fixed unwanted console window suddenly popping up when the console-less txr-win spawns a process. - Command spawning (sh function, open-command) doesn't require sh.exe shim executable any longer to switch to cmd.exe. - Fixed issue of messed up REPL display in multi-line mode, when lines reach the right edge of the display. TXR 144 2016-06-29 Features - TXR bids adieu to MinGW: the MinGW-based port to Windows is dropped. - Now that Cygwin is under the LGPL, the installer-based TXR for Windows is based on the Cygwin version of TXR, and includes all the required DLL's. - The benefits are great: the Cygwin port of TXR is much less crippled, thanks to the excellent POSIX support in Cygwin. - The interactive listener now works! - Improvements in the support for treating structs as sequences. - New --free-all command line option to get TXR to free all malloced memory before exiting. - Improved semantics of makunbound function: more similar to Common Lisp. - @(collect)/@(coll) take a :counter parameter now, with an optional starting value, for more streamlined enumeration of collected values. - Most TXR-style expression evaluation in the pattern language replaced by Lisp evaluation, reducing the need for @ noise. - Improved Valgrind support in garbage collector: Valgrind backtraces can be printed for interesting objects. Bugs: - Regression fix: @(catch) and @(finally) clauses can be empty once again. - Various memory leaks fixed: in handling of bignums, in syslog streams, dgram sockets and in the Lisp parser object. - Fixed out of bounds memory access in bit function. - Fixed broken (del (symbol-value 'sym)). - defsymacro removes existing special marking from symbol. - Fixed potential crash caused by bogus stray code in the GC marking function for syslog streams. - Fixed possible object leak in GC by managing free list in more disciplined way. TXR 143 2016-06-04 Features - Structs: - Structures can now support custom pretty-printing via a print method. - car, cdr, nullify, and from-list methods on structures allow them to behave as if they were sequences. - TXR Pattern language: - The "!command" and "$dir" convention for opening command pipe and directory steams has been removed: this will not be recognized on the command line or the @(next) or @(output) directives. - The "-" convention for denoting standard input is now only available from the command line, not from the @(next) or @(output) directives. - @(output) now evaluates the destination as a Lisp expression; no need to use the @ escape. - @(repeat) sees variables in more places: - In the output variable syntax @{a b [c..d]}, if b, c and d are variables, they are recognized by the directive and treated accordingly. - Previously @(repeat) would know about a, but have to be informed about the others via :vars (b c d). TXR 142 2016-05-29 Features - The remove-path funtion takes additional Boolean argument to suppress exception. - Better reporting of expansion locations across expansions of the op, do and related macros. - Support for deploying stand-alone executables. - Optimizations in hashing. - Support for byte-oriented stream operation instead of UTF-8 decoding. Bugs - Bugfix in clumped option processing: test case -B-c. - Uses of POSIX sleep function were removed. These occurred in tail streams implementation. This function can interact with the SIGALRM signal. - Fixed broken argument defaulting in take-until function. - Fixed regression from TXR 42 (!) in pattern function argument passing. This bug has evaded detection for 100 public releases, over 4.5 years. - Added support for adherence to ISO C rules regarding switching between input and output operations on update streams, hiding this issue from TXR programs. This seems to be needed on all tested platforms other than the GNU C library. TXR 141 2016-05-20 Features - Support for Unix terminal handling (termios). - New functions at-exit-call and at-exit-do-not-call, for registering actions to take when process exits. - New self-load-path symbol macro, allowing code to interpolate its load location. - Interactive listener now supports two behavioral styles of visual selection, controlled by new *listener-sel-inclusive-p* variable. Bugs - Incorrect argument defaulting in record-adapter function. - Incorrect argument handling in - and / functions, triggering error in [[flipargs -] 2 1] - Fixed gc-related bug in structs. - Fixed gc-related bug in recent cons recycling optimization. TXR 140 2016-05-08 Features - New fixnum-min and fixnum-max variables. - Improvements in pseudo-random number generator. - TXR extraction language: - New @(call fun ...) directive provides indirection on pattern functions, via symbols. - Unix security: - added setgroups, getresuid, getresgid, setresuid and setresgid where available. - added the setgroups function, where available. - added support for setgid operation. - New --rexec option to help with setuid on some platforms. - Process execution: - The standard input, output and error descriptors of subprocesses are now derived from the current *stdin*, *stdout* and *stderr* streams, making useful redirection tricks possible. - TXR now correctly calculates its sysroot even if the executable is renamed (within the same directory). - New filesystem access testing functions: path-readable-to-me-p, path-read-writable-to-me-p, path-strictly-private-to-me-p. Bugs - Serious bug fixed in bignum integers: incorrect treatment of negative values at the boundary between fixnum and bignum. - Fixed issue of TXR binary requiring an executable stack on GNU/Linux platforms. - Fixed broken setuid privilege dropping. - Bugfix in path-writable-to-me function. - Fixes in Vim syntax highlighting definition. - self-path, *args* and *args-full* now have bindings in the listener. TXR 139 2016-04-23 Features - Change of rules regarding Lisp variable visibility in TXR Pattern language. - unget-char now allows more than one character of pushback. - The POSIX fnmatch function is now available. - Rules used by object printer for deciding which character objects and string constituent characters to print using hex escapes have been harmonized together, with some changes to both. - path-private-to-me function avoids making unnecessary call to getgrgid, which is somewhat heavy-weight. - A list can now be passed as the path argument to the ftw function; it will recurse over it. Bugs - Issue of certain macros not expanding in @(output) blocks. - Macro not expanding as argument of @(if) directive. - Newline not being allowed in string fed to regex-parse. - Broken unget-char operation over string input streams. - Rewrite of horribly broken read-until-match function, which also fixes broken record streams feature (record-adapter function). - Fixed optional argument in get-string not defaulting properly. - Out of range character escapes are diagnosed better. - regex-parse was silently returning nil upon syntax errors; now throws exception. - regex-parse was not handling non-UTF-8 bytes in the string: are now mapped to U+DCXX block now and incorporated as literal characters. - Numerous memory leaks fixed which could occur in various functions if a type mismatch exception occurs after some local resource has already been allocated. TXR 138 2016-04-16 Features - New accessor sock-set-peer, and sock-peer becomes an accessor so (set (sock-peer sock) addr) is possible. - Allows "soft connected" datagram sockets: - send to different destinations with same socket by altering sock-peer address. - Dot position in function calls is now defined in terms of transformation to apply: - dot position expr can now be a symbol macro. - value of dot position is no longer applied as a list of arguments if it is a non-list sequence. - Better tracking of form expansion origins, leading to improvement in error diagnostics. - New fmt function for terse formatting to a string, shorthand for (format nil ...). - New open-socket-pair function, providing access to socketpair. - proper-listp function now known as proper-list-p. - old name still there, but deprecated. - New obtain* and obtain*-block macros. - New ftw function for fire tree walking, providing access to POSIX nftw. Bugs - Fixed issue in the UTF-8 encoding of Unicode strings, which TXR uses when calling API's that require char * strings: - U+DC00 pseudo-null produces the NUL character, which appears to terminate the char * string even if more characters follow, which is a problem. - Now, if U+DC00 occurs in a string that is being converted to UTF-8, an exception is thrown. - "Abstract" UNIX socket addresses properly supported on Linux. - defstruct: - now diagnoses use of nonexistent struct as supertype. - also fixed some minor diagnostic issues in defstruct. - symbol macros: - replacement forms were wrongly being expanded at bind time, and then possibly again at sustitution time. - now replacement forms are only macro-expanded during substitution. - glob function: - error callback hardened against continuation capture, absconding exits and re-entry of glob. - non-local exits allowed from error callback. - possible memory leak fixed. - Access to lib-version variable wasn't triggering its auto-load. - Fixed broken argument handling in umethod, also affecting umeth macro. - Invalid open mode strings in socket functions now diagnosed. - Fixed broken error handling in datagram case of sock-accept. - Source files processed by the load function, @(load) directive or by invocation of txr are now closed immediately after parsing. - TXR language: - fixed bug in data source opening logic leading to a mishandling of a case like @(bind x "a")text at top of script. TXR 137 2016-03-30 Features - Heads up: @(if) directive changes semantics. - no longer a syntactic sugar for @(cases)/@(require). - Rightmost-match variants added for various search functions: rfind, rpos, rmember and numerous others. - New macro lset for assigning consecutive elements of a sequence to multiple places. Bugs - Fix in lazy string implementation: - printing lazy string was not observing the string's limit - see limit-count param in lazy-str function. - Fix in error location reporting across macro expansions. TXR 136 2016-03-20 Features - I/O stream mode handling improvements: - "i" interactive mode specifies line buffering - New "l" and "u" mode letters for specifying line buffered and unbuffered mode on streams. - Decimal digit character in mode string specifies stream buffer size as a binary exponent with implicit 1024 multiplier. - Mode strings have a more permissive syntax; everything is optional with defaulting based on stream type. - Sockets: - sock-connect returns socket instead of useless t value. - New functions sock-recv-timeout and sock-send-timeout for setting the timeout options on socket. - I/O timeouts throw exception of type timeout-error - sock-connect and sock-accept have new parameter for timing out. - socket open mode is r+b by default, not r+. - TXR Extraction Language: - @(output) destination can be a stream object now - @(repeat) and @(rep) can now bind new variables, via extension to :vars syntax and semantics. Bugs - unget-byte sets errno to zero to avoid false errno association with failure. - Bugfix in @(repeat)/@(rep) internals: destructive manipulation of lists. - Tail streams honor all aspects of mode for re-opened stdio streams. TXR 135 2016-03-10 Features - The umask function is now provided. - Special new stream type for datagram sockets, allowing datagram programming to be very similar to and in some cases identical to stream socket programming. - A nil value in setenv now does unsetenv. - Improvements in sockets: - printed representation of sockets. - error messages. - error handling. Bugs - The get-string function closing a stream when told not to via a nil value of the close-after-p optional argument. - The setenv function had a similar bug, ignoring the overwrite-p optional argument being passed as nil. - Fixed cases of an incorrect error string from file streams returned by get-error-string. - Fixed gc-related instability caused by mishandling a field in an internal parser structure with regard to the ephemeral gc rules. TXR 134 2016-03-01 Features - Unhandled exceptions now unwind; so programs which terminate due to an unhandled exception have their cleanup performed. - Setuid support: - A setuid TXR executable supports setuid TXR scripts, even if the underlying OS doesn't allow setuid scripts. - When not running a setuid script, the setuid TXR executable drops privileges early in its execution, reducing the risk that it can be exploited. - New --eargs option, allows script name to be embedded among options in a hash bang line. - Networking support: TXR now supports IPv4, IPv6 and Unix socket communication. - Useful @(next nil) variant of @(next) directive to suppress unwanted treatment of a command line argument as a data source. - New functions expand-left and nexpand-left. Bugs - Expressions in @(require) were not being evaluated in the correct context. - Fixed destructive append behavior in append-each. TXR 133 2016-01-21 Features - New function, split*; like split* but keep empty pieces. - New function random-state-get-vec to get vector representation of random state. - vec-list now takes sequences as inputs, not just lists. - New functions base64-encode and base64-decode. Bugs - Bug in env-hash with values containing equal sign. - Bugfixes in partition* function. - More robust handling of invalid modulus values in rand and random. - Internal fixes in rand and random. - Serious regression in get-char on string input streams. - Missing syntax highlighting for some TXR symbols. - Bug in signal handling (synchronizing cached signal mask with OS signal mask) causing signals to be ignored after jumping out of a signal handling lambda with a dynamic control transfer. TXR 132 2016-01-16 Features - Unix crypt function exposed. - The identity function gets an alias named "use", for a readability improvement in certain functional coding scenarios. - The / function becomes n-ary, allowing forms like (/ 12 3 4). - New :mandatory keyword in until/last clauses, makes them a required match. Bugs - Fixed lack of location info for unbound variable error in dohash. - *print-flo-format* variable was affecting output of integers. - @(gather :vars ()) was behaving the same as @(gather); that is, as if :vars wasn't specified at all. TXR 131 2016-01-13 Bugs - Configuration with --valgrind now builds again. - Invalid lazy string optimization introduced in TXR 118 has been re-worked. This affects the conformance of the @(freeform) directive to documentation. - When a macro declines to perform an expansion by returning the :form, the form was recorded as its own macro ancestor; now, nothing is recorded. - Fixed issues in how regex objects are printed: - Control characters and certain other characters were being dumped literally. - Now certain characters like newline print using the escape codes like \n. - Other control characters, as well as U+7F (ASCII DEL) and characters in the U+DCXX surrogate range are printed as hex codes. - [ and ] in a character class are properly escaped. - Fixed issue in string literals: semicolon character effectively disappearing after control character that is converted to hex escape. TXR 130 2016-01-05 Features - Interactive listener: - New Ctrl-X Enter command: submit line, but stay in history and advance forward by one line. - I/O: - New record-adapter function creates a "stream adapter" virtual stream object based on an existing stream. - The adapter changes the semantics of get-line to support delimiting of records via a regular expression (which is stored in the adapter), rather than the newline character. - With this, TXR can now process streams delimited in alternative was as if they were line-oriented. - New read-until-match function: extract characters from a stream, accumulated into a string, until a match for a regex occurs in that stream, and discard the match. - OOP: - In defstruct, function slots now initialized before other static slots regardless of order of specifiers. - Library: - New chr-digit and chr-xdigit functions: like chr-isdigit and chr-isxdigit, but returning the digit value instead of the t symbol. Bugs - Interactive listener: - Fixed recent regression in Tab completion: missing completion on special operators and macros. - Fixed Ctrl-X commands not recognized in a history search. - OOP: - Access to static slots of a lazy struct was triggering instantiation; this is fixed. - Library: - Recent change in chr-isdigit and chr-isxdigit return value semantics has been reverted, due to potentially breaking code which relies on (eql (chr-isdigit #\0) (chr-isdigit #\1)). TXR 129 2015-12-30 Features - TXR pattern language: - @(line) directive now works in horizontal mode - New @(data) and @(name) directives for capturing/matching raw data, and name of data source. - :counter in @(repeat)/@(rep) can now be given a starting value. - Quasiliterals in the pattern language are now evaluated as Lisp quasiliterals. - the compatibility mechanism provides the previous evaluation mode. - The same applies to @(output): variables now follow Lisp rules, similarly to variables in quasiliterals. - @(repeat) and @(rep) now "see" Lisp globals; no need to list these using :vars. - Lisp library: - chr-isdigit and chr-isxdigit now return the integer digit value when the test is true, rather than just t. - Object printing: - Lazy strings are now printed in a reasonable way, not shortened to the # notation. - New special variales for global control over how floating-point objects are rendered: *print-flo-format* and *print-fo-format*. - OOP: - with-slots macro added. - Yet improved location and macro ancestry tracing in unhandled exception diagnostics. Bugs - Vim syntax highlighting files: fixed regression in genvim.txr causing missing identifiers. - Four-year-old bug in @(collect)/@(coll) fixed, causing the @(last)/@(until) clauses to be evaluated with an empty list of variable bindings whenever the main clause fails. - Fixed exception in @(freeform) directive when scanning from an interactive input stream. - Bugfixes in pattern language debug tracing (-v). TXR 128 2015-12-19 Features - Further refinement of function and macro coexistence: - symbol-function, fboundp and fmakunbound operate only on function binding. - new symbol-macro function. - The :whole and :form parameters now accept a destructuring parameter list as their argument, no longer insisting on nothing but a symbol. - OOP: - defstruct now supports a :postinit slot specifier, which allows additional actions to be taken after an object is constructed, and the slots are fully initialized. - make-struct-type has a new argument related to the above change: a function. - Place manipulation macros now propagate ancestry information from the place forms on which they operate to the generate place-accessing operations, as if those operations were macro-expansions of the places. (Which they are not, at least not exactly). The benefit is that errors in those place access operations can consequently be traced to the original place forms, for more meaningful diagnosis. - dot notation like a.b.c now prints back as a.b.c rather than (qref a b c). - Doc: - HTML section numbers are now hyperlinks which jump back to the right place in the table of contents. - On jump-back, the table of contents expands sufficiently to reveal the target entry, if that is not already showing. Bugs - Fixed incorrect behavior of (replace seq val nil), also affecting replace-list, replace-vec and replace-str. The nil was wrongly treated as as a zero argument (acting in complement to a missing denoting the end of seq), instead of an empty . - Fixed broken assignment to [h x] when h is a hash and x is a vector or list. - Fixed dot syntax like a.b not recording source location info into the (qref ...) form when its constituents are atoms, such as symbols. - Fixed neglect to propagate macro ancestry information across non-macro code transformations. - Fixed situations in which the debugger fails to report the source file and line number. - Fixed annoying debugger behavior of stepping through the macro expansion time evaluations of a query by making that behavior subject to a new option (--debug-expansions). Debugger will now stop on the first line of the TXR language query like it used to. TXR 127 2015-12-10 Features - OOP: - defun can define methods now, using a compound naming syntax, as alternative to defmeth. - func-get-name function works on methods and produces compound name. - defmeth returns compound name, and so does defun when defining a method. - improved semantics in static-slot-ensure - Large file support: TXR now uses 64 bit file offsets in functions like seek-stream and truncate on Linux platforms where this is a compile-time switch. - regex-range now returns a range object. - Macros: - Improvements in macro expansion tracing for unhandled exceptions, or those caught in the REPL. - New macro-ancestor function for programmatically retrieving the form from which a given form was derived by macro expansion. - New mboundp and mmakunbound functions for inquiring about and removing a global operator macro binding. - Global operator macros can now coexist with functions of the same name. - Doc: - HTML man page now has a collapsible table of contents, thanks to Javascript embedded in the document. - Sections have been reorganized. - Smattering of corrections. Bugs - Fixed new struct types failing to inherit static slots that were added to ancestor types using implicit or explicit use of ensure-static-slot (such as methods defined outside of defstruct). - Fixes to the anaphoric ifa macro: the condition can be a dwim form, and with special handling. - Fixed incorrectly implemented less comparison for range objects. - Fixed crash in get-line when invoked on a closed file stream. - Fixed ftruncate not being detected and used on Solaris. TXR 126 2015-11-29 Features - New functions window-map and window-mappend for filtering sequences with a sliding window context surrounding the current element. - New macro define-accessor for easily extending functions to be accessors (supporting assignment). - Diagnostics for unhandled exceptions, and those caught in the REPL, now include a detail trace of the macro-expansion which created the form in which they originate. - Increased stack size on Windows (MinGW and Cygwin). Bugs - Regression in super function: when called with a struct instance, was returning its type rather than supertype. - Incorrect behavior (failure) in split and partition functions when index argument is a function, and returns nil. - Fixed regression in transpose function, causing it to be destructive. - Fixed sethash: it was returning a boolean rather than the stored value, as documented. - Improved clarity of error messages which identify destructuring mismatches in macro calls and macro-like binding constructs. - Fixed poorly informative diagnostic when defmeth is used on a nonexistent struct type. TXR 125 2015-11-20 Features - OOP improvements: - New uslot function and usl macro for functional indirection on struct slots. - New functors feature: define a lambda method for struct types which lets structs be invokd as function. - Lazy structs feature: - New lnew macro (and make-lazy-struct function) for lazily instantiating a new structure. - Self-referential, and mutually referential structures can be instantiated in one step using the existing mlet and lnew. - New Equality Substitution feature: - An equal method defined on a struct type allows objects to to be compared with equal or less, and to be hashed with hash-equal (and thus :equal-based hash tables). - The method simply returns an object which is used in place of the struct for the purpose of the comparison or hash. - TXR Extraction Language: - @(rep) now available as shorthand for @(coll :vars nil) - In @(next source), source can be a Lisp expression without leading @. - :to_html and :from_html filters now called :tohml and :fromhtml; old names will continue to work. - :tohtml filter now also translates ' (ASCII 39 apostrophe) to '. - New :tohtml* filter, leaves quotes alone. - New butlast function. - New html-encode* function. - The last function is generic now, applying to strings and vectors. - New TXR_COMPAT environment variable, alternative to -C option. Bugs - Fixed missing autoload registration for meth, umeth and defmeth symbols. - Fixed spurious retention issues in various library functions like mapdo, preventing them from processing lazy lists in constant memory. - Fixed type hole in the equal function, which treated two COBJ objects of different types using a comparison function which assumes they are both of the same type. - Fixed buggy less function, which was comparing and ranking objects that should not be comparable according to the documentation. TXR 124 2015-11-14 Features - New iread function for reading an object from a stream in an interactive-friendly way. - Median-of-three pivot selection added to quicksort to avoid degenerate cases. - Scoping rule for implicit nil block in the for operator has changed: the block now surrounds the variable initialization forms. - New block* operator and functions return* and sys:abscond*, which allow blocks to be defined and referenced using symbols computed at run-time. - New function group-reduce for flexible decimation of a sequence to a hash table. - The (rcons x y) syntax is printed as x..y now. - nreverse handles strings and vectors now, and reverses them in place. - reverse handles vectors and strings in more efficient way, and can reverse lazy strings. - Functions revappend and nreconc added. - New *print-flo-precision* special variable for controlling precision applied when printing floating point objects. - New *print-base* special variable for controlling base in which integer objects are printed. (Only binary, octal, decimal and hex are supported.) Bugs - Fixed object printer throwing exceptions when meeting unexpected syntax in forms that have special printed notation like quote and whatnot. The correct behavior is to avoid the notation and print the raw syntax. - Fixed ~o format specifier, broken with respect to bignum operands in TXR 120, when ~b was introduced. TXR 123 2015-11-06 Bugs - Fixed regression introduced in TXR 115, in the search_regex function and functionality built on it. TXR 122 2015-11-05 Features - New type: range. - range is similar to a cons cell, but is an atom. - has two fields called from and to. - the dotdot syntax a..b now produces a range, not a cons. - printed notation looks like #R(0 10) - related functions: rcons, rangep, from, to. - sys:capture-cont API altered to call/cc style: passes continuation to specified function when capturing, returns value when resuming. - New interface to delimited continuations: suspend macro. - TXR pattern variables now appear dynamic to embedded Lisp expressions, rather than lexical. The scoping rule is documented. - The yield and yield-from operators can omit the argument form, in which case they retrieve the value passed in from the resume function without yielding an item. - Architecture support: Power PC 64. TXR 121 2015-10-30 Features - TXR Lisp now has delimited continuations. - easy to use via obtain/yield macro operators. - New function truncate-stream for truncating files. - Reduced stack usage on glibc systems by shrinking unwind frames, achieved by replacing the 128 byte wide sigset_t type with a much smaller type. - The way place macros are expanded has improved, making them more useful. - Macro parameter lists have a :form keyword now for capturing the whole form. Bugs - Implemented missing second argument of zap macro. - Assignment to *listener-hist-len* in ~/.txr_profile was not correctly taking effect prior to loading history, causing truncation to 100 lines. - Fixed typo causing with-hash-iter macro not to autoload. - Fixed crash in hash-next. TXR 120 2015-10-18 Features - Structs: - Finalizers (specified by :fini) are now registered early in the object initialization (at a given inheritance level). This allows finalizers to clean up abandoned initializations. - If initialization of a struct is abandoned, the finalizers are invoked immediately, as part of unwinding. - New defmeth macro for defining methods outside of a defstruct. - New static-slot-ensure function for adding a new static slot to a struct (and its inheritance descendants). - static-slot and static-slot-set can take struct type name in place of struct type. - New functions hash-begin and hash-next, for iterating hash table, and with-hash-iter macro. - Listener: - TXR now launches listener if no arguments are given. - Exceptions: - New way of handling exceptions without unwinding: handler-bind and handle operators. - Introspection over exception frames: get-frames and find-frame functions can inquire about frames, and invoke-catch can transfer control to a chosen catch frame. - New ~b conversion specifier in format function for printing integers in binary. - The typecase macro has been added, similar to Common Lisp's. - Some functions have been renamed for consistency, but remain available under old names: list-vector -> list-vec, vector-list -> vec->list, chr-num -> chr-int, num-chr -> int-chr. - The sh function isn't implemented using the C library function system any more. Bugs - Fixed use of nonexistent functions in error handling cases of defstruct macro. - Fixed bug in the overflow check in the chk_grow_vec function, used by string-extend, the get-line function of many stream types, and string output streams. - Fixed unterminated format argument list issue affecting interactive listener. (Reproduced on Mac OS/X). TXR 119 2015-10-10 Features - Interactive listener: - New Ctrl-X Ctrl-R to insert entire previous line. - Word/Atom from previous line works relative to recalled history line. - New Ctrl-X Tab for substring-searching completion. - Empty loops can be interrupted by signals: (for () () ()) is now interruptible at the interactive prompt. - New umethod and umeth function for indirecting on a method in a way that is detached from an object instance. - Boa construction of structures can have optional arguments now. - copy and copy-str now copy lazy strings as lazy strings, rather than forcing to regular string. - New functions for sequence manipulation: take, take-while, take-until, drop, drop-while, drop-until. - New function ginterate for lazy generation which includes the terminating item. - New function expand-right for lazily generating a sequence in a roughly opposite way to a reduce-right reduction. - New function call-finalizers for explicitly invoking and clearing the registered GC finalizers for an object. - New functions clear-struct and reset-struct for clearing all slots of a structure to nil, or reinitializing a struct to default values, respective. - New function replace-struct for changing and slot contents and type of a struct to match an example object. - Missing promisep function added to test whether an object is a promise created by the delay macro. - New defex macro, to define exception subtype relationships out of TXR Lisp. (Previously available only in the TXR pattern language). - Also useful surrounding functions: exception-subtype-p, register-exception-subtype. - New macros for working with streams in lexical scopes: with-out-string-stream, with-out-strlist-stream with-in-string-stream, with-in-string-byte-stream, with-stream. - New with-objects macro for scoped finalization of objects, somewhat like destruction in C++. - Vim syntax highlighting file sets "lispwords" option for more accurate indentation of TXR Lisp. Bugs - Fixed symbol-function throwing error on builtin macros. - macro-time is now special-operator-p. - Named block around bodies of methods and functions declared in defstruct. - slot-p renamed to slotp (old name supported in compatibility mode). - Bug in structure initialization: boa arguments were applied first, before other initialiations, rather than last. - The conses function works on vectors and strings. TXR 118 2015-10-01 Features - Interactive listener: - Parentheses matching jump (Ctrl-]) now finds the closest parenthesis, bracket or brace if the cursor isn't on one already. - Tab completion recognizes .( and (( context in front of symbol being completed, and doesn't restrict to function names. - Parenthesis-matching "jump" is now performed on backspace also, if cursor lands on or next to a parenthesis. - Ctrl-A and Ctrl-E (or Home and End) keys have now have a useful behavior in multi-line mode, allowing a jump to the start/end of the current line as well as start/end of the edit buffer. - Optimizations in regular expressions: - In particular, prefix matches involving the complement operator now indicate termination rather than wastefully consuming the remainder of the string. - Algebraic reductions performed on regexes. In some cases, these reduce an expression which contains exotic operators such that it can be compiled to NFA. - Structures: - Structures can now have static slots: slots shared among all instances of the same type (but not other types, not even derived types). - Static slots are now the preferred the basis for implementing functions and methods. - The defstruct syntax has a richer syntax which lets static slots be expressed, as well as methods. - Construction and finalization code can be specified in defstruct. - Many new functions related to structures. - Optimization in lazy strings: forcing lazy strings is more efficient. - String input streams do not force lazy strings now. - The "matches nothing" regular expression represented in the abstract syntax by the object t now handled by regex printer, and rendered as []. Bugs - Fixed a silly delete-previous-word behavior in multi-line mode: not treating the line-break as a whitespace character that separates words. - Fixed various problems in screen update and cursor positioning behavior in interactive listener, affecting multi-line mode. - Fixed two bugs in the ifa/conda macros. - The return and return-from operators do not abort TXR when a label is not found, but properly throw an exception. - Garbage collection: if GC is triggered in response to a malloc delta, a full GC is now performed. This prevents runaway memory allocation behavior in code which manipulates large arrays, strings or integers. - Fixed strangely compounded error message issued in the situation that unbound variables occur in the TXR pattern language. - Various "internal error" situations in the regex module now throw exceptions. Consequently, TXR will not die if a bad abstract syntax tree is passed to the regex compiler. - Regex printer was throwing an exception when printing a character class containing \w, \s or \d. TXR 117 2015-09-23 Features - Interactive listener improvements: - Visual selection of text, with copy and paste: Ctrl-S, Ctrl-Q, Ctrl-X Ctrl-Q, Ctr-^. - Undo feature with separate undo per history line. - Security checks on ~/.txr_profile permissions. - Location reporting when exceptions caught. - Syntax errors pinpointed to line in multi-line entry. - Ctrl-X Ctrl-V "super verbatim" mode. - Temp file used by Ctrl-X Ctrl-E has .tl suffix now for correct syntax highlighting. - Ctrl-X Ctrl-W: insert word from previous line. - Ctrl-X Ctrl-A: insert atom from previous line - Delete to beginning of line or to end of line now limited to current physical line in multi-line mode. - Ctrl-X Ctrl-K to delete current physical line. - Visual Parenthesis matching works forward now as well as reverse. - Ctrl-] jump to matching parenthesis. - Unix group database functions added: getgrgid, getgrnam, getgrent. - New path-private-to-me-p function to detect whether a file is writable to users other than the owner. - New flatcar and flatcar* functions. Variants of flatten which handle improper lists and preserve nil atoms. Bugs - Correct tab alignment in multi-line. - Fixed screen untidiness on Ctrl-Z and Ctrl-C in multi-line mode. - sub function and [] indexing were not handling lazy string objects. - sub-str wasn't handling defaulted optional arguments correctly for lazy strings. TXR 116 2015-09-17 Features * Interactive listener improvements: * Ctrl-R reverse search has been implemented. * Tab completion now works anywhere in a line, not only at the very end. * Parenthesis matching: cursor jumps briefly to matching bracket, brace or parenthesis. * Multi-line mode, with proper history support for lines containing embedded line breaks. * Ctrl-C cleanly cancels completion, and navigation keys smoothly transition from completion to edit mode. * Ctrl-X Ctrl-E edits line in external editor. * Ctrl-Z suspend and Ctrl-L clear work in completion mode. * New :read command for parsing pasted material from terminal. * Dynamic resizing of the terminal is now obeyed (SIGWINCH signal). * A ~/.txr_profile file is now read on interactive start-up, and Lisp forms are evaluated from it. * multi-line mode and history length are configurable via special variables. * Removed arbitrary limit on regular expression size (number of states). * Small regexes are processed with a smaller memory footprint due to exact allocation of certain arrays and stack allocation is used in some cases instead of malloc. Bugs * Fixed memory leak of blank lines in listener. * Comment lines entered into the listener do not produce a syntax error and are entered into history. * Fixed memory leak in NFA regular expressions. * Fixed a counter wraparound bug in NFA regular expressions, resulting in incorrect operation after 4.2 billion state transitions (2**32 characters fed to the same regular expression, whether in a single job or across multiple jobs.) * Addressed some minor issues in unwinding and signal handling. TXR 115 2015-09-11 Features * Sixth anniversary edition! * New REPL on Unix platforms: an interactive listener with line editing, history recall, completion and exception/interrupt trapping. This is started with "txr -i". * Improvements in error reporting. * New function, raise, for raising a signal, eliminating the (kill (getpid) sig) workaround. * New functions subtypep and typep for testing subtype relationships between types, and between an object and a type. * New abstract types usable in conjunction with subtypep and typep. For instance, integer and number are types. A fixnum is a subtype of integer, which is a subtype of number. Type hiearchy documented in detail. * The printed representation of function objects is much more informative than before. * The variable *args* is now not only bound when evaluating Lisp expressions from the command line (with -e and related options) but it is also modifiable. Command line expressions can rewrite the remaining arguments by updating *args* and these arguments instantly take effect. * Some section restructuring in the documentation. * New functions for working with package objects: package-alist, package-name, package-symbols. Bugs - Fixed serious problem in implementation of signal handling: the function to manipulate the signal mask in a cached way wasn't actually calling into the OS to set the real signal mask. - Fixed another serious problem in signal handling: a Lisp function throwing an exception out of a signal handler would cause an imbalance in an internal signal reentry counter, causing later signal handling to stop working properly. - Fixed an assertion occurring in the Flex-generated scanner if the parsing of a stream is aborted by an exception, and then the parser is called again. - Fixed regression dating back to TXR 105: the TXR pattern language failing to use a "real-time" stream for standard input, when it is a TTY, thus breaking the specials upport for pattern matching into interactive input. - Removed an accidentally committed debug print, producing output in situations when a function is called with the wrong number of arguments. - Fixed (eval 'sym) reporting the unbound variable sym against the wrong source code location. - Fixed random state objects being of type *random-state* rather than of random-state. The earmuffed symbol was never intended. - The accessors fun, symbol-function and symbol-value were completely broken for use as syntactic places. - Fixed multiple evaluation of the slot argument when slot used as syntactic place accessor: (inc (slot x y)) now evaluates y only once, just like x. - Fixed another gaping bug in the finalization hook mechanism: objects being promoted into the tenured generation had their finalizers called while still remaining reachable. - Fixed the self-path variable not being bound when evaluating Lisp code from a .tl file or command line arguments like -e. - Fixed *args* not being bound when evaluating Lisp expressions from the command line with -e and related options. - Fixed missing :tointeger filter. It was actually registered under the misspelled keyword symbol :toinger, and never existed as :tointeger. It has actually been renamed to :toint. TXR 114 2015-09-03 Features ! Note: TXR code base converted to new way of handling variadic function (variable-length struct args, defined on stack). * New function shuffle: Fisher-Yates/Knuth on lists and vectors. * Numerous documentation improvements. * Improved diagnostic in situations when an error exception is thrown at code parse time, pinpointing file and line number. * New feature: structs! TXR now has typed data structures with named slots. Structures can be related by single inheritance, and single-dispatch OOP is easily expressed. * stat, lstat and fstat functions return a stat structure now. * New functions: time-struct-local and time-struct-utc return a structure instead of a list of fields. * Unix password database functions: getpwent, getpwuid, getpwnam. Bugs * Fixed regression: broken treatment of [hash x..y] place. * Fixed finalize function, which was found to be fundamentally broken. Advertized as a new feature in TXR 101, it now actually works. TXR 113 2015-08-20 Features ! Note: txr builds and works with Berkeley Yacc again. ! Note: txr is starting to make use of the alloca function. * regex-parse function allows unescaped slashes and treats them as verbatim characters, in recognition of slash delimiting being needed only by regex literals. * Better argument number mismatch reporting in certain indirect function call situations. Bugs * Serious quasiquote regression fixed (from TXR 110): function call syntax interpolated into a quasiliteral not working for TXR pattern language quasiliterals, when the function is called with exactly one argument; e.g. @(bind x `abc @(list 1)`). * Serious parser problem fixed affecting Lisp code being read from streams. The wrong kind of weak hash table was used to associate parsers and streams, causing a disruption when garbage collection kicks in, precipitating a false syntax error. * Nested meta-variable references now work in quasiliterals. If a quasiliteral is nested in two layers of op syntax, it can use notation like @@@1 and @@@rest to reach the outer parameters, and so on. * Minor spurious retention issues addressed (garbage collection). * Numerous markup errors fixed in documentation (thanks to Dave Love of Fedora Project). TXR 112 2015-08-14 Features ! Note: the ChangeLog is discontinued. Description of changes, going forward, is maintained in git commit messages only, in a hybrid format which conforms to ChangeLog and git conventions at the same time. ! Note: txr doesn't work correctly if parse.y is built with Byacc. GNU Bison must be used. This will be addressed in the next release, hopefully. - Support for display width concept: identifying Unicode characters which occupy two print positions on tty-like display and printing devices. - Indentation, and field formatting in the format function obey display width, rather than naive string length. - The new display-width function calculates the display width of characters and strings. - The a..b syntax is slightly revised; it can occur outside of a list now, and in the terminating position of a dotted list. It correctly associates, so that a..b..c denotes (cons a (cons b c)). - New function clamp for clamping numeric and other values to a range. - New "qref dot" syntax: a dot flanked by expressions and no whitespace denotes a new syntatic sugar such that a.b.c.d denotes the form (qref a b c d), and a.b.(x y).z denotes (qref a b (x y) z). However, this qref syntax has no assigned meaning yet (coming soon). Bugs - Regression in format function introduced in 111 is addressed: geneating superfluous left padding when formatting non-numeric fields. - Bad consing dot syntax like (a . b c) and (a . b . c) is properly diagnosed instead of silently producing strange (though consistent) results. - Tokens with a package prefix but empty name like abc: are correctly handled now by interning a symbol with the name "" (empty string) in the given package. - Fixed some minor bugs in lexical analysis of floating-point constants: actual behavior was interpreting as valid certain forms that were documented as erroneous. - Fixed stream close bug in catenated streams. TXR 111 2015-08-08 Features - Nested structural objects (list structure, vectors, hashes) are now printed with line breaks and indentation. - Introducing global lexical variables, introduced with defvar and defparml. Global lexicals are not marked special, and so local bindings of the same symbols are ordinary lexicals and not dynamic. - Numerous variables in the library are now global lexical rather than special. - pi and e are now provided as %pi% and %e%, global lexical. The *pi* and *e* specials are retained, and obsolescent. - New hash-revget function for reverse lookup through hash tables. - New function func-get-name for obtaining name from function. - New ~! format directive for controlling hanging indentation. - format conversions now support ^ character for centering within a field. - Output streams now support indentation. This is used by the object printer and by the ~! format directive, and also exposed by a group of new functions like set-indent-mode. - TXR Lisp documentation sections re-arranged for better organization, and other improvements in documentation. - Improvements in matching error exceptions to source code location, and some other diagnostic improvements. - New wrapper functions for Unix lstat and fstat for inquiring about the properties of symbolic links, and open files. - New Unix wrappers for uid/gid functions: getuid, setuid, etc. - New functions for conveniently testing for file existence, type, ownership and permission, and relative age. - Debugger won't step into auto-loaded library code now, unless requested with new --debug-autoload command line option. Bugs - Fixed parsing bug in txr-case macro: throwing error on correct syntax. - Discovered that an object initialization pattern believed to be correct is flawed in the face of generational GC. Fixed instances in hashing and regex module. - Documented special variable *args-full* is now actually implemented. It was implemented as *full-args*, which is retained, but obsolescent. - Operations on an output string stream which overflow throw exception instead of returning nil. - Fixed incorrect handling of negative field widths in format, when specified dynamically via *. TXR 110 2015-07-25 Features - New relational predicate functions hash-subset and hash-proper-subset. - New functions hash-from-pairs and hash-list. - Improvements in quasiliterals: - compound @@ now supported on numbers and symbols, improving utility of quasiliterals in multiply nested op syntax. - \@ escape introduced for encoding literal @ in quasiliterals. - @ notation allowed in brace variables (more of a bugfix). - Optional trailing semicolon punctuator supported on hex and octal characters in string and quasiliterals, like it already is on hex and octal characters in the TXR pattern language. - The op syntax positional arguments @1, @2 ... and @rest are now syntactic places: they can be assigned, etc. - Powerful new binding macros placelet and placelet* for creating lexical aliases for syntactic places with once-evaluation semantics. - The "it" variable in the anaphoric ifa is now a place if the form that it denotes is a place. The place is evaluated exactly once no matter how many times the it variable is accessed or updated in its scope. - Hash-bang support in .tl files. - With only a few sensible exceptions, most unimplemented stream operations now throw exceptions, rather than silently doing nothing. - Improved printed representation of stream objects. - New split function similar to partition, but keeps empty subsequences. - Deletion of a (cdr ...) place now has different semantics, symmetric with deletion of a (car ...) place. - The accessors caar, cadr, cdar, cddr, ... are all provided now, in all combinations down to five levels deep. - The functions second, third, fourth, ... are all accessors now, and are provided up through tenth. They work with vectors and strings. - New feature, "place macros": special macro expansions which apply only to syntactic place forms, making it a cinch to define to define new places in situations when they are expressible as a syntactic transformation to existing places. - The nthcdr function from Common Lisp is introduced, with the added functionality that it behaves like an accessor. - New with-resources macro for block-scoped acquisition and release of multiple resources. - Backslash-newline continuation in word list listerals (WLL-s) and quasiword list literals (QLL-s) now separates words. An unescaped newline is not allowed. Bugs - TXR 97 regression in quasiliterals fixed: `@{(expr) modifier}` ignores modifier whenever (expr) is an expression that undergoes expansion. - Fix in printed representation of a stdio stream. - define-modify-macro was not registered for auto-loading. - Fixed broken unget-char and unget-byte on catenated streams. - Fixed broken lexical analysis of consecutive top-level forms, like 4(x) where one call to the parser consumes 4(, so the next call sees x). - Fixed bug in print and pprint: wrong return value when printing a dwim form. These functions must always return their leftmost argument. TXR 109 2015-06-21 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. TXR 108 2015-06-13 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. - 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. 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. TXR 107 2015-04-26 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. TXR 106 2015-04-21 Features - New function tprint; like pprint but prints lists of strings as lines of text. - New stream opening option letter "i" for marking streams interactive. - New command line option -n which makes standard input noninteractive even if it is a TTY. - New command line option -P which is like -p but based on pprint. - New command line option -t for printing Lisp value using tprint. - Stream argument in get-lines is optional, and defaults to *stdin*. - The Unix fork and wait functions are exposed for use. - New function open-fileno for opening a stream on a Unix file descriptor, and fileno for retrieving a file descriptor from a stream which has one. - New functions dup (interface to Unix dup and dup2), chmod, exec and pipe. - New exit* function which calls _exit. - Added getenv, setenv and unsetenv functions for environment manipulation. - New operator zap for overwriting a place with nil, and returning its prior value: good for losing a reference to an object while passing it to a function, and other uses. - New whilet (while + let) macro for variable binding plus iteration. - New iflet and whenlet (if + let, when + let) macros for variable binding plus conditional evaluation. - New while* and until* loops which unconditionally execute one iteration. - New dotimes macro for simple iteration. - New lcons macro for writing expressive, concise code around lazy conses. - Brace variable notation can now contain quotes and quasiquotes. - Quasistrings can contain quasiquotes: `prefix @^(,x ,y) suffix`. - Fixed regression introduced in TXR 81, causing the argument parts of brace variables embedded in quasistrings to disappear. - The backslash in regular expressions can now only be used for recognized escape sequences, or for making regex special characters literal. If it is applied to any other character, it is diagnosed as an error. Bugs - Fixed stack array overrun in apply function. - The int-str function was recognizing the 0x C language convention in base 16 conversions. Also, an error is now thrown on bases outside of the range 2-36. - Eliminated nuisance error message issue from the Makefile about git not being found; git is properly detected in configure. - Streams opened on TTY devices are not automatically marked as interactive. This is done only for the *stdin* stream on startup. - The ~X specifier in format was printing in lower case just like ~x, for bignum arguments. - Addressed spurious retention (garbage-collection-related issue) in function application. - Parser now diagnoses trailing junk in hex, octal and binary literals, like #xAD0Z, #o7778 or #b011003. - Fixed character escaping issues in open-process on Windows. - Fixed bug in error reporting, causing TXR sometimes to report that an error was thrown out of a form, when it wasn't in fact that form. - Fixed bug in the printing of regular expressions: empty expressions like #// or expressins with empty subexpressions like #/a|/ would result in an exception. TXR 105 2015-03-14 Features - New function lexical-lisp1-binding for improved macro-time introspection of environments. - New functions pad and weave. - New regex functions search-regst, match-regst and match-regst-right, to complement search-regex, match-regex and match-regex right. - Improved error reporting, particularly for errors ocurring during the expansion of a macro. - Streams have persistent error state. New functions: get-error, get-error-str and clear-error. - New ignerr macro for trapping exceptions of type error, and converting them to a nil return value. - New function ensure-dir: creates a directory in the filesystem, with all parent directories also created as necessary, and doesn't complain if the directory already exists. Bugs - Bugfixes in append* function: lack of error handling and inappropriate forcing of infinite lists in some circumstances. - Bugfix in match-regex-right: zero length matches must return zero rather than nil. - Fixed memory leak in open-process and run on POSIX platforms. - Fixed memory corruption bug in run function on Windows platform. TXR 104 2015-02-08 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"). TXR 103 2015-02-02 Features - New functions lexical-var-p and lexical-fun-p allow macros to inquire whether symbols are known to the macro-expander as lexical variable or function binding. - get-string now closes the stream after obtaining a string. It has a new optional argument which can defeat the behavior. The -C option can be used to request the old behavior. - New function, constantp. - New functions callf, mapf, dup and flip for more power and flexibility in function-combining expressions. - New function width, for computing the bit width of signed and unsigned integers. - New function sign-extend, for converting an a two's complement bit field of any width into the corresponding integer value. - Windows executable (MinGW and Cygwin) now has an icon and meta-data like ProductVersion and FileVersion. - MinGW-based Windows build is now distributed via an executable installer instead of a ZIP file. Bugs - Fixed regression introduced in 102, in the fix to the make-like function. A one element list being converted to a string was treated as an empty list, leading to empty string. - Fixed small bug in macro argument list processing. The colon symbol was treated as "this argument is missing" for required arguments also, rather than just for optional arguments. - Fixed a bug in the code expander's handling of macro parameter lists. It was not recursing properly over nested patterns occuring in optional arguments, and throwing errors on keywords like :env present in the optional argument parts of macro parameter lists. TXR 102 2015-01-13 Features - merge function becomes generic: works over sequences rather than just lists. - New function glob is provided on platforms which have the Unix C library function of the same name. - New functions plusp and minusp. zerop accepts character argument. Bugs - Fixed incorrectly implemented horizontal flavor of the @(trailer) directive. - Fixed a bug in the make-like function which has consequences for the results of numerous sequence functions. This bug causes functions to return an empty list when the expected result is an empty string. For instance [mapcar identity ""] now returns "", consistent with [mapcar identity "abc"] returning "abc". Previously it returned nil. - Fixed a serious bug affecting the OS X port. The llvm-gcc compiler was discovered not to be consistently aligning wide character string literals on four byte boundaries, even though wchar_t is four bytes wide. As a workaround, a very similar trick is usd as what is used to handle literals on Windows, based on the assumption that we *can* depend on two-byte alignment. The bug leads to a failure of the OS X port of TXR to support the -p and -e options, for instance: txr -p '(+ 2 2)'. TXR 101 2015-01-01 Features - Finalization support in the garbage collector. Use the finalize function to associate a function with an object which is called when that object is found to be unreachable. - iff function can now be called with just one argument. - New function chand. - New macros opip and oand. - The min and max functions are more generic by using the less function instead of the < function. - The less and greater functions are variadic now. - Select accepts a function in place of the index list. - Arguments of where function reversed, with backward compatibility support. - New functions succ, ssucc, sssucc, pred, ppred, pppred for calculating small deltas. - New functions wrap and wrap* for clamping a number into a given range, with modular wrapping semantics. - New function sort-group for sorting and partitioning a sequence in a single operation. - New function in for generic membership testing over any kind of sequence or hash. - copy function extended to copy random state objects. - New function unique, which generalizes uniq. - New function aret: apply version of ret. - Build system improvements: debug and optimized TXR built at the same time, dependencies handled in a cleaner way, tidy make output. Bugs - Fixed incorrect registration of repeat function, lacking support for its optional argument. - Removed dependency on useless Flex library (libfl). - Overflow arithmetic fixes in some array resizing logic. - Incorrect argument defaulting in iff function - Garbage printed in type mismatch diagnostic in sub, ref, refset, replace, update and search_list. - Behavior of splitr-str was undocumented for the case of the empty separator string and was inconsistent. - The set-diff function was not handling nil elements. - The toint function identified itself as tofloat in error messages. - The toint and tofloat conversions conveniently treat a character as a string of length one. - Added missing documentation that make-random-state can take an existing random state and clone it. - Also, make-random-state was incorrectly doing additional scrambling after copying an existing random state. - Simple lazy streams now close a stream when it runs out of data. - Catenated streams close each stream that is popped from the list due to running out of data. - Fixed bug in replace-str and replace-vec: when the argument was an index list that was lazy and infinite, it was being forced, causing an infinite loop and exhaustion of memory. - The partition* function was found to be buggy. - Separate directory build issues fixed. TXR 100 2014-10-22 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. TXR 99 2014-10-05 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. TXR 98 2014-09-26 Features - New numeric constants giving pi, e and various limits of floating point representation. - New syntax-error exception type; syntax errors in expressions passed on the cmomand line with -p or -e throw exception how instead of silently producing nil. - New --gc-delta option and gc-set-delta function related to bugfix below. - New -C/--compat option for specifying compatibility. - New functions: partition and partition*. - Revamped documentation: nicely formatted with fonts and section numbering; HTML version uses proportional font now, and has internal hyperlinks. - Exception names like file_error have been renamed to use a dash like file-error. Bugs - Fixed bad memory performance when the program works with large heaped objects, by making GC aware of this memory. - Fixed broken return value semantics of orf and andf combinators. TXR 97 2014-08-29 Bugs - 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. TXR 96 2014-08-14 Features - Big change in pattern language in the variable binding logic. When unbound variables are followed by directives, then the full right hand context to the end of the line is used to determine the binding. - Internal functions related to tries exposed: trie-lookup-begin, trie-value-at, trie-lookup-feed-char. Bugs - Fixed bug in ret operator: was generating fixed arity functions rather than n-ary as documented. TXR 95 2014-08-07 Bugs - Fix major regression: bad syntax causing crashes in parser. TXR 94 2014-08-05 Features - New functions: giterate, partition-by, uniq. - reduce-left and reduce-right correctly work on strings and vectors. - quasiquote splices can now occur in string quasiliterals, directly as `xyz @,foo`, `xyz @{,foo}`, `xyz @,(foo)` etc. Previously this syntax was rejected, requiring workarounds like (let ((x ,foo)) `xyz @x`). - POSIX functions exposed: getpid, getppid, kill, setitimer, getitimer. - The parser is now re-entrant. This means that macro expanders can safely recurse into the parser, for instance with regex-parse or read. Bugs - @(output) blocks were discovered not to be applying filters to the results of embedded TXR Lisp evaluations. - n-perm-k function was broken for values of k equal to 1. - Fixed situations when exceptions with bogus messages are issued when the arithmetic +, - and * functions are called with wrong type arguments. - Fixed grossly incorrect documentation of the repeat function, to reflect actual syntax and behavior. - Fixed situations in which some signal handlers that don't need to execute on a separate stack might do so. - Put in a guard against async signal nesting: a situation when an asynchronous signal handler performs some blocking operation which enables async signal handling triggering re-entrancy. - Fixed platform-dependent behaviors in random number seeding (make-random-state function). TXR 93 2014-07-22 Features - New list munging functions interpose, mapdo, and juxt. - New macros caseq, caseql and casequal based on Lisp's case construct. - New math function log2 for computing base 2 logarithm. - New function get-lines for obtaining list of lines from a stream. Actually this is not new; it is a nice synonym for lazy-stream-cons. - New functions put-lines and put-strings. - Missing function lconsp added for testing whether an object is a lazy cons. - Documented existing function hash-construct. - search-str now supports a negative starting position, which counts from the tail of the string. - The division function / can now be used with one argument, denoting the reciprocal operation. Bugs - Bindings created using -D command line option are now visible to code executed via -e or -p later in the command line. - Fixed broken @(eol) directive; was behaving as a complete match, so that subsequent directives are ignored. - Obscure bug-fixes in @(do) and @(require), involving code that invokes pattern funcions, and the visibily of bindings. - Fixed hash-construct so it correctly works on an empty vector. - Alternative stack (sigaltstack) is now automatically used for SIGBUS handlers, not only SIGSEGV. TXR 92 2014-07-11 Features - New operators ado and ido. - New command line option --license. - Long overdue flet and labels operators for lexical binding in the function space, added as macros. Bugs - apf and ipf functions fixed. - Uninitialized variable bug fix in select function and in the index list case of replace-list. TXR 91 2014-07-02 Features - @(load `@stdlib/ver`) brings in a definition of a new variable called *lib-version* which lets programs check what version of the library they are using. - New functions where and sel for working with multiple indexes into a sequence. - New function seqp for testing whether an object is a sequence of any type. - New functions pos-max, pos-min, find-max and find-min. - New character constant #\pnul denoting the U+DC00 code (TXR's "pseudo null"). - New function tuples for reorganizing a sequence into tuples. - New functions true and false, expressive in applicative programming: for instance [all true list]. - New functions member and member-if. - New function multi for applying a one-sequence operation to parallel sequences. - New functions tf, nilf, retf, apf, ipf. - New macros ret, ip and ap. - New function iapply for applying improper lists. - New functions transpose and zip. - New functions tok-where and range-regex. - New function bit for testing bits. - [] indexing now allows element extraction by index list, as well as assignment by index list, increasing the "slicing power". Bugs - Fixed reliance on leading slash as indicator of absolute path in @(load). - Fixed breakage in range and range* function (regression introduced in TXR 89). - Fixed bug in dwim operator: Lisp-1 evaluation semantics being propagated into nested forms, contrary to documentation. - Line number of error correctly reported in some situations in which it previously wasn't. - Fixed macros not being expanded inside quasiliteral brace notation. - Fixed broken last function. - Fixed broken bignum bit operations, not handling negative values properly. - Fixed reversed logic of logtest function. - Fixed some memory leaks in MPI bignum integer operations. - Documentation fixes. TXR 90 2014-06-11 Features - TXR has been ported to FreeBSD 9 and Solaris 10. These operating systems are officially supported going forward. TXR's configure and build system has better portability support as a result. - call operator is a function now, like it should be. - Traling backslash in a dynamic regex is rejected as an error. - TXR no longer automatically prints out the bindings; this must be requested explicitly with -B. The -a and -l options now imply -B. The -b option for suppresing the automatic printing of bindings is deprecated. - New --args option, allows multiple logical command line arguments to be encoded in one physical argument which is useful in conjunction with very limited hash-bang (#!) scripting mechanisms on some systems. - New variable "stdlib" which expands to a path in the TXR installation. This will allow inclusion of standard modules. The stdlib variable automatically tracks relocation of the TXR installation. - New function for searching sequences for substrings: search. - New functions nullify and make-like for easily adapting list processing functions to correctly work on vectors and strings. - match-str function can now match from the end of a string, at various negative offsets. - New string comparison functions: str=, str<, str>, str<= and str>=. - string-lt function deprecated, replaced by str<. Bugs - rplaca and rplacd now return the cell rather than assigned value, and the return values are now documented. - Fixed a widespread bug which occurs when empty strings and vectors are treated as lists, due to the fact that they are not equal to the nil object. - Fixed completely broken string-cmp function, and changed its name to cmp-str. TXR 89 2014-05-11 Bugs - The eql function was not handling floating-point values correctly. - The range and range* functions internally use numeric comparison for end test rather than eql, so that they can step through floating-point values, but use an integer boundary, or vice versa. - Fixed broken default argument handling in get-line, get-char and get-byte. - The functions ref, refset, replace, and update (and the DWIM brackets syntax based on them) were not handling lazy strings. - Fixed a bug in the pattern language: when a variable ends up bound to the empty string, a literal empty string object was used, and that was not handled in the matching language. Best illustrated by the test case "echo : | ./txr -c '@a:@a' -". TXR 88 2014-04-04 Features - New TXR Lisp macros: while, unless, until. - New functions empty and last. - copy and length functions take hash tables now. - Word list literals and word list quasiliterals. - Big improvements in efficiency of generational garbage collection. Situations when a backpointer to a fresh object is stored into a mature object now are precisely identified, eliminating GC pressure caused by conservatively wrong guesses. - TXR is now configured to build with Generational GC by default. Bugs - copy and length functions handle lazy strings now. - time-string-utc on Linux now renders %Z strftime code as "UTC" rather than "GMT". Not our issue: this is a workaround for library behavior. - Generational GC fix: a number of functions which mutate state weren't using the proper set macro. - Generational GC fix: the gc_mutated function was not correctly implemented and could cause reachable objects with their GC reachability flag to continue to be set after GC is done. TXR 87 2014-03-22 Features - New convenience functions tofloat, toint: convert string or number to integer or floating-point. - New macro: when. Bugs - int-flo function was failing on negative numbers. - Fixed long-standing syntax issue: directives of the pattern matching language being syntactically recognized in the @(output) clause and in string quasiliterals, interfering with the ability to invoke Lisp forms based on the same symbols. This issue really "hit home" with the recent introduction of the @(if) directive, causing @(if expr then else) to suddenly be inaccessible in @(output) and quasistrings. TXR 86 2014-03-16 Features - Exposed the implementation of tries to user code. - New functions: html-encode, html-decode. - New prof operator and pprof macro for simple profiling: time spent and memory allocated over the evaluation of an expression. - New functions sh and run for running system commands. - If available, sigaltstack is used when the program registers a handler for the SIGSEGV signal, allowing TXR programs to catch stack exhaustion and recover by throwing an exception. - New syntactic sugar in the pattern language: @(if)/@(elif)/@(else)/@(end), which works by transformation to a pattern involving @(cases) and @(require). - The @(empty) directive which plays a role in @(output) blocks has a new meaning in the pattern language for denoting an explicit empty match. Bugs - Fixed severe performance problem with regex on long strings, caused by feeding characters to the regex machine past the point that it is clear it will not accept any more. - Fixed broken horizontal matching under @(freeform) on long lines, due to bugs in the handling of the memory-saving optimization which consumes the prefix of the lazy string as scanning progresses. - Fixed breakage in sub-str over lazy strings. - Fixed possible crash in @(trailer) directive. - Fixed memory leaks on open-process: one that happened on every call, and one on failure of the fork function. - Fixed pipe-close deadlocks occurring in code that opens numerous pipes; solved by setting the close-on-exec flag on the pipe descriptors. - Fixed faulty argument defaulting logic in the functions: iffi, regex-parse, lisp-parse, regex-compile and Windows version of open-process. - Fixed regression in the random number module, causing the random function to ignore the seeded random state passed in as an argument, and rely on the global one. - Fixed a bug in a rarely used form of the backslash line continuation. - Fixed buggy argument quoting in Windows version of open-process. - The gc on/off state is now saved and restored as part of unwinding, so if code that turned off gc throws an exception, gc will be turned back on at the catch site. - Fixed incorrect calculation of malloc upper and lower boundaries, affecting the correctness of generational garbage collection. - In open process, if fdopen fails, kill the process more gently with SIGINT and SIGTERM rather than SIGKILL, and wait on it. - Syntax fix. @^a is not meta applied to the symbol ^a, but rather meta quasiquote a. TXR 85 2014-03-07 Bugs - Fixed a regression related to the *random-state* variable, breaking all pseudo-random number functions. - Fixed broken "txr -v". TXR 84 2014-03-07 Features - TXR Lisp no longer uses one quote for regular quote and quasiquote syntax. The quasiquote character is now ^ and the apostrophe is just regular quote. This change breaks backward compatibility, unfortunately, but the single-quote experiment had to come to an end, now that TXR has a powerful macro facility, with quasiquotes playing a central role. - TXR Lisp exposes the environment manipulation functions make-env, env-vbind and env-fbind. - New function log10 for base 10 logarithms. - New functions open-files and open-files* for opening a big catenated stream which marches through multiple files as if they were one. - New directive, @(assert), for writing certain kind of robust matching code more simply. - put-line can be called with no arguments, in which case it just writes a newline to standard output. - In the format function, if a precision is specified as *, it can now have a leading 0 in front of it, which applies as usual (to the formatting of an integer which falls short of the number of digits required by the precision). Bugs - In the format function, the * character for specifying a variable field width or precision (derived from an integer argument) was broken. - Fixed a regression causing the exception "t is not a cons" on queries that match data, when no input files are specified. - Fixed a regression causing file names not to be tracked in the pattern matching language, and consequently error messages not to give that useful information. - Fixed some bugs related to command line processing, which had recently been rewritten: the element nil was being added to *args* in some situations, the argument - would end up repeated twice, and args was being sometimes manipulated in such a way that (ldiff *full-args* *args*) wouldn't work, due to new conses pushed onto *args* so that it's not a structural suffix of *full-args*. TXR 83 2014-03-02 Features - The qquote macro is now in the regular user namespace, while the quasiquoting read syntax uses a different macro based on private symbols. So when the read syntax is used, the template can contain the symbols qquote, unquote and splice, even though these are the basis for a quasiquote macro. - Diagnosis of attempt to redefine a special operator as a function or macro. Remove the macro when a function of the same name is defined and vice-versa. Bugs - Fixed bugs in the implementation lexical variable shadowing by symbol macros. - Fixed incorrect handling of trailing atoms in quasiquote. - Redesigned the implementaton of special variables, and how they integrate with internal C global variables in the interpreter, in order to fix the broken dynamic overriding of the predefined globals. - The Lisp-1 style evaluation of the dwim operator or square brackets was not resolving over-ridden special variables correctly, using a lookup method that saw only the global bindings. - Fixed missing integration between catenated stream objects and the garbage collector. TXR 82 2014-02-27 Features - Intuitive behavior in various sequence processing in the library: don't try to output a string if the resulting items are not characters, and then fail; make a list. - All operators that were implemented as special code expanding hacks in the TXR Lisp code walker are have been converted to intrinsic macros. Only a few bona-fide special forms are subject to minor code transformations. - New generation macro called "gun". (gun (read-line stream)) produces a lazy list of lines from a stream. gun, which stands for "generate until nil", evaluates the enclosed expression while that expression produces non-nil values, and makes a lazy list out of them. - New function copy, for copying sequences. - Documentation improvements thanks to Roman Mishin. Bugs - Regression fix: error thrown on valid floating point constants. - Doc bugs: documentation was missing for the delay operator and the length function. TXR 81 2014-02-25 Features - Calls to stream opening functions can omit the mode parameter, which defaults to "r". - New functions for accessing environment variables from TXR Lisp, augmenting the @(next :env) method in TXR pattern language. - New variables *args* and *full-args* for accessing the partial and full command line. - New functions macro-form-p, macroexpand and macroexpand-1. - Implemented special variables (dynamic scope). All global variables defined with defvar and all the predefined variables are special, with the symbols being attributed for special binding similarly to Common Lisp. - Implemented the macrolet operator for binding local macros. The macroexpand and macro-form-p functions work correctly with the environment from a macrolet. - Implemented symbol macros: global symbol macros via defsymacro, and local macros via symacrolet. Local symbol maros are shadowed properly by lexical bindings, and are expanded properly in situations where they are used as assignment places by the set operator, and related operators. - Introduced the (. expr) syntax which is equivalent to expr. Handy for writing a function argument list that accepts only trailing parameters as (lambda (. rest) ...) rather than (lambda rest ...). - New functions prinl and pprinl, which are like print and pprint, but add a newline. - Added new Unix filesystem access functions: symlink, link, mkdir, readlink, mknod. Also makedev, minor and major. Bugs - Fixed broken seek-to-end-p boolean parameter in open-tail, a regression in TXR 71. - Fixed a regression in the debugger, also introduced in TXR 71, causing it not to print the data line being processed in a horizontal scanning context. - Fixed premature opening of data sources in the TXR pattern language. Opening files is now delayed until a data consuming directive needs to match data. The previous kludgy approach recognized only the @(next) directive, and only one occurrence of it. - Fixed incorrect square root calculation over bignums. It was not computing the last bit of the result and so could be off by one. - Numerous bugfixes in form expansion, in particular handling of variable bindings and function and macro parameter lists. - Global macro bindings make a symbol fboundp. Also, symbol-function retrieves information about a global macro. - Fixed several bugs in quasiquote, including the handling of `(... . ,form) in quasiquote. - Fixed get-string-from-stream throwing an inappropriate internal error on type mismatch. - Fixed the neglect to expand Lisp forms in the argument lists of the directives of the pattern matching language. - Added the neglected s-ifsock variable, which is part of the Unix filesystem interface, corresponding to S_IFSOCK. - Fixed some instances of source code line number not propagating through code transformations. - Fixed numerous formatting issues in the documentation, and omissions. TXR 80 2014-02-17 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. TXR 79 2014-02-11 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). TXR 78 2014-02-06 Features - vec function for making a vector out of its arguments, to complement the existing vector function which makes a vector of a given size. - The dot position of function call forms can now apply strings and vectors. The same is true of the apply function. - The apply function now takes additional optional arguments before the list, similarly to Common Lisp's apply. - New function: list*. - Three-element forms for optional parameters are now supported; the variable can be specified, an initialization form used when the argument is omitted, and a symbol that is bound to a boolean indicating whether or not the argument is present. (Common Lisp style, IOTW). - New protocol for optional parameters: the colon symbol : can be passed as a value for an optional parameter, which causes that parameter to behave as if it were missing. - reduce-left and reduce-right can now use nil as the initial object, which is an useful and important behavior. - strings, vectors, lists and hashes are now generally callable like functions, not only in the DWIM operator or DWIM brackets notation. Bugs - Lexical scope of optional argument default init forms now properly restricted. - Fixed breakages in do operator. - Bugfix in logic for tracking source code file and line number info that would cause the info to disappear under garbage collection. - Fixed a erroneous exception throws in the mutation operator logic which would cause usage errors to turn into internal errors. TXR 77 2014-01-30 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. TXR 76 2014-01-23 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. TXR 75 2014-01-16 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. TXR 74 2014-01-13 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'. TXR 73 2014-01-08 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. TXR 72 2013-12-17 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. TXR 71 2013-12-07 Features - New functions countqual, countql, countq and count-if. - New regex-parse function: parse regex from a string at run-time. - New *stdnull* stream for discarding data. - New function: seek-stream for positioning within a stream. - New function open-tail for opening a new kind of stream called a tail stream. This stream follows rotating log files. - New functions for converting a time expressed as individual fields into numeric time: make-time, make-time-utc. - New function daemon (where supported). Calls the BSD-derived daemon function to daemonize the process in one step. - New errno function for accessing C errno. - Real-time input support in pattern matching language, via "simple" lazy text stream line lists which sacrifice accuracy of representation for timely delivery. Bugs - Fixed missing recognition for hexadecimal integers in Vim syntax higlighting file txr.vim. - Fixed missing check for null handle in stdio back-end of flush-stream. - Grammar and spelling in HACKING guide. TXR 70 2013-11-22 Features - Fixed a nasty bug that affects all versions; I was not able to find a revision in git that works right with gcc 4.6.3. Invoking an @(accept) in the middle of a @(collect) was found not work at all as documented, and this was root-caused to my neglect to use volatile on some local variables. - Fixed a more recent regression in the op syntax, caused this October. - Fixed an amazing regression introduced in TXR 22, back in November 2009, easily reproduced using: echo ":x" | ./txr -c "@x:@x" - - Fixed all unintentional deviations from 1990 ISO C. GCC had not been diagnosing them for us due to my neglect to use the --pedantic flag. - Revamped and up-to-date txr.vim syntax file, for you Vim users. TXR 69 2013-10-23 Features - Multiple @(output) blocks can now continue on the same output stream, which is particularly useful if it is a pipe. Bugs - Fixed errors in documentation for the functions time-string-local, time-string-utc and expt. TXR 68 2013-10-07 Features - @(repeat) inside @(output) supports a :vars parameter, making it possible to declare the existence of iteration variables that are otherwise hidden within Lisp code. Bugs - Out-of-sequence numeric parameters can be used in the op operator now, like (op foo @2) where @1 is absent. - The implicit ". @rest" is now added to op forms only if they do not mention @rest or any numeric parameters, to prevent unintentional passing of extra parameters. - @rest or a numeric param like @1 can now be specified in the dot position of the op form, as in (op foo . @rest). TXR 67 2013-07-13 Features - New functions tok-str and string-cmp. - Internal lazy string functions exposed as intrinsics. - New pattern language directive: @(require ...). Bugs - Unrecognized backslash escapes in string literals and string quasiliterals are diagnosed. - Backslash-space escape recognized in string literals and string quasiliterals. TXR 66 2013-05-16 Features - Documentation completely filled in. - Added specfile for RPM builds. - @(repeat) introduced as shorthand for @(collect :vars nil). - New open-command and open-process functions. The open-pipe function becomes deprecated. - New multi-sort function for sorting two or more lists at the same time as if they were columns of a table. - assq and aconsq functions are renamed to assql and aconsql becuse they use eql equality, not eq. - New prop function for property list lookup. - New stat function for information about files. - New functions in hashing library: - Copying hashes: make-similar-hash, copy-hash - Set operations: hash-uni, hash-diff, hash-isec. - Gapingly missing hexadecimal integer constants have been implemented. - New bit operation functions that work with TXR's arbitrary precision integers: loand, logior, loxor, lognot, logtest, ash. - Test form in for loop can be omitted. - New package-related functions. - New functions for obtaining time of day and converting to text. Bugs - Fixed broken (+ ) case in addition. This fixes the range and range* functions too. - Fixed nonworking building in a separate directory. - Fixed broken eval function. - Bugfix in form expander's handling of regular expression syntax, causing the (set ...) notation for character sets being mistaken for the (set ...) assignment operator. - Bugfix in format: apply field formatting to argument not only if a nonzero with has been specified, but also if a precision has been specified. - Bugfix in format: ~s on a floating point number now always shows .0 except when a precision is given, and it is zero. - Fixed broken @(last) clause processing of @(collect), int he case when the last material matches at the end of a stream. - Fixed certain function applications not being able to call functions that have optional arguments with fewer than TXR 65 2012-04-20 Features - New ways to iterate over hash tables using lazy lists. - Regular expression compiler expressed to user code, allowing TXR programs to build regex abstract syntax trees and turn them into regular expression machines. - The popular regular expression tokens \s, \d, \w and \S, \D, \W are now supported (the first three of these in character classes also). - Low level time-of-day functions added for retrieving epoch seconds, and optionally microseconds. - New remove-if and keep-if functions, plus lazy counterparts remove-if* and keep-if*. - Lazy variants remq*, remql* and remqual* added. - New function find-if. - Improved seeding of pseudo-random-number generator. - Configure script now diagnoses specification of nonexistent config variables. - Documentation improvements. - Portability to Mac OS/X 10.7 (Lion), NetBSD 5.1 and FreeBSD 9.0. Bugs - Bugfix in @(next) directive, which showed up when using @(next :args) more than once to scan arguments more than once. Quiet Changes - First two arguments to the find function were reversed. TXR 64 2012-04-06 Features - In the pattern language, binding the symbol nil as a variable is permitted now and has a special meaning of matching and discarding input. - Caching optimization in hash tables. - Ephemeral GC implemented. This is experimental and currently must be enabled at compile time with the --gen-gc configure option. Bugs - Interaction between @(trailer) and @(accept) has been clarified. An @(accept) return from the forms of a @(trailer) will still roll back the input position to the starting point for the @(trailer). TXR 63 2012-03-30 Features - Significant improvement in the performance of the garbage collector, which can drastically cut the run-time of some programs. - match-str and match-str-tree functions exposed. - new @(rebind) directive provides for a one step dynamic shadowing of a variable with a local variable, whose value can be derived from the one being shadowed. - filters now work on nested lists of strings, not just strings. - floating point formatting now produces the same exponential notation on different platforms, by post-filtering the sprintf output: a leading + and leading zeros are removed: e+023 becomes e23. - new functions: num-str, tan, asin, acos, =, - min and max return the left operand rather than the right one, when two operands are equal. Bugs - search-str optional argument was not working when omitted. - Fixed situations involving an incorrect behavior: partial horizontal matches (not matching the full line) were succeeding. - It was impossible to define a pattern function called @(text) due to the use of the symbol text as an internal symbol, rather than a symbol in the private system package. - error checking code in funcall had an improperly terminated argument list, causing an exception. - @(output) blocks now flush their stream at the @(end), without which output is not correctly interleaved between output produced by external commands. - fixed some misleading exception wordings in the numeric library. - fixed sign semantics of floating-point mod to be like the integer mod. - gcd function allows zeros. - fixed broken exptmod: it was not normalizing bignum values that fall into the fixnum range into fixnum objects, resulting in undersized bignums being returned. TXR 62 2012-03-23 Features - Floating-point support has been added. - TXR programs can specify floating-point constants. - Printing floting points is supported in the format function. - New specifiers: ~f and ~e. - Arithmetic on floating points, with implicit conversion. - New / function which produces a floating-point result. - New functions like sin, cos, exp, and log. - Functions for converting between floating and integer, and parsing a float from a string. - New combinators for easier programming with higher order functions: chain, andf, orf, iff. - url_decode and url_encode functions take an optional parameter which determines whether + is used as the code for space, distinguishing URL encoding from percent encoding. Separate named filters are introduced: :frompercent, :topercent distinct from :fromurl and :tourl. Bugs - Buggy quicksort routine repaired. This is a recently added feature which allows vectors and strings to be sorted. List sorting, done by merge sort, is unaffected. - Breakpoints can now be set by line number and file name, allowing breakpoints in loaded modules, not just the main module. TXR 61 2012-03-15 Features - URL encoding and decoding functions added, and :tourl/:fromurl filters implemented for output substitution. - split-str function works with regex objects now. - new regsub function for regex substitution in strings; matched text can be filtered through a function. - new *stddebug* stream used by debugger. - put-byte works on string output streams, and does right thing with mixtures of bytes (which are taken as UTF-8) and characters written with put-char. - Hash table literals implemented; hashes can now be notated rather than constructed. - Vectors can now be quasiquoted with unquote and splicing, and so can the new hash table literals. - @(block) syntax change: blocks do not extend to the end of the surrounding scope but introduce their own, delimited by @(end). Fixes - Fixed memory leak in string byte input stream. - Fixed wrong parsing of tokens in cases like @(collect-foo) where this was treated as @(collect -foo) rather than a single token. TXR 60 2012-03-04 Features - List element removing functions: remq, remql, remqual. - Memory use optimizations in @(freeform) horizontal scanning. - Improved hashing function for bignums. Bugs - Fixed incorrect processing within long lines, caused by earlier optimizations in 57. - Missing 'd' command for deleting a breakpoint implemented in the debugger. - numberp function no longer blows up on nil. - Fixed broken @(load) directive: was not allowing directives which follow it to be processed. - Fixed incorrectly formatted line number information in some exceptions. - Fixed missing support for optional and trailing parameters in defun. - Fixed showstopper bug in plus function. TXR 59 2012-02-29 Features - Implemented put-byte function on streams. - Regex syntax in TXR Lisp changes from /re/ to #/re/, allowing symbols containing slashes. - New -B command line option forces TXR to dump the bindings even if the program produced output. - Revised and improved txr.vim syntax highlighting file for greater lexical accuracy and superior flagging of errors. Fixes - Regression that broke [n..t] and [n..nil] sequence ranges. - Broken hex-escaped character literals. - Old bug from database: filter functions now see bindings in all contexts in which they are invoked. - Output clauses consisting of one empty line were being treated as empty. - Implemented more sane rule for deciding when output has taken place and suppress the printing fo bindings. TXR 58 2012-02-25 Features - Exception handling exposed in TXR Lisp. - range* function similar to range, but for generating a range with the endpoint excluded. - TXR Lisp can invoke a function in the pattern language now using the new match-fun function. - Braced variable syntax in @(output) extended to support arbitrary expressions in place of the variable name. The expressions are converted to text and then treated the same way as a variable substitution. Indexing is allowed, and field-formatting takes place. Moreover, these expressions are code-walked by @(repeat) and @(rep) to look for embedded variables. - New TXR Lisp functions ref, refset, sub and replace. - Indexing and range extraction in brace substitution in @(output) clauses is now generic over lists, vectors and strings. - Optional arguments introduced into TXR Lisp, in defun and lambdas, with a simple syntax involving a colon. Numerous intrinsic functions have been converted such that some previously required arguments are now optional. - Sort function that was previously for lists only is now generic over vectors and strings. - New del operator in TXR Lisp can delete elements of sequences or hashes which are denoted using the bracket syntax. - Range indexing has "floating zero" behavior now so that for example [seq -2 0] means the "last two elements": when the start of the range is negative, then a zero end is treated as length plus one. - TXR programs can now be split into multiple modules, using the load directive to load and run code. Bugs - range function terminates lazy list when the sequence overshoots the final value. - Variable that holds nil is treated as a list in (set [var x..y] ...) range assignment. - Vestigial (t . obj) representation in exception handling code removed. - TXR now does not not dump bindings if any output occured on a stream connected to the C stdout stream. Previously, it suppressed printing of bindings if @(output) was carried out on the *std-output* stream. - Function remhash was found to be buggy and rewritten. TXR 57 2012-02-14 Features - Operations under the @(freeform) directive can now scan in constant memory, allowing large files to be processed. (Scanning a single regex still requires the data to be all in memory: an experimental patch for this exists.) - Improved printing of character position context in debugger when lines are long. - Metanums (@1, etc) can be used in a quasiliteral, which is useful for quasiliterals occuring inside the op notation. Bugs - lazy-flatten function did not handle atoms. This broke @(next :list expr) also, for the case where expr evaluates to a string atom. - In format, the ~s directive was found to be printing strings in the same way as ~a. - Hex and octal character constants did not work. - Control characters in strings and characters are printed as hex now rather than octal. A semicolon is added if the next character would be interpreted as part of the escape. - Hash indexing via the [] notation was still requiring the default value argument. TXR 56 2012-02-06 Features - Hex and octal escapes work in strings and quasilterals now: the documentation has stopped lying. - Escapes can be followed by a semicolon which terminates them and is removed, which is useful if an escape is followed by characters that would otherwise be interpreted as part of the escape. - More color categories and more accurate syntax in Vim syntax highlighting file. Highlights @[...] syntax properly inside quasiquote. - The third argument (the default value if a key is not found) can be omitted when indexing hashes with the [hash key] syntax. It defaults to nil. - The dwim operator (and thus [] syntax) is even more Lisp-1 like. It now has Lisp-1 namespace semantics for evaluating arguments that are symbols. - A new operator called "op" as been added. This allows simple lambda functions to be written as partial evaluatios of functions, with implicit arguments as well as numbered/rest arguments appearing in the body. Bugs - Fixed missing type check in hash module that allows bad code to crash interpreter instead of getting an excepion. - Fixed regression in TXR 55 which broke computed field widths in output variables. - Fixed incorrect UTF-8 decoding of some code points. - Closed several security holes in UTF-8 decoder by recognizing all invalid UTF-8 sequences, and mapping invalid bytes in such a way that any byte sequence processed by the decoder into Unicode code points will be recovered exactly when encoded back into UTF-8. TXR 55 2012-01-26 Features - New square bracket syntax for Lisp-1 like invocation and array-indexing over lists, vectors, strings and hashes. - New a .. b pair syntactic sugar for (cons a b). Works with array indexing brackets to extract ranges (slices) from lists, vectors and strings. - Indexed elements and slices are assignable. - In the pattern language, variables in output templates (output variables) can be indexed and sliced. - Output variables that hold lists are now interpolated with spaces between, and this can be overridden with any separator string. TXR 54 2012-01-21 Features - Improved debugger: - step into - step over - finish - backtrace for pattern and TXR Lisp functions. - dump more complete environment. - Debugging support can be disabled at compile time: configure with --no-debug-support. - New lazy append function (append*). TXR 53 2012-01-11 Features - In variable substitutions in output and quasiliterals, the field width expression is now evaluated. - TXR Lisp: - New operators and functions for generating lazy lists more conveniently. - lazy mapcar and mappend: return lazy list. - delay and force operators. - parallel iteration/collection over lists. - list-str function for splitting string into list of characters. Bugs - Fixed global buitin variables, broken in 52. Properly implemented intended fix. TXR 52 2012-01-07 Features - @(rep) and @(repeat) now take an keyword argument, :counter. This specifies the name of a variable which holds the repetition count, thus making the count available within the repeated body. - New @(mod) and @(modlast) clauses in repeat/rep, allowing special behaviors to be coded based on whether the repetition count is a particular value modulo some number. - @(gather) directive now supports an @(until)/@(last) clause, so the search range can be restricted. - New directive @(fuzz) for doing an imprecise match over a range of lines, similar to the context line fuzz logic in the patch utility. - gensym function added to TXR Lisp, along with a *gensym-counter* global variable. Bugs - Fixed a regression in repeat/rep triggered when multiple clauses of the same type appear (like two occurences of @(last)). - Built-in global variables in TXR Lisp now properly denote the underlying C variable locations, rather than holding copies of the values of those variables. If you assign to *stdout*, it will now really replace the stdout stream stored in the corresponding C variable (std_output), so it has the proper global effect. Previously, this action would just replace *stdout* with a new value, without any effect on std_output. TXR 51 2011-12-28 Features - Better algorithm in the random function for generating evenly-distributed pseudo-random numbers of arbitrary precision. - PRNG startup behavior improved. - New lazy-flatten function for flattening lists lazily. Used within @(next :list ...) implementation, making it possible to scan through Lisp-generated lazy lists. Bugs - Fixed showstopper bug introduced in a patch for the MPI library, affecting 32 bit platforms. - Fixed bug in Lisp expression interpolation in quasiliterals. - Fixed fatal exception being thrown in verbose mode, by one of the formatted print statements. TXR 50 2011-12-23 Features - Dropped silly leading 0 from version number. :) - New vector functions: copy-vec, sub-vec, cat-vec. - New API for pseudo-random-number generation, complete with independent random state objects that can be seeded and copied. - Vim syntax highlighting definition improvements. - In the format function, left-adjustment is specified using < rathr than the - character. (However a negative width specified as an argument using * still means left adjust.) The leading zero for zero padding as well as the sign character (space or +) are specified in the precision field, not the width field. - More complete documentation. - Slight return value convention change in some and all functions. - Added memql function. Bugs - Critical flaw in hashing fixed that could crash on some platforms. - Exception handling fix: if a catch clause performs a non-local exit, the finally clause is still executed. - "make distclean" fixed. - Fix for differences in syntax error diagnosis between Byacc and Bison. - Fixed a memory leak in a division-by-zero case in the bignum mod function. - Fixed a terrible bug in one of the MPI patches affecting the correctness of various operations on numbers having a 1 in the most significant bit position of the most significant digit word. - Fixes in format function. All objects obey field width and left/right alignment. Numeric precision, zero padding and optional sign all works. - Lisp code evaluated in @(repeat)/@(rep) clauses can now see all variables, not just the ones subject to the repeat. (But whether or not a repeat executes, or which clauses, is still independent of what variables are accessed by the embedded Lisp, taking into account only the variables directly embedded in the clause.) TXR 049 2011-12-19 Features - New functions for converting between characters and integers. - Some arithmetic and relational operations are generic over characters in a way that makes sense. - dohash establishes anonymous block. - Improvements in Vim syntax highlighting file. - Lazy cons semantics cleaned up making lazy list programming easier. - Some API renaming and restructuring in the area of vectors. - Semicolon comments supported in Lisp code and @; comments in the pattern matching language. @# becoming obsolescent. - Not function, synonym for null. - Some progress in TXR Lisp documentation. - Hashing functions improved for fixnums, literals and characters. - API for introspecting over interpreted functions added, in anticipation of doing some compiler work. - Quasiliteral strings supported in TXR Lisp. Bugs - Broken abs function fixed for bignums. - mappend semantics clarified and fixed: behaves like append for improper lists and atoms. - Bugfix in code walker for let/let* forms, which resulted in quasiquotes not being expanded. - Fixed incorrect format arguments in some error messages, resulting in aborts in some error cases, instead of the intended diagnostics. TXR 048 2011-12-13 Features - New functions: expt, exptmod, sqrt, numberp, evenp, oddp, abs, gcd reduce-left, reduce-right. - Replaced horribly slow square root in MPI with a less horribly slow one. Bugs - Fixed numerous instances, in the MPI library, of coding broken for mpi_digit wider than 16 bits, leading to incorrect results and crashes. - Fixed mpi_int for 32 bit platforms so that obj_t stays 4 pointers wide. (The sign becomes a 1 bit wide bitfield). TXR 047 2011-12-12 Features - Transparent bignum arithmetic: when operations on machine word (fixnum) integers overflow, multi-precision (bignum) integers are produced. - TXR Lisp: - New operators: progn, flip. - Vector functions added, and vecref is an assignment place. - Character manipulation functions. - Association list functions. - Implicit anonymous block around forms for loop. - Implicit named block around forms for loop. - Nump renamed to fixnump. - Push arguments reversed: (push obj list). - Syntax highlighting definition update for all new operators. Bugs - Another bugfix to character literals, allowing non-alphanumeric constants like #\$. - Fix in rplacd to make lazy list programming feasible. - Reversed assoc and assq arguments throughout codebase. - Debugger: repeating last command by pressing Enter works again. TXR 046 2011-12-06 Features - Vector-related functions exposed in Lisp interpreter. - Syntax added for specifying vector literals in code. - Length function made generic over strings, lists and vectors. Bugs - Broken get_line function over string input streams fixed. - Some kinds of character literals were not being recognized properly. - bugfixes in configure script, affecting 64 bit Mac OS X. Thanks to Andy Wildenberg for reporting issue and confirming root cause. TXR 045 2011-12-05 Features - New functions exposed in Lisp interpreter: strings, characters, symbols and lazy lists. Bugs - Flaws in some string-splitting functions identified and fixed. - Bugs in quasiquote. - Handling of singleton clauses in cond operator. TXR 044 2011-12-01 Features - Lisp interpreter added. - Relaxed rules for what constitutes symbol names. Bugs - Regression in source location tracking (line numbers shown in debugger and trace output). - Regression in vertical skip directive caused it to ignore its arguments. - Fixed :vars () in collect/coll not working as intended. This should prevent any bindings from being collected, and allows iteration with collect without accumulating memory. - Two-year-old bug in weak hash tables. TXR 043 2011-11-23 Bugs - Buggy @(eol) directive fixed. - Semantics change for text and regular expressions in "negative match": - a variable is considered to be followed by a run of text which consists of any mixture of regexes and literal text - thus @foo bar behaves properly once again; it is not treated as foo followed by the regex / +/, ignoring the text bar. - Infinite looping bug in negative match with longest-match semantics. - Bug in the overflow detection in the lib.c plus and minus function. TXR 042 2011-11-20 Features - Access to environment via @(next :env) - New @(gather) directive for matching out-of-order material. - Horizontal functions: - TXR can now parse grammars. - Variable syntax allows capture of text spanned by function calls: e.g. @{var (func x y)}: text spanned by (func x y) goes into var. - Horizontal modes for numerous directives such as @(bind), @(local), ... - Lisp-style bindings output. - Interactive breakpoint/step debugger added. This is an experimental prototype, but already quite useful. - Directives following a variable match have searching semantics now, as do function calls. @a@(foo) will scan for a match for @(foo), and the text skipped over is captured by a. - New :resolve keyword in @(some) directive allowing conflicting variable bindings to be set in separate clauses and resolved. - deffilter is more powerful: arguments are evaluated so filters can be computed by the query. Bugs - Horizontal @(some) directive hooked in. - @(freeform) with no data fails to match instead of throwing strange error. - Setting non-local variables from a function works now. - Stability fix: several long-time uninitialized variable bugs found, and some faulty object initialization orders. - :vars in @(collect)/@(coll) does not fire an exception about missing required variables if no variable bindings are produced at all, allowing strict collects to have explicit matches for unwanted material without triggering this nuisance error. - @(repeat)/@(rep) allow empty body. Internal - New infrastructure for matching location info to source forms. Location info (currently just the line number) is associated with source forms via a weak hash table. - Character literals are now Lispy (hash-backslash syntax), based on Scheme. - Added quote, unquote and splicing syntax similar to Lisp. Not used for anything yet. - Improved Valgrind integration: more accurate, timely detection of uninitialized fields in heap objects. Misc. - A TXR syntax highlighting file for the Vim editor exists now. See the txr.vim file. TXR 041 2011-10-30 Features - New :append keyword in @(output) to append instead of overwriting. - Variable contents can be treated as input sources using :string and :list keywords in @(next). Variables can be treated as output destinations using :into keyword in @(output). - New @(set) directive for destructive assignment to a variable. - New filters: :upcase and :downcase. - @(bind) can now compare left and right objects through filters. - Filters can now be chained into compound filters. - Pattern matching functions can be used as filters. - Shorthand notation in @(deffilter) when multiple strings map to the same replacement string. - @(cat) directive changes syntax. - Error handling improvements in parser: no more reams and reams of errors. Bugs - Runaway recursion in @(block) directive, introduced in 040. - Fixed bug in matching list variable against text, at the same time clarifying semantics to longest-match. - Fixed potential excessive memory use caused by refactoring in 040.