summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
...
* doc: clarifications under lambda.Kaz Kylheku2019-03-221-1/+21
| | | | | | | | | * txr.1: Make it clearer that the default expression of an optional parameter is only evaluated when required. Document that t, nil and keyword symbols can't be used as parameters, and that duplicates symbols are unspecified, the situation being diagnosed by the compiler but ignored by the interpreter.
* doc: update let/let* doc.Kaz Kylheku2019-03-221-14/+117
| | | | | | * txr.1: specification of let and let* is substantially revised for clarity, and behavior of duplicate symbols, and special variables.
* take: rewrite with seq_info; elide cons.Kaz Kylheku2019-03-201-1/+1
| | | | | | | | | | | | | * lib.c (take_list_fun, take_while_list_fun): Renamed to lazy_take_list_fun and lazy_take_while_list_fun respectively. (lazy_take_list_fun, take): take upgraded to use seq_info to classify sequence. In the lazy list case, the state cons is elided; the list is passed as the function environment, and the remaining count is propagated in the lazy cons's car field. (lazy_take_while_list_fun, take_while): Similar changes. * txr.1: Fixed accidental reference to drop function in the documentation for the take function.
* doc: clarify split/partition difference.Kaz Kylheku2019-03-181-0/+8
| | | | | * txr.1: Under in split doc, add a sentence highlighting the difference between split and partition.
* doc: clarifications regarding struct-typeKaz Kylheku2019-03-131-0/+12
| | | | | * txr.1: Clarifying text added under find-struct-type and struct-type-p to better explain struct-type.
* oop: make struct symbol supertype of all structs.Kaz Kylheku2019-03-131-2/+12
| | | | | | | | * lib.c (subtypep): If the supertype is struct, then return t if the subtype is the name of a struct type. * txr.1: Update the type graph to show the struct root, adding a note about it.
* lazy conses: support state in car and cdr.Kaz Kylheku2019-03-131-5/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here we allow application code to take advantage of a trick already used internally. When a lazy cons cell is created, we can temporarily put state information into its car and cdr fields. When these fields are accessed normally, by the car and cdr function, the lazy cons' update function will be invoked, which will populate these fields. If we have a way for that function to retrieve the existing values of those fields, then the function can treat those fields as state information: it can retrieve the values into temporary local variables, overwrite the original values, and then propagate the state information into the car and cdr into the next lazy cons cell being added. Thus lazy list generation that needs two cells of state or less does not require the allocation of a context object. * eval.c (eval_init): make-lazy-cons becomes a three-argument function with two optional parameters. New functions lcons-car and lcons-cdr are registered. * lib.c (make_lazy_cons_pub): New function, wrapping make_lazy_cons_car_cdr with argument defaulting. (lcons_car, lcons_cdr): New functions. * lib.h (make_lazy_cons_pu, lcons_car, lcons_cdr): Declared. * txr.1: Updated doc of make-lazy-cons regarding new arguments. Documented lcons-car and lcons-cdr.
* doc: more accurate dialect note about package prefixes.Kaz Kylheku2019-03-121-1/+8
| | | | | * txr.1: Update the possibly misleading dialect note about treatment of foo:bar in ANSI CL.
* where: convert to lazy.Kaz Kylheku2019-03-121-2/+3
| | | | | | | | * lib.c (lazy_where_func, lazy_where_hash_func): New static functions. (where): Rewritten to generate lazy list. * txr.1: Doc updated.
* parser: catch out-of-range floats.Kaz Kylheku2019-03-121-0/+5
| | | | | | | | | | * parser.l (out_of_range_float): New static function. (grammar): Check for flo_str returning nil in several places; that value is returned for out of range floats. This is not documented! * txr.1: Document athat flo-str returns nil for out-of-range floats.
* New sequence iterator object and functions.Kaz Kylheku2019-03-111-0/+60
| | | | | | | | | | | | | | | | | * eval.c (eval_init): Register seq-begin, seq-next and seq-reset. * lib.c (seq_iter_s): New symbol variable. (seq_iter_mark): New static function. (seq_iter_ops): New static structure. (seq_begin, seq_next, seq_reset): New functions. (obj_init): Intern seq-iter symbol, used as class name for iterators. * lib.h (seq_iter_s, seq_begin, seq_next, seq_reset): Declared. * txr.1: Documented.
* doc: document division by zero.Kaz Kylheku2019-03-091-0/+17
| | | | | | * txr.1: Document that floor, mod, floor-rem and other functions in this family throw an exception if the divisor is zero.
* expt: handle negative integer exponents with integer bases.Kaz Kylheku2019-03-091-2/+13
| | | | | | | | | * arith.c (expt): The function overhauled. Raising integers to negative integers now works. Raising zero to a negative is diagnosed as a division by zero for operands of all kinds. * txr.1: Documentation updated for expt, and also division by zero error is documented for the / function.
* Version 213.txr-213Kaz Kylheku2019-03-081-3/+3
| | | | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated. * protsym.c: Likewise.
* defset: eliminate the get-form argument.Kaz Kylheku2019-03-081-38/+46
| | | | | | | | | | | | | * share/txr/stdlib/defset.tl (defset-expander): Drop getform argument. Obtain the arguments of the place in a variable called args, which is then explicitly destructured with tree-case to match the params list. Having all of the original arguments in args, we can work backwards to replace some of them with gensyms. The resulting gensym-ized list is used to generate the access call to the operator named by name. * txr.1: Update doc to get rid of get-form. Updated and corrected the long form example.
* defset: support improper list places.Kaz Kylheku2019-03-081-2/+15
| | | | | | | | | | | * share/txr/stdlib/defset.tl (defset-expander): Check for restpar being an atom and handle differently. We still don't handle the case where (b . c) is matched against a rest parameter; in this case the mapcar will process an improper list. I.e. the improper form must have an atom which matches the position of the rest parameter. * txr.1: Updated.
* defset: support parameter macros.Kaz Kylheku2019-03-081-0/+33
| | | | | | | | | | | * defset.tl (defset-expander): Add logic to expand parameter list to determine additional paramters that may come out of the expansion, as well as additional symbols that may be visible as a result as a result of processing in the expanded body. These symbols are included in the same way as original the original parameters. * txr.1: Documented defset's support for parameter list macros.
* New macro: defset.Kaz Kylheku2019-03-061-0/+260
| | | | | | | | | | | | | | * lisplib.c (defset_instantiate, defset_set_entries): New static functions. (lisplib_init): Register auto-load of defset.tl, keyed on defset symbol. * share/txr/stdlib/defset.tl: New file. * share/txr/stdlib/paramt.tl (param-parser-base opt-syms): New method. * txr.1: Documented.
* doc: justify lack of seed keyword in hash construction.Kaz Kylheku2019-03-051-0/+8
| | | | | | * txr.1: The hash function doesn't support a keyword like :seed <n> to specify the hash seed. Adding an explanation of why. Spoiler: security reason.
* doc: fix too-wide make-hash syntaxKaz Kylheku2019-03-051-1/+2
| | | | | * txr.1: Fold make-hash over two lines to avoid 80 col overflow under man.
* New macro: load-for.Kaz Kylheku2019-03-021-0/+106
| | | | | | | | | * eval.c (me_load_for): New function. (rt_load_for): New static function. (eval_init): Register load-for macro and sys:rt-load-for intrinsic function. * txr.1: Documented.
* doc: mention lines limitation of listener.Kaz Kylheku2019-02-271-0/+4
| | | | | | * txr.1: Editing a buffer that has more lines than the terminal can display sort of works but is is sub-par; let's document this.
* linenoise: raise line length from 1023 to 4095.Kaz Kylheku2019-02-261-3/+2
| | | | | | * linenoise.c (LINENOISE_MAX_LINE): Change to 4096. * txr.1: Updated.
* doc: grammar in update expander description.Kaz Kylheku2019-02-261-1/+1
| | | | | * txr.1: Add missing word in a sentence under The Update Expander.
* doc: fix references to sys:expand.Kaz Kylheku2019-02-261-9/+9
| | | | | * txr.1: In a few places, we are referring to sys:expand which has been made public as usr:expand.
* doc: reorganize hashing documentation.Kaz Kylheku2019-02-251-85/+123
| | | | | | | | * txr.1: Moving description of hash table sfrom under make-hash function into an intro section under Hashing Library. Revising some of the text on weak keys and values, adding discussion of hash seed, and mentioning clearhash in the text that discusses deletion of keys from a hash being traversed.
* Version 212.txr-212Kaz Kylheku2019-02-241-3/+3
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* bracket: new function.Kaz Kylheku2019-02-241-0/+72
| | | | | | | | | | * eval.c (eval_init): Register bracket intrinsic. * lib.c (bracket): New function. * lib.h (bracket): Declared. * txr.1: Documented.
* path-sep-chars: document first char being special.Kaz Kylheku2019-02-231-0/+4
| | | | | * txr.1: If a platform has multiple path separator characters and one of them is preferred, it appears first. Document this.
* doc: clarification in cptr-int.Kaz Kylheku2019-02-201-2/+2
| | | | | * txr.1: Remove unclear pronoun in remark about addressing structure.
* doc: wrong word under cptr.Kaz Kylheku2019-02-201-1/+1
| | | | * txr.1: Fix "an" that should be "and".
* Version 211.txr-211Kaz Kylheku2019-02-181-3/+3
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* doc: clarify that ftw takes a list or path.Kaz Kylheku2019-02-171-50/+46
| | | | | * txr.1: Make it clearer that ftw operates on a list; that fact was too buried in the documentation.
* save-exe: new function.Kaz Kylheku2019-02-171-48/+28
| | | | | | | | | | | | | | * lisplib.c (save_exe_instantiate, save_exe_set_entries): New static functions. (lisplib_init): Register auto-load of save-exe module, keyed to save-exe symbol. * share/txr/stdlib/save-exe.tl: New file. * txr.1: Removing txr-embedded-arg.txr documentation and documenting save-exe in its place. * txr-embedded-arg.txr: File removed.
* scan-until-match, count-until-match: new functions.Kaz Kylheku2019-02-161-2/+46
| | | | | | | | | | | | | * regex.c (scan_until_common): New static function, made from read_until_match. (read_until_match): Now just wrapper for scan_until_common. (scan_until_match, count_until_match): New functions. (regex_init): Registered new intrinsics scan-until-match and count-until-match. * regex.h (read_until_match, scan_until_match): Declared. * txr.1: Documented.
* fill-buf-adjust: new function.Kaz Kylheku2019-02-161-1/+18
| | | | | | | | | * stream.c (fill_buf_adjust): New function. (stream_init): Register fill-buf-adjust intrinsic. * stream.h (fill_buf_adjust): Declared. * txr.1: Documented.
* buf-alloc-size: new function.Kaz Kylheku2019-02-161-0/+9
| | | | | | | | | * buf.c (buf_alloc_size): New function. (buf_init): buf-alloc-size intrinsic registered. * buf.h (buf_alloc_size): Declared. * txr.1: Documented.
* txr-exe-path: New variable.Kaz Kylheku2019-02-151-4/+3
| | | | | | | | | * txr.c (sysroot_init): Make prog_path available via the txr-exe-path variable. The txr-path variable becomes obsolescent. * txr.1: Documented txr-exe-path; removed documentation for txr-path.
* Version 210.txr-210Kaz Kylheku2019-02-141-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* symdiff: new function.Kaz Kylheku2019-02-141-9/+23
| | | | | | | | | | | | * eval.c (eval_init): Register symdiff intrinsic. * lib.c (symdiff): New function. * lib.h (us_car_p, us_cdr_p): New inline functions. (symdiff): Declared. * txr.1: Documented, also fixing issues not related to symdiff doc.
* optimizing diff, isec and uni for non-lists.Kaz Kylheku2019-02-131-3/+36
| | | | | | | | | | | | | | | Also, these functions now support hashes. * eval.c (eval_init): Register only the deprecated set-diff to the set_diff function. The diff intrinsic is now going to the new function named diff. * lib.c (diff): New function. (isec, uni): Rewritten to use seq_iter_t. * lib.h (diff): Declared. * txr.1: Documentation updated.
* hash-from-alist: new function.Kaz Kylheku2019-02-131-1/+17
| | | | | | | | | * hash.c (hash_from_alist_v): New function. (hash_init): Register hash-from-alist intrinsic. * hash.h (hash_from_alist_v): Declared. * txr.1: Documented.
* hash-symdiff: new function.Kaz Kylheku2019-02-131-1/+21
| | | | | | | | | * hash.c (hash_symdiff): New function. (hash_init): hash-symdiff intrinsic registered. * hash.h (hash_symdiff): Declared. * txr.1: Documented.
* doc: fix reference to nonexistent load-value.Kaz Kylheku2019-02-111-2/+2
| | | | | | * txr.1: In Notes under load-time, the function is once referred to as load-value; also the phrase load-time value is used that can just be load-time.
* Version 209.txr-209Kaz Kylheku2019-02-081-3/+3
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* doc: formatting under ffi-make-closure.Kaz Kylheku2019-02-061-2/+2
| | | | * txr.1: Run-on period on identifier; extra words.
* sum and prod take keyfun argument.Kaz Kylheku2019-02-021-13/+23
| | | | | | | | | | | | | * eval.c (eval_init): Adjust registrations of sum and prod to be binary functions with an optional argument. * lib.c (nary_op_keyfun, sumv, prodv): New static functions. (sum, prod): Implement optional keyfun argument via sumv and prodv helpers. * lib.h (sum, prod): Declarations updated. * txr.1: Documentation updated.
* compiler: new dump-compiled-objects function.Kaz Kylheku2019-02-011-0/+93
| | | | | | | | | | | | | * lisplib.c (compiler_set_entries): Register dump-compiled-objects for auto-loading. * share/txr/stdlib/compiler.tl (usr:dmp-to-tlo): New function. (compile-file): Code to be shared with dump-compiled-objects moved into dump-to-tlo function. (usr:dump-compiled-objects): New function. * txr.1: Documented.
* doc: document string and bignum merging.Kaz Kylheku2019-01-311-0/+55
| | | | * txr.1: New section on Treatment of literals.
* Version 208.txr-208Kaz Kylheku2019-01-281-2/+2
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.