summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
* Version 71txr-71Kaz Kylheku2013-12-071-2/+2
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * eval.c (eval_init): Update registration of regex-compileKaz Kylheku2013-12-061-5/+8
| | | | | | | | | | | | | | | | | | | to reflect that it has two arguments now. * parser.y (grammar): Update calls to regex_compile to pass two arguments. Since we don't expect regex_compile to parse, we specify the error stream as nil. (spec): The "secret syntax" for a regex is simplified not to include the slashes. This provides better diagnostics for unterminated syntax and requires less string processing to generate. Also, the form returned doesn't have the regex symbol consed onto it, which parse_regex just throws away. * regex.c (regex_compile): Now takes a stream argument. * regex.h (regex_compile): Declaration updated. * txr.1: Updated
* * regex.c (regex_compile): Handle string input.Kaz Kylheku2013-12-051-4/+11
| | | | | | | * regex.h (regex_compile): Don't call argument regex_sexp, since it can be a string. * txr.1: Updated.
* * eval.c (eval_init): Registered regex_parse as newKaz Kylheku2013-12-051-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | intrinsic function and std_null as new variable. * parser.h (yylex_destroy): Existing function declared. * parser.l (regex_parse): New function. New lexical syntax added which returns SECRET_ESCAPE_R. * parser.y (SECRET_ESCAPE_R): New token. (spec): Added syntactic variant which lets us smuggle a regex into the parser easily. * stream.c:x (std_null): New global variable. (null_stream_print): New static function. (null_ops): New static structure. (make_null_stream): New function. (stream_init): Protect and initialize std_null. * stream.h (std_null, make_null_stream): Declared. * txr.1: New features documented: regex-parse, *stdnull*. * txr.c (txr_main): Call yylex_destroy after parsing the program now that I know about this function; this can free up some memory.
* * eval.c (eval_init): New functions countqual, countql, countqKaz Kylheku2013-11-291-0/+33
| | | | | | | | | | and count_if registered as intrinsics. * lib.c (countqual, countql, countq, count_if): New functions. * lib.h (countqual, countql, countq, count_if): Declared. * txr.1: New functions documented.
* * configure (config_flags): New variable, allowing us toKaz Kylheku2013-11-291-2/+10
| | | | | | | | | | | | | | | | | | | have stricter diagnosis for configure tests. (have_timegm, need_svid_source, need_bsd_source): New variables. sys/stat.h test only declares static data and compiles an object file. Adding tests for timegm, tzset, setenv and unsetenv. * eval.c (eval_init): Register new intrinsic, make_time_utc. * lib.c (make_time_impl): New static function. (make_time): Reimplemented as call to make_time_impl. (timegm_hack): New conditionally-defined static function. (make_time_utc): New function. * lib.h (make_time_utc): Declared. * txr.1: make-time-utc documented.
* * configure: Detect the daemon function.Kaz Kylheku2013-11-281-0/+32
| | | | | | | | | | * eval.c: Include <unistd.h> conditionally. (errno_wrap, daemon_wrap): New functions. (eval_init): Registered errno_wrap and daemon_wrap as intrinsics under the names daemon and errno. * txr.1: Documented errno and daemon in new UNIX PROGRAMMING section.
* * txr.1: Documented open-tail and make-time.Kaz Kylheku2013-11-281-0/+57
|
* Stream-seeking functionality.Kaz Kylheku2013-11-261-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bugfix in stdio_flush: check FILE * handle for null. Minor cleanups. * eval.c (eval_init): Register seek_stream as intrinsic. * stream.c (from_start_k, from_current_k, from_end_k): New symbol variables. (strm_whence): New enum. (strm_ops): New member, seek. (stdio_maybe_write_error): Renamed to stdio_maybe_error; takes new string argument to describe action. (stdio_put_string, stdio_put_char, stdio_put_byte): Updated call to stdio_maybe_error. (stdio_flush): Updated call to stdio_maybe_error. Check handle for null. (stdio_seek): New static function. (stdio_ops): Added stdio_seek. (pipe_ops, string_in_ops, byte_in_ops, string_out_ops, strlist_out_ops, dir_ops): Added explicit zero entries and comments for unimplemented functions. (seek_stream): New function. (stream_init): New keyword symbols interned. * stream.h (from_start_k, from_current_k, from_end_k): New variables declared. (dev_k, ino_k, mode_k, nlink_k, uid_k, gid_k, rdev_k, size_k, blksize_k, blocks_k, atime_k, mtime_k, ctime_k, s_ifmt, s_iflnk, s_ifreg, s_ifblk, s_ifdir, s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu, s_irusr, s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp): Existing extern variables declared. (seek_stream): New function declared. * txr.1: Documented seek-stream.
* Version 70txr-70Kaz Kylheku2013-11-211-2/+2
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* Fix incorrect function name.Kaz Kylheku2013-10-271-1/+1
|
* Version 69.txr-69Kaz Kylheku2013-10-231-2/+2
|
* * txr.1: Fixed documentation bug. expt with three or moreKaz Kylheku2013-10-211-3/+6
| | | | arguments is a right-associative reduction, not left.
* Task #11433. Implement continuation of multipleKaz Kylheku2013-10-111-1/+63
| | | | | | | | | | | | | | | | output blocks across the same stream. * match.c (close_s, named_k, continue_k, finish_k): New symbol variables. (v_output): Implement :named, :finish and :continue. (v_close): New static function. (syms_init): New symbols interned. (dir_tables_init): New entry associating v_close function with symbol stored in close_s. * match.h (close_s): Declared. * txr.1: New features documented.
* * txr.1: Fix reversed arguments in documentation for time-string-localKaz Kylheku2013-10-111-2/+2
| | | | * and time-string-utc.
* Version 68.txr-68Kaz Kylheku2013-10-071-2/+2
|
* Improving behavior of op and fixing a bug.Kaz Kylheku2013-10-061-17/+35
| | | | | | | | | | | | | | | | | | | | | Explicitly specifying @rest using (op ... . @rest) did not work at all. The then-func agument of iff and iffi may now be nil. * eval.c (format_op_arg): New static function. (transform_op): Handle dotted lists ending in @rest or @<num>. (supplement_op_syms): New static function. (expand_op): Add missing numeric arguments, so that all 1 through n are in the list. Trailing rest is now added under different conditions. * lib.c (do_iff): Give thenfun the same behavior on nil that elsefun enjoys. * txr.1: Updated.
* New feature: :vars argument in repeat and rep directives in an outputKaz Kylheku2013-10-061-5/+43
| | | | | | | | | | | | block, for specifying variables to include in iteration whose presence repeat is not able to deduce. * match.c (extract_bindings): New argument, vars, specifies additional variables to consider. (do_output_line, do_output): Process :vars argument of repeat and rep directive. * txr.1: Updated.
* Fix dates.txr-67Kaz Kylheku2013-07-131-1/+1
|
* Version 67Kaz Kylheku2013-07-131-0/+8
| | | | | | | txr.1: Documented line continuation for string literals, supported since Version 38 but not clarified properly. RELNOTES: Updated.
* * txr.1: Fix slipup, where call is referred to as funcall.Kaz Kylheku2013-07-121-1/+1
|
* Version 67Kaz Kylheku2013-07-121-2/+25
| | | | | | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version, set date and documented string-cmp. * configure (txr_ver): Bumped. * eval.c (eval_init): Forgotten string-cmp registered as intrinsic. * txr.vim: Highlighting for string-cmp. * RELNOTES: Updated.
* * match.c (require_s): New variable.Kaz Kylheku2013-06-111-3/+24
| | | | | | | | | | | | | | (v_require): New static function. (syms_init): Initialize require_s. (dir_tables_init): Add new entries into v_directive_table and h_directive_table for new require directive. * match.h (require_s): Declared. * txr.1: Added do and require directives to the directive summary section. Documented new require directive. Fixed int-str documentation to clarify that the radix is optional.
* * eval.c (eval_init): tok-str acquires new parameterKaz Kylheku2013-06-111-1/+8
| | | | | | | | * lib.c (tok_str): New parameter, keep_sep. * lib.h (tok_str): Declaration updated. * txr.1: Documentation for tok-str updated.
* * eval.c (eval_init): lazy-str's third argument is optional.Kaz Kylheku2013-06-111-13/+213
| | | | | | | | | | | | | | | | | | | Added lazy-stringp. Changing names of length-str-{gt,ge,lt,le} to be consistent with the >, >=, < and <= functions. * lib.c (lazy_stream_func): Greatly simplified implementation. The lazy list now continues by means of recursing via an optimized version of lazy_stream_cons called lazy_stream_cont. The environment structure is simplified to just hold the next item, rather than a pointless list. The pointless setting of lcons->lc.func to nil is also removed; this is always done by the caller. (lazy_stream_cont): New static function, similar to lazy_stream_cons, but optimized by not consing up a new function and new environment cell. (lazy_stream_cons): The environment for the update function is simplified to just a single cons. * txr.1: Documented lazy string functions and lazy-stream-cons.
* * eval.c (eval_init): Register tok_str as intrinsic.Kaz Kylheku2013-05-201-0/+22
| | | | | | | | * lib.c (tok_str): New function. * lib.h (tok_str): Declared. * txr.1: Documented.
* * txr.1: Corrected wrong function name in documentationKaz Kylheku2013-05-201-2/+2
| | | | for split-str-set.
* * txr.1: Misleading documentation updated for split-str, whichKaz Kylheku2013-05-201-8/+18
| | | | | takes a regex, not just a fixed string separator. Clarified the corner case behaviors too.
* Fix date.Kaz Kylheku2013-05-161-1/+1
|
* Version 66.txr-66Kaz Kylheku2013-05-161-2/+2
|
* * eval.c (eval_init): New intrinsics, time-string-local andKaz Kylheku2013-05-151-5/+29
| | | | | | | | | | | | | time-string-utc. * lib.c (string_time): New static function. (time_string_local, time_string_utc): New functions. * lib.h (time_string_local, time_string_utc): Declared. * txr.1: Documented. * RELNOTES: Updated.
* * match.c (match_fun): Support debug stop on the functionKaz Kylheku2013-05-151-0/+27
| | | | | | | prior to the call. The first data line number is 1, not zero, if there is data. * txr.1: Added usage example for match-fun.
* * txr.1: Documented match-fun, source-loc, source-loc-strKaz Kylheku2013-05-151-0/+51
| | | | and *self-path*.
* * txr.1: Documented time and url encoding/decoding functions.Kaz Kylheku2013-05-141-0/+63
|
* * eval.c (eval_init): State argument in random-fixnum should beKaz Kylheku2013-05-141-1/+101
| | | | | | optional. * txr.1: Documented random functions as well as range and range*
* * RELNOTES: Updated in preparation for release.Kaz Kylheku2013-05-141-1/+209
| | | | | | | | | | | | | * eval.c (eval_init): Expose delete-package, rehome-sym and packagep. * lib.c (make_package, intern): use ~s formatting for package name in error message. (packagep, delete_package, rehome_sym): New functions. * lib.h (packagep, delete_package, rehome_sym): Declared. * txr.1: Documented process functions and packages.
* * eval.c (eval_init): New instrinsic function iffi registered.Kaz Kylheku2013-01-111-2/+14
| | | | | | | | | | * lib.c (iff): Reversed argument names corrected. No functional change. (iffi): New function. * lib.h (iffi): Declared. * txr.1: Documented iffi.
* * eval.c: Allow the test form of a for loop to be omitted,Kaz Kylheku2012-09-251-5/+7
| | | | | | | defaulting to a true test, allowing an infinite loop to be expressed as (for () () () ...). * txr.1: Documented.
* * arith.c (logtest): New function.Kaz Kylheku2012-09-181-2/+94
| | | | | | | | | | | | | | | | | | | | | | | * eval.c (eval_init): Registered logtest. Registered s-ifmt, s-iflnk, s-ifreg, s-ifblk, s-ifdir, s-ifchr, s-ififo, s-isuid, s-isgid, s-isvtx, s-irwxu, s-irusr, s-iwusr, s-ixusr, s-irwxg, s-irgrp, s-iwgrp, s-ixgrp, s-irwxo, s-iroth, s-iwoth, s-ixoth variables. * lib.h (logtest): Declared. * stream.c (s_ifmt, s_ifsock, s_iflnk, s_ifreg, s_ifblk, s_ifdir, s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu, s_irusr, s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp, s_ixgrp, s_irwxo, s_iroth, s_iwoth, s_ixoth): New global variables. * stream.h (s_ifmt, s_ifsock, s_iflnk, s_ifreg, s_ifblk, s_ifdir, s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu, s_irusr, s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp, s_ixgrp, s_irwxo, s_iroth, s_iwoth, s_ixoth): Declared. * txr.1: Documented logtest and s-* variables for stat, as well as open-file and open-directory.
* Documenting bit ops.Kaz Kylheku2012-09-171-0/+101
|
* * stream.c (vformat): Slight change in ~s directive. For a floatingKaz Kylheku2012-09-171-1/+1
| | | | | | | | | point integer, .0 is now always shown if the precision is not given, or if it is given and nonzero. Previous behavior of ~s was add .0 only when a precision is not specified. The new behavior is more sensible and consistent with documentation. * txr.1: Typo fixed in related documentation.
* * parser.l: Implemented hexadecimal integer constants.Kaz Kylheku2012-09-161-3/+11
| | | | | | | These will be very useful since bit operations are about to be implemented. * txr.1: Documented.
* * eval.c (eval_init): New intrinsics: make-similar-hash, copy-hash,Kaz Kylheku2012-09-121-0/+58
| | | | | | | | | | | | | | hash-uni, hash-diff, hash-isec. * hash.c (make_similar_hash, copy_hash, hash_uni, hash_diff, hash_isec): New functions. * hash.h (make_similar_hash, copy_hash, hash_uni, hash_diff, hash_isec): Declared. * txr.1: Updated. * txr.vim: Highlighting for these new functions.
* Vector functions documented.Kaz Kylheku2012-09-111-1/+170
|
* * configure: Added test for <sys/stat.h>Kaz Kylheku2012-09-111-0/+26
| | | | | | | | | | | | | | | * eval.c: New intrinsic functions "stat" and "prop". * stream.c: Include <sys/stat.h> if we have it. (w_stat, statf): New functions. (val dev_k, ino_k, mode_k, nlink_k, uid_k, val gid_k, rdev_k, size_k, blksize_k, blocks_k; val atime_k, mtime_k, ctime_k): New sybol variables. (stream_init): Intern new keywords symbols. * stream.h (statf): Declared. * txr.1: prop documented. Stub for stat created.
* * eval.c (eval_init): new instrinsic function /= registered.Kaz Kylheku2012-09-111-0/+15
| | | | | | | | * lib.c (numneqv): New function. * lib.h (numneqv): Declared. * txr.1: New function documented.
* * txr.1: Documented string library.Kaz Kylheku2012-09-061-1/+371
|
* Spelling, grammar and stylistic fixes. Arguments in functionKaz Kylheku2012-09-031-228/+250
| | | | descriptions should be referred to in angle brackets.
* Some string functions documented.Kaz Kylheku2012-09-021-0/+222
|
* * eval.c (eval_init): Follow function renames.Kaz Kylheku2012-09-021-9/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * hash.c (make_hash): Likewise. * lib.c (assq): Renamed to assql for consistency. (aconsq_new): Renamed to aconsql_new. (aconsq_new_l): Renamed to aconsql_new_l. (alist_remove_test): Use equal rather than eq. Association lists use equal equality by default. (alist_nremove): Use memqual rather than memq. (alist_nremove1): Use equal rather than eq. (merge): Bugfix: unnecessary consing caused by using append instead of nconc on list pieces that are already destructively chopped up. This has implications for the efficiency of sort over lists! (multi_sort_less): Implement key functions. (multi_sort): Interface change: arguments rearranged, and new argument to specify key functions. * lib.h (assoc, assq, assql, aconsq_new, aconsq_new_l): Declarations renamed. (multi_sort): Declaration updated. * txr.1: Documented alist library, list sorting and completed documenting lazy library. * txr.vim: multi-sort highlighted.