summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
* Version 148.txr-148Kaz Kylheku2016-09-011-2/+2
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.
* doc: revised merge directive description.Kaz Kylheku2016-09-011-38/+73
| | | | | * txr.1: Substantially rewrote incorrect and incomplete description of merge directive.
* doc: wording changes regarding usage of "query".Kaz Kylheku2016-08-311-41/+64
| | | | | | | | | | | | * txr.1: The term "query language" is retired; "pattern language" is used everywhere. The script argument can be TXR Lisp or TXR, so is referred to as "script-file" in all contexts where it could be either. Clarifications are added in a few places that the script could be Lisp or that some wording only applies when the script is TXR. Removing incorrect, obsolescent wording which specifies that the leading exclamation mark convention is honored in a file name argument.
* doc: warn about exit methods not saving history.Kaz Kylheku2016-08-301-0/+5
| | | | | | * txr.1: Under INTERACTIVE LISTENER, add remarks that using the exit function, or raising a fatal signal, will prevent the history from being saved.
* doc: revise synopsis; document listener invocation.Kaz Kylheku2016-08-301-2/+11
| | | | | | | | | | | * txr.1: Revise the synopsis so that it doesn't insinuate that the query-file or data-file arguments are mandatory. A formatting issue with the brackets around options is fixed. Under ARGUMENTS AND OPTIONS document that if no arguments are present, the interactive listener is launched. Under INTERACTIVE LISTENER, mention that not only does the -i option run the listener, but so does txr invocation with no arguments.
* doc: verb number agreement in Undo Editing.Kaz Kylheku2016-08-301-1/+1
| | | | | * txr.1: Fix plural subject "lines" paired with singular verb "has".
* doc: bad wording in path-private-to-me-pKaz Kylheku2016-08-301-1/+3
| | | | | * txr.1: Fix sentence talking about two functions, respectively, but just one function as its subject.
* Fix runaway recursion in lazy struct initialization.Kaz Kylheku2016-08-281-0/+6
| | | | | | | | | | | | | | | | | | | | | Staci-blowing test case: (defstruct foo nil bar) (mlet ((f (lnew foo bar (not f.bar)))) (prinl f.bar)) * struct.c (lazy_struct_init): Do not flip the lazy flag to zero here. The problem is that it's being done after the funcall(so->slot[0]), and so the struct is still marked for lazy initialization while that function is running. We could detect the circularity (as done in the force function) but that would create inflexibilities in lazy struct initialization. (check_init_lazy_struct): Flip the lazy flag to zero in this function before calling lazy_struct_init. * txr.1: Document behavior of struct being freely accessible during lazy initialization.
* Fix formatting of list* syntax.Kaz Kylheku2016-08-261-1/+1
| | | | * txr.1: list* symbol was typeset as meta.
* Adding time-parse method.Kaz Kylheku2016-08-251-0/+51
| | | | | | | | | | | | | | | | | | | | * lib.c (time_parse_s): New symbol variable. (tm_to_time_struct): New static function, based on code moved out of broken_time_struct. (broken_time_struct): Bulk of code replaced with call to tm_to_time_struct. (time_struct_to_tm): New parameter, strict. Indicates whether nils in time struct are converted to zeros, or whether they trigger errors. (time_string_meth): Specify strict conversion of argument time struct to to struct tm when calling time_struct_to_tm. (time_parse_meth): New static function. (time_init): Initialize time_parse_s symbol variable; add time-parse static slot to time struct; initialize slot with new method. * txr.1: Document time-parse method.
* New time-string method on time struct.Kaz Kylheku2016-08-221-0/+22
| | | | | | | | | | | | | * lib.c (time_string_s): New symbol variable. (time_fields_to_tm, time_struct_to_tm): New static functions. (make_time_impl): Replace bunch of code with call to time_fields_to_tm. (time_string_meth): New static function. (time_init): Initialize time_string_s. Add time-string static slot to time struct. Register time-string method. * txr.1: Documented.
* Adding time-parse function: wrapper for strptime.Kaz Kylheku2016-08-221-0/+28
| | | | | | | | | | | | * configure: Test for strptime. * eval.c (eval_init): register time-parse intrinsic. * lib.c (time_parse): New function. * lib.h (time_parse): Declared. * txr.1: Documented.
* Version 147.txr-147Kaz Kylheku2016-08-121-2/+2
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.
* Version 146.txr-146Kaz Kylheku2016-07-201-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Adding uname.Kaz Kylheku2016-07-191-0/+38
| | | | | | | | | | | | | * configure: Detect utsname and uname. * sysif.c (utsname_s, sysname_s, nodename_s, release_s, version_s, machine_s): New symbol variables. (uname_wrap): New static function. (sysif_init): Initialize new symbol variables. Instantiate utsname struct type. Register uname_wrap as uname intrinsic function. * txr.1: Documented.
* Don't open text files using "t" mode on Cygwin.Kaz Kylheku2016-07-121-4/+7
| | | | | | | | | | | | | | | | | Retracting the recent change to add the "t" mode when opening non-binary streams on Cygwin, which arranges for line ending conversion. This restores the Unix-like treatment of text files on Cygwin, which is expected of programs. The Windows native version of TXR will do line ending conversion thanks to the behavior of text streams in the Cygnal fork of Cygwin. * stream.c (format_mode): Only add the "t" option on Cygwin if compatibility with 144 and 145 is selected. * txr.1: Updated compatibility notes.
* Version 145.txr-145Kaz Kylheku2016-07-031-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Fix wrong function name: addrinfo isn't a function.Kaz Kylheku2016-07-031-1/+1
| | | | * txr.1: Heading fixed from addrinfo to getaddrinfo.
* Version 144.txr-144Kaz Kylheku2016-06-291-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* We would like the Windows port of TXR to open files in textKaz Kylheku2016-06-281-0/+4
| | | | | | | | | | | | | | | | mode by default, such that "\r\n" is converted to "\n". Cygwin's stdio streams aren't doing this. This is fine when working in the Cygwin world, but not fine when we are making a "native" Windows program with the help of the Cygwin DLL. However, Cygwin supports the "t" mode letter in fopen, and that forces a text mode which does the conversion. * stream.c (format_mode): On Cygwin, if the mode isn't binary, add the 't' letter to the normalized mode string, unless compatibility <= 143 is requested. * txr.1: Added compat notes.
* Update compatibility notes.Kaz Kylheku2016-06-281-0/+3
| | | | | | * txr.1: The big switch to Lisp evaluation throughut the pattern language needs mentioning in the compatibility notes.
* Revamp documentation of expressions in pattern language.Kaz Kylheku2016-06-261-104/+341
| | | | | | | | * txr.1: Rewrote and rearranged sections that introduce compound expressions. Introduced "bind expressions" as a concept and applied throughout. Revised faulty documentation of @(bind). Documented Lisp evaluation where it now occurs.
* Wrong section macro on from-list.Kaz Kylheku2016-06-171-1/+1
| | | | * txr.1: Introduce function with .coNP not .SS.
* defsymacro must remove special marking.Kaz Kylheku2016-06-111-1/+21
| | | | | | | | | | * eval.c (op_defsymacro): Remove sym from the special hash, unless compatibility 143 or lower is requested. * txr.1: Document effects of evaluating defsymacro if a global variable of the same name exists, and the behavior in lexical scopes where sym is bound. Added compatibility notes covering the code change.
* Implement :counter in collect/coll.Kaz Kylheku2016-06-091-0/+47
| | | | | | | | * match.c (h_coll, v_collect): Parse out :collect keyword specification, using code borrowed from do_output. Implement binding in collect loop. * txr.1: Documented.
* Restructure documentation of collect keywords.Kaz Kylheku2016-06-091-44/+73
| | | | | * txr.1: Use indented paragraphs to replace the ad-hoc introduction of keywords.
* Rewriting documentation for binding accessors.Kaz Kylheku2016-06-081-14/+47
| | | | | * txr.1: Largely rewrote description of symbol-function, symbol-macro and symbol-value.
* Fixing semantics of makunbound.Kaz Kylheku2016-06-081-31/+103
| | | | | | | | | | | | | | | | | | * eval.c (unbound_s): New symbol variable. (lookup_var): If a dynamic binding has the special sys:unbound symbol as its value, then return nil, so the behavior is as if there is no binding. (makunbound): If the symbol exists in a dynamic environment, then replace its value with sys:unbound, making it look unbound. (eval_init): Initialize unbound_s. * lib.h (us_car, us_cdr): New inline functions. * txr.1: New dialect notes under boundp. Updated the makunbound documentation. Separated makunbound documentation from fmakunbound and mmakunbound. Added compatibility notes.
* Note that txr-path includes trailing slash.Kaz Kylheku2016-06-051-3/+4
| | | | | * txr.1: Document that txr-path includes slash. Fix two incorrect examples which have an extra slash.
* The stdlib variable gets a trailing slash.Kaz Kylheku2016-06-051-1/+5
| | | | | | | | | | | | | | | | | | | * txr.c (sysroot_init): Add slash to stdlib_path. (sysroot_compat_fixup): Replace user-visible stdlib variable with a path that doesn't have a slash, if compatibility is 143 or lower. (compat): Call sysroot_compat_fixup. * lisplib.c (place_set_entries, ver_set_entries, ifa_set_entries, txr_case_set_entries, with_resources_set_entries, path_test_set_entries, struct_set_entries, with_stream_set_entries, hash_set_entries, except_set_entries, type_set_entries, yield_set_entries, sock_set_entries, termios_set_entries): Remove slash from format string since the directory includes it. * txr.1: Added note under stdlib about the slash, and also an entry COMPATIBILITY.
* Version 143.txr-143Kaz Kylheku2016-06-041-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Incorrect repeat directive example.Kaz Kylheku2016-06-031-1/+1
| | | | | * txr.1: Insufficient parenthesis nesting in :vars syntax with initializer.
* @(output) evaluates destination as Lisp.Kaz Kylheku2016-06-031-6/+16
| | | | | | | | | * match.c (v_output): Use txeval on the destination only if compatibility is 142 or lower, or it is a meta expression (so that @var and @(expr) still work without having to use the compatibility option). * txr.1: Documented and put in compatibility notes.
* Mistake in remq*, reqml* and remqual heading.Kaz Kylheku2016-06-031-1/+1
| | | | * txr.1: reqm was written instead of remq*.
* Adding special function from-list.Kaz Kylheku2016-06-011-0/+42
| | | | | | | | | | * lib.c (from_list_s): New symbol variable. (make_like): Handle a COBJ. If it's a structure with a from-list method, then use it, otherwise the default handling applies of returning the list. (obj_init): Initialize from_list_s. * txr.1: Documented.
* Describe special structure methods in new section.Kaz Kylheku2016-06-011-114/+158
| | | | | | | | * txr.1: Removing "Functors", "Equality Substitution", "Custom Pretty-Printing" and "Sequence Operations on Structures" paragraphs. Adding major section "Special Structure Functions" under which the special functions are described with syntax headings.
* ldiff uses equal for all non-list arguments.Kaz Kylheku2016-06-011-3/+3
| | | | | | | | | | | * lib.c (ldiff): Rather than checking specifically for strings and vectors to apply the special case behavior (comparison using equal), test specifically for lists and apply the traditional behavior. Every other object, not just strings and vectors, gets the altered behavior. * txr.1: Changed text in TXR Lisp introduction which touches on ldiff, and wording fix under ldiff.
* Methods for turning objects into sequences.Kaz Kylheku2016-06-011-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | Struct objects can now define methods car, cdr and nullify. With these, they can participate in operations on sequences. * eval.h (car_s, cdr_s): Declared. * lib.c (nullify_s): New symbol variable. (car, cdr): Implement for struct objects via, respectively, their car and cdr methods. (tolist): Handle objects by mapping through identity. (nullify): Implement for objects optionally: if an object is a struct with a nullify method, use it, otherwise go through default case of just returning the object. (empty): Implement for objects that have nullify method. (obj_init): Initialize nullify_s. * struct.c (maybe_slot): New function. * struct.h (maybe_slot): Declared. * txr.1: Documented car, cdr and nullify method convention.
* Print method on objects.Kaz Kylheku2016-06-011-0/+8
| | | | | | | | | * struct.c (print_s): New symbol variable. (struct_init): Initialize print_s. (struct_inst_print): If pretty-printing, try to look up object's print method and use it. * txr.1: Documented pretty-printing via print method.
* Eliminating the ! $ and - file-opening hacks.Kaz Kylheku2016-05-311-25/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Going forward, the "!command" and "$dir" are no longer recognized, except with the backward-compatibility -C option. The "-" string denoting standard input is only recognized from the command line, not in the @(next) directive; and "-" cannot be used in @(output) to denote standard output. The main problem is that these are hacks which intrude into the namespace. (What if a file is named "-", or begins with "!" or "$"?) Secondly, they are possible security holes. These prefixes are recognized even in computed strings, like "@(next var)" where var contains "!command". * Makefile (tst/tests/002/%): Run tests in this directory with the -C 142 option in TXR_OPTS, because they use the ! mechanism. * match.c (complex_open): New argument, from_cmdline, indicating whether the file name came from the command line or is internal. Function now only treats "-" as denoting standard input, if that came from the command line. The "!" and "$" prefixes are only recognized in compatibility with 142 or earlier. (v_next): Suppress old strategy of handling string sources by pushing them to the file list to let match_files open them. This is now done only under 142 compatibility. Instead, open directly, produce the list, and recurse into match_files with ready data. This is not only simpler, but also prevents "-" from being recognized in @(next), because complex_open is invoked directly, and the from_cmdline argument is specified as nil. (v_output): Don't rely on "-" denoting standard output; rather use the stream directly, which can be passed to complex_open. Pass nil to the new from_cmdline parameter of complex_open, so "-" isn't recognized. (open_data_source): Pass t for the from_cmdline parameter of complex_open, to have "-" recognized as denoting standard input. * txr.1: Removed documentation referring to !, and use of - in the @(next) and @(output) directives. Added notes to COMPATIBILITY section.
* Version 142.txr-142Kaz Kylheku2016-05-291-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Add a byte mode to stdio streams.Kaz Kylheku2016-05-281-7/+29
| | | | | | | | | | | | | | | | | * stream.c (byte_oriented_k): New keyword symbol variable. (struct stdio_handle): New member, is_byte_oriented. (stdio_get_prop): Retrieve the value of is_byte_oriented when the :byte-oriented property is inquired. (stdio_set_prop): Map :byte-oriented to the is_byte_oriented flag. (stdio_get_char): Do not decode UTF-8 if is_byte_oriented is set; just read one character. (make_stdio_stream_common): Initialize is_byte_oriented to 0. (stream_init): Initialize byte_oriented_k. * txr.1: Document :byte-oriented property, along with some clean-up and clarification in the description of properties.
* Check manual for .cblk/.cble pairing.Kaz Kylheku2016-05-261-4/+4
| | | | | | | | * checkman.txr (check-cblk): New pattern function, hooked into main scan. * txr.1: Fixed four instances of .cblk closed by .cblk instead of .cble.
* Provide the txr-embedded-arg.txr utility.Kaz Kylheku2016-05-251-1/+66
| | | | | | * txr-embedded-arg.txr: New file. * txr.1: Documented.
* Stand-alone application support.Kaz Kylheku2016-05-251-0/+107
| | | | | | | | | | | | | | | | | | | * txr.c (sysroot_init): Don't print "unable to calculate sysroot" error message in the fallback case, and use the absolute path of the executable directory as the sysroot in this case. (txr_main): Define static area prefixed by @(txr): header. If a string is present in this data area then process it as an argument. Treat the *args* variable carefully. If we use the stored string as the argument, save the args in orig_args variable, then later bind *args* to that. In the -e, -p and related options processing, we bind *args* to the original list so args are available to the expression being evaluated. If the expression mutates *args* then we keep the mutated args whether or not we are processing the stored string. * txr.1: Documented in new sction, STAND-ALONE APPLICATION SUPPORT.
* New variable: txr-path.Kaz Kylheku2016-05-251-0/+5
| | | | | | | * txr.c (dirname): New static function. (sysroot_init): Register txr-path variable. * txr.1: documented txr-path.
* Allow whitespace between @ and ; in comments.Kaz Kylheku2016-05-231-1/+1
| | | | | | | * parser.l (grammar): Recognize {WS}* between @ and ; (or the legacy #) in comments. * txr.1: Documentation updated.
* Optional argument on remove-path.Kaz Kylheku2016-05-231-2/+9
| | | | | | | | | | * stream.c (remove_path): New parameter, throw_on_error. (stream_init): Update registratino of remove_path intrinsic. * stream.h (remove_path): Declaration updated. * txr.1: Updated remove-path documentation to describe throw-on-error-p parameter.
* Neglected documentation about @(next).Kaz Kylheku2016-05-231-3/+8
| | | | | txr.1: It wasn't documented that expr in @(next expr) can produce a stream.
* Version 141.txr-141Kaz Kylheku2016-05-201-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.