summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
...
* * 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.
* * arith.c (divi): New function.Kaz Kylheku2012-03-211-1/+1
| | | | | | | | | | * eval.c (eval_init): divi registered as / intrinsic. * lib.h (divi): Declared. * txr.1: divi added to stub heading. * txr.vim: / operator highlighted.
* * txr.1: Doc stubs for new functions floatp, integerp,Kaz Kylheku2012-03-211-2/+4
| | | | | | float-str, int-flo and flo-int. * txr.vim: Highlighting for new functions.
* * eval.c (eval_init): url_decode has two parameters now,Kaz Kylheku2012-03-181-4/+14
| | | | | | | | | | | | | | | | | | so we make the second one optional. * filter.c (topercent_k, frompercent_k): New keyword variables. (url_encode, url_decode): Take a second parameter, space_plus. This determines whether or not to apply the rule that a space encodes as a + character. (filter_init): Initialize new keyword variables, and register :topercent and :frompercent filters. Fix the previous registrations of :tourl and :fromurl using currying. * filter.h (urlencode, urldecode): Declarations updated. (topercent_k, frompercent_k): Declared. * txr.1: Documented.
* * eval.c (eval_init): New intrinsic functionsKaz Kylheku2012-03-161-0/+6
| | | | | | | | | | | | | | | | | | chain, andf, orf, iff. * lib.c (chainv): New function. (do_and, do_or): Generalized to handle functions of any arguments via apply. (andf, orf): Turn do_and and do_or into variadic function instead of a monadic function. (do_iff): New static function. (andv, orv, iff): New functions. * lib.h (chainv, andv, orv, iff): New functions declared. * txr.1: Doc stubs created. * txr.vim: Updated.
* Formatting fix.Kaz Kylheku2012-03-161-3/+1
|
* Version 61txr-61Kaz Kylheku2012-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * eval.c (op_modplace): Fix warning about uninitialized variable. No bug. * filter.c: gcc compilation regresion: missing <stdio.h> breaks inclusion of "stream.h" header. Strangely, didn't show up when configured for compiling with g++ on Ubuntu. * match.c (match_filter): Fixed ununsed variable warning. * txr.vim: Bunch of missing keywords added. * dep.mk: Regenerated.
* * txr.1: Documented hash and vector quasiliterals.Kaz Kylheku2012-03-141-2/+45
|
* Implementing #H((...) ...) read/print syntax for hash tables.Kaz Kylheku2012-03-141-1/+13
| | | | | | | | | | | | | | | | * hash.c (print_key_val, hash_print_op): New static functions. (hash_ops): hash_print_op wired in in place of cobj_print_op. * parser.l (HASH_H): New token recognized. * parser.y (HASH_H): New terminal symbol. (hash): New nonterminal symbol. (expr): Acquires hash as a constituent. (hash_from_notation): New static function. * txr.1: Hash syntax described. * txr.vim: Updated.
* Change: @(block) requires @(end) from now on.Kaz Kylheku2012-03-131-21/+80
| | | | | | | | | | | | | | | | | | | Blocks no longer extend to the end of the surrounding scope. * match.c (v_block): Rewrite for new syntax. * parser.l (BLOCK): New token type handled. * parser.y (BLOCK): New token. (block_clause): New nonterminal grammar symbol. (clause): Collateral fix: replaced a bunch of list(X, nao) forms with cons(X, nil). Introduced block_clause as a constituent of clause. * txr.1: Revamped documentation of block, and wrote about using blocks for reducing nested skips and reducing backtracking in general.
* Implementing URL filtering.Kaz Kylheku2012-03-131-0/+21
| | | | | | | | | | | | | | | | * eval.c (eval_init): New intrinsic functions: url-encode, url-decode. * filter.c (tourl_k, fromurl_k): New keyword variables. (is_url_reserved, digit_value): New static functions. (url_encode, url_decode): New functions. (filter_init): Intialize new keyword variables and register new :tourl and :fromurl filters. * filter.h (tourl_k, fromurl_k, url_encode, url_decode): Declared. * txr.1: Updated. * txr.vim: Likewise.
* Fix brace/paren mismatch.Kaz Kylheku2012-03-051-1/+1
|
* * eval.c (eval_init): New intrinsic function, regsub.Kaz Kylheku2012-03-041-0/+2
| | | | | | | | * regex.c (regsub): New function. * regex.h (regsub): Declared. * txr.1: Doc stub added.
* Version 60Kaz Kylheku2012-03-041-2/+2
| | | | | | | | | | | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated. * txr.vim: Handle : symbol properly. * eval.c (op_defun): Bugfix: documentation says that defun supports the same parameter list as lambda, and that is the intent. But this was broken, since op_defun was expecting the parameter list to be a proper list containing only bindable symbols, ruling out the use of the consing dot for rest parameter as well as the colon keyword symbol for optional parmeters.
* * eval.c (eval_init): Expose remq, remql and remqual.Kaz Kylheku2012-03-031-0/+18
| | | | * txr.1: Documented.
* Adding major section headings for the basic directives,Kaz Kylheku2012-03-011-0/+4
| | | | and for load.
* Pluralization fix in bind directive.Kaz Kylheku2012-03-011-23/+23
| | | | Load directive moved before Output section.
* Or operator computes logical or, not and.Kaz Kylheku2012-03-011-2/+2
| | | | Fixed typo.
* Confusing comment removed from examples of the op operator.Kaz Kylheku2012-03-011-2/+0
|
* Another instance of bad troff syntax.Kaz Kylheku2012-03-011-5/+5
|
* Fix bad troff syntax caused by apostrophe at the start of a line.Kaz Kylheku2012-03-011-2/+2
|
* Clarification about TXR Syntax.Kaz Kylheku2012-03-011-2/+3
|
* Capitalization.Kaz Kylheku2012-03-011-1/+1
|
* Minor fix.Kaz Kylheku2012-03-011-1/+1
|
* Version 59txr-59Kaz Kylheku2012-02-281-2/+2
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * match.c (extract): Check for negative value of opt_nobindings,Kaz Kylheku2012-02-271-1/+9
| | | | | | | | | | | which forces the printing. * txr.c (help): Under -b, mention that printing the word false is suppressed also. Added documentation for -B. (main): Implemented -B option. * txr.1: Documented -B option and added clarifying text under -b option explaining the conditions under which bindings are printed.