summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
...
* * 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.
* * txr.1: Lots of new documentation. Major rearrangement of document,Kaz Kylheku2012-09-011-1018/+1297
| | | | with new headings.
* Fixing accidental edit.Kaz Kylheku2012-09-011-1/+1
|
* * txr.1: Minor corrections, and documented most stream functions,Kaz Kylheku2012-09-011-3/+187
| | | | except directory-related ones.
* * txr.1: Documented print, pprint, tostring and tostringp.Kaz Kylheku2012-09-011-0/+36
|
* * stream.c (vformat): Bugfix: under the ~a and ~s directives,Kaz Kylheku2012-08-311-0/+146
| | | | | | | apply field formatting to the object not only if a nonzero width has been specified, but also if precision has been specified. * txr.1: documented stream global variables and format.
* * txr.1: Documented chain, andf, orf and iff.Kaz Kylheku2012-08-301-0/+96
|
* * eval.c (eval_intrinsic): Bugfix: take the expanded form insteadKaz Kylheku2012-08-301-0/+15
| | | | | | | of throwing it away. (expand): Recurse into expand_place for (set ...) forms. * txr.1: Documented eval.
* * txr.1: Documented all functions related to hashing.Kaz Kylheku2012-08-301-2/+182
|
* * eval.c (mapcarv): Changed to external linkage.Kaz Kylheku2012-08-291-0/+2
| | | | | | | | | | | | * eval.h (mapcarv): Declaration added. (eval_init): New intrinsic multi-sort registered. * lib.c (multi_sort_less): New static function. (multi_sort): New function. * lib.h (multi_sort): Declared. * txr.1: stub section added.
* * eval.c (eval_init): Registered open-command and open-processKaz Kylheku2012-05-181-1/+3
| | | | | | | | | | | | intrinsics. open-pipe is now deprecated but stays for backward compatibility as a synonym for open-command. * stream.c (open_pipe): Renamed to open_command. (open_pipevp): Renamed to open_process. * stream.h (open_pipe, open_pipevp): Declarations updated. * txr.1: Documentation headings updated.
* Implementing new pipe function to get around the limitationKaz Kylheku2012-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | that popen accepts a complete command. We need something which accepts a program name, and a list of arguments, so that we don't have to assemble together a correctly quoted string. popen needs an alternative interface resembling execvp. * eval.c (eval_init): New intrinsic registered, open-pipe-args. * stream.c (struct stdio_handle): New member, pid. (stdio_stream_print): Print the pid, if it is nonzero. (pipevp_close): New close function. (pipe_close): If h->pid is nonzero, it's a new-style pipe, which must be closed with pipev_close. (make_stdio_stream, make_pipe_stream): Initialize new stdio_handle member to zero. (make_pipevp_stream): New static function. (open_pipevp): New function. * stream.h (open_pipevp): Declared. * txr.1: open-pipe-args added to stub section heading.
* * match.c (v_collect): Implemented semantics for repeat symbol.Kaz Kylheku2012-05-171-0/+19
| | | | | | | | | | | | | | | | (dir_tables_init): Register dispatch for repeat to v_collect function. * parser.y (collect_repeat): New nonterminal symbol. (clause): Removed repeat_clause error case because that now clashes with the syntax in collect_clause. (collect_clause): Repeat syntax implemented, with help of collect_repeat. (out_clause): Error case for collect_clause removed due to syntactic clash. * txr.1: Added mention of @(collect :vars nil) and documented @(repeat) as the shorthand.
* Version 65txr-65Kaz Kylheku2012-04-201-2/+2
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * txr.1: Documented new regex tokens.Kaz Kylheku2012-04-191-1/+15
|
* * eval.c (eval_init): New intrinsic functions remq*, remql*,Kaz Kylheku2012-04-151-1/+37
| | | | | | | | | | | | | remqual*, remove-if*, keep-if*. * lib.c (rem_lazy_func, rem_lazy_rec): New static functions. (remq_lazy, remql_lazy, remqual_lazy, remove_if_lazy, keep_if_lazy): New functions. * lib.h (remq_lazy, remql_lazy, remqual_lazy, remove_if_lazy, keep_if_lazy): Declared. * txr.1: New functions documented.
* * eval.c (eval_init): find-if intrinsic registered.Kaz Kylheku2012-04-141-1/+1
| | | | | | | | | | | * lib.c (find): First and second arguments reversed. The item should be first. (find_if): New function. * lib.h (find): Declaration updated. (find_if): Declaration added. * txr.1: Stub section.
* * eval.c (eval_init): New functions remove-if and keep-if.Kaz Kylheku2012-04-141-0/+43
| | | | | | | | * lib.c (remove_if, keep_if): New functions. * lib.h (remove_if, keep_if): Declared. * txr.1: Documented.
* * txr.1: Fixed wrong comment in example.Kaz Kylheku2012-04-111-1/+1
|
* * txr.1: Fix misleading comment example.Kaz Kylheku2012-04-111-1/+2
|
* Provide access to line number info and source path.Kaz Kylheku2012-04-111-0/+4
| | | | | | | | | | | | | | * eval.c (eval_init): New intrinsic functions source-loc and source-loc-str. New variable *self-path*. * txr.1: Stub doc sections. * txr.c (self_path): New variable. * txr.h (self_path): Declared. * txr.vim: Syntax highlighting for source-loc, source-loc-str and *self-path*.
* * eval.c (eval_init): Expose regex-compile and regexp as intrinsics.Kaz Kylheku2012-04-101-0/+40
| | | | | | | | | | | | | * lib.c (obj_init): Change spelling of nongreedy operator and put it into the user package so that it is available for use with regex-compile. * regex.c (match_regex, search_regex): Bugfix: optional start position argument argument not defaulting to zero. * txr.1: Documented regex-compile and regexp. * txr.vim: Highlighting regex-compile and regexp.
* * arith.c (bignum): Previously static function now exposed as external.Kaz Kylheku2012-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | * arith.h (bignum): Declared. * configure: Added check for tm_gmtoff and tm_tmzone fields being present in struct tm. * eval.c (eval_init): New intrinsic functions: time, time-usec. * lib.c (num): If the cnum is outside of the fixnum range, then construct a bignum. (time_sec, time_sec_usec): New functions. * lib.h (mut): Slight change to macro to eliminate compiler warning. (time_sec, time_sec_usec): Declared. * txr.1: Stub section for time and time-usec. * txr.vim: Highlighting for time and time-usec.
* * txr.1: Documented int-flo, flo-int, search-regex,Kaz Kylheku2012-04-071-0/+72
| | | | match-regex and regsub.
* Rounding out hash table functionality with lazy lists thatKaz Kylheku2012-04-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | can walk table content in different ways. * eval.c (op_dohash): Follow interface change of hash_next. (eval_init): hash-keys, hash-values, hash-pairs and hash-alist intrinsics introduced. * filter.c (trie_compress): Follow interface change of hash_next. * hash.c (hash_next): Silly interface which takes a pointer to the iterator has changed to just take the iterator. The function unambiguously returns nil when the iteration ends, so there is no need to set the iterator variable to nil. (maphash): Follows interface change of hash_next. (hash_keys_lazy, hash_values_lazy, hash_pairs_lazy, hash_alist_lazy): New static functions. (hash_keys, hash_values, hash_pairs, hash_alist): New functions. * hash.h (hash_next): Declaration updated. (hash_keys, hash_values, hash_pairs, hash_alist): Declared. * lib.c (make_half_lazy_cons): New way of constructing lazy cons, with the car field specified. It simplifies situations when the previous cons computes the car of the next one. Why hadn't I thought of this before? * lib.h (make_half_lazy_cons): Declared. * txr.1: Doc stubs for new hash functions. * txr.vim: Highlighting for new hash functions.
* Version 64txr-64Kaz Kylheku2012-04-061-2/+2
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* If one of the blocks which are subordinate to a @(trailer)Kaz Kylheku2012-03-311-0/+30
| | | | | | | | | | | | | | | | | | | | | happen to request a successful termination by invoking @(accept) the position must not advance into the trailer material. * match.c (v_trailer): Added an unwind protect which detects that an accept is taking place and adjusts the return value to restrict the input position at the point given to trailer. (accept_fail): Use uw_block_return_proto instead of uw_block_return and pass the symbol as the protocol identifier. * unwind.c (uw_current_exit_point): New function. (uw_block_return): Function renamed to uw_block_return_proto; takes new parameter which is stored in the block structure. * unwind.h (struct uw_block): New member, protocol. (uw_block_return): Becomes an inline wrapper for uw_block_return_proto. (uw_block_return_proto, uw_current_exit_point): Declared. * txr.1: Interaction between @(trailer) and @(accept) documented.
* * match.c (h_var): Disallow the variable named by the symbol tKaz Kylheku2012-03-301-0/+12
| | | | | | | | by throwing an exception. Allow nil, but wherever nil occurs, do not produce a binding. * txr.1: State the restrictions against using t in the section on Variables and also describe the nil ignore feature.
* * txr.1: Correction: backtracking does NOT take place into a blockKaz Kylheku2012-03-301-3/+3
| | | | which completed.
* * txr.1: Documenting the debugger with an example session.Kaz Kylheku2012-03-301-0/+192
|
* Version 63txr-63Kaz Kylheku2012-03-301-2/+2
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * lib.c (num_str): Much more accurate test for deciding whetherKaz Kylheku2012-03-301-4/+41
| | | | | | | | | to treat the number as floating or integer. We can't just look for the presence of E, e or . because these coudl be part of trailing junk for instance "123XYZE." should convert to the integer 123, where "XYZE." is trailing junk. * txr.1: Documented int-str, flo-str and num-str.
* * lib.c (min2, max2): Semantics tweak. If the numbers are equal,Kaz Kylheku2012-03-291-0/+25
| | | | | | favor the left one. * txr.1: Documented min and max.
* * arith.c (numeq): New function.Kaz Kylheku2012-03-291-5/+131
| | | | | | | | | | | | | | | | | (exptmod): Bugfix: was no normalizing the bignum, ouch. Also was reporting "non-integral operands" for other errors. * eval.c (eval_init): Registered = intrinsic function. * lib.c (numeqv): New function. * lib.h (numeq, numeqv): Declared. * txr.1: Documented expt, sqrt, isqrt, exptmod, fixnump, bignump, integerp, floatp, numberp, zerop, evenp, oddp, >, <, >=, <= and =. * txr.vim: Highlight =
* * arith.c (gcd): Allow zeros. Don't issue "non-integral"Kaz Kylheku2012-03-291-1/+92
| | | | | | | | | | | | | | | exception if MPI fails. (floorf, ceili): Map integer argument to itself. (tang, asine, acosi): New functions. * eval.c (eval_init): New intrinsics: tan, asin, acos. * lib.h (tang, asine, acosi): Declared. * txr.1: Documented gcd, abs, floor, ceil, sin, cos, tan asin, acos, atan, log, and exp. * txr.vim: Highlighting for tang, asine, acosi.
* * arith.c (dmod): New static function.Kaz Kylheku2012-03-291-4/+34
| | | | | | | | (mod): Use dmod instead of fmod directly, to calculate the correct semantics for combinations of negative operands in the floating point domain also. * txr.1: Documented /, trunc and mod.
* * txr.1: Documented +, - and *.Kaz Kylheku2012-03-291-1/+69
|
* * txr.1: num-str added to doc stub.Kaz Kylheku2012-03-291-1/+1
| | | | * txr.vim: num-str added.
* * eval.c (eval_init): New intrinsic num-str registered.Kaz Kylheku2012-03-261-5/+34
| | | | | | | | | | | | | | | * filter.c (tonumber_k, tointeger_k, tofloat_k, hextoint_k): New keyword variables. (filter_init): New variables initialized; new filters registered. * filter.h (tonumber_k, tointeger_k, tofloat_k, hextoint_k): Declared. * lib.c (num_str): New function. * lib.h (num_str): Declared. * txr.1: New filters documented.
* * lib.c (rebind_s): New symbol variable.Kaz Kylheku2012-03-241-3/+37
| | | | | | | | | | * lib.h (rebind_s): Declared. * match.c (v_rebind): New static function. (dir_tables_init): Registered rebind_s to v_rebind, and also to hv_trampoline in the horizontal directive table. * txr.1: Documented it.
* * eval.c (eval_init): Register match-str and match-str-treeKaz Kylheku2012-03-241-0/+4
| | | | | | | | | | intrinsics. * lib.c (match_str, match_str_tree): Default position to zero. * txr.1: Doc stubs created. * txr.vim: Highlighting for match-str and match-str-tree.
* Version 62txr-62Kaz Kylheku2012-03-231-2/+2
| | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped.
* * RELNOTES: Updated.Kaz Kylheku2012-03-231-2/+48
| | | | * txr.1: Describe floating-point constants.
* * arith.c (expo): New function.Kaz Kylheku2012-03-221-1/+1
| | | | | | | | | | * eval.c (eval_init): expo registered as intrinsic exp. * lib.h (expo): Declared. * txr.1: Added to stub heading. * txr.vim: Highlighting for exp.
* Fix sqrt confusion. There must be a separate isqrtKaz Kylheku2012-03-221-2/+6
| | | | | | | | | | | | | | | | | for the integer square root. * arith.c (sqroot_fixnum): Renamed back to isqrt_fixnum. (sqroot): Rewritten to handle only floating-point square root. (isqrt): New function, based on previous sqroot, handles only integers. * eval.c (eval_init): New intrinsic, isqrt. * lib.h (isqrt): New declaration. * txr.1: Doc stubs. * txr.vim: Highlighting for isqrt.
* * arith.c (floorf, ceili, sine, cosi, atang, loga): New functions.Kaz Kylheku2012-03-221-0/+2
| | | | | | | | | | | * eval.c (eval_init): New intrinsic functions registered: floor, ceil, sin, cons, atan, log. * lib.h (floorf, ceili, sine, cosi, atang, loga): Declared. * txr.1: Doc stub section for new functions. * txr.vim: Highighting added.