summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* command line: support -f in Hash Bang Null Hack.Kaz Kylheku2019-01-281-0/+58
| | | | | | | | | | | | * txr.c (txr_main): In processing the -f option, if there is already an input source, but its name exactly matches the argument of the -f option, then ignore the -f and its option intead of terminating with a diagnostic. This allows the user to use -f in the Null Hack to achieve the usual trick of allowing the script to take options passed through to the interpreter. * txr.1: Documented.
* Version 207.txr-207Kaz Kylheku2019-01-261-3/+3
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.
* doc: review of Lisp CompilationKaz Kylheku2019-01-201-3/+14
| | | | | | | | * txr.1: eval mistakenly referred to instead of compile-file under Compile File. Spurious pluralization of literals fixed. New "Bound symbols in dwim" heading to separate text from discussion of unbound symbols in dwim. Clarifying text added about compile-toplevel's treatment of form.
* Version 206.txr-206Kaz Kylheku2019-01-181-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* carray: fix vec/list conversion bug.Kaz Kylheku2019-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | If a zero-length carray is converted with vec-carray or list-carray and the null-term-p argument is t, there is an exception about a negative index. An empty vector or list should be returned in this case, and the documentation says exactly that. Also, if a carray of unknown length is converted, there is an exception from vec-carray, as documented, but it's an uninformative one that is incidentally produced when -1 is passed to the vec function. The list-carray just returns nil, contravening the documentation. * ffi.c (vec_carray, list_carray): Fix the problems described above. * txr.1: Reviewing the documentation for these functions, an improperly terminated sentence was found.
* Copyright year bump 2019.Kaz Kylheku2019-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * LICENSE, LICENSE-CYG, METALICENSE, Makefile, args.c, args.h, arith.c, arith.h, buf.c, buf.h, cadr.c, cadr.h, combi.c, combi.h, configure, debug.c, debug.h, eval.c, eval.h, ffi.c, ffi.h, filter.c, filter.h, ftw.h, gc.c, gc.h, glob.c, glob.h, hash.c, hash.h, itypes.c, itypes.h, jmp.S, lib.c, lib.h, lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h, parser.l, parser.y, protsym.c, rand.c, rand.h, regex.c, regex.h, share/txr/stdlib/asm.tl, share/txr/stdlib/awk.tl, share/txr/stdlib/build.tl, share/txr/stdlib/cadr.tl, share/txr/stdlib/compiler.tl, share/txr/stdlib/conv.tl, share/txr/stdlib/doloop.tl, share/txr/stdlib/error.tl, share/txr/stdlib/except.tl, share/txr/stdlib/ffi.tl, share/txr/stdlib/getopts.tl, share/txr/stdlib/getput.tl, share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl, share/txr/stdlib/keyparams.tl, share/txr/stdlib/op.tl, share/txr/stdlib/package.tl, share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl, share/txr/stdlib/pmac.tl, share/txr/stdlib/socket.tl, share/txr/stdlib/stream-wrap.tl, share/txr/stdlib/struct.tl, share/txr/stdlib/tagbody.tl, share/txr/stdlib/termios.tl, share/txr/stdlib/trace.tl, share/txr/stdlib/txr-case.tl, share/txr/stdlib/type.tl, share/txr/stdlib/vm-param.tl, share/txr/stdlib/with-resources.tl, share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl, signal.c, signal.h, socket.c, socket.h, stream.c, stream.h, struct.c, struct.h, strudel.c, strudel.h, sysif.c, sysif.h, syslog.c, syslog.h, termios.c, termios.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h, vm.c, vm.h, vmop.h, win/cleansvg.txr: Extended Copyright line to 2018.
* doc: with-dyn-lib mention other deffi-* macros.Kaz Kylheku2019-01-161-4/+18
| | | | | * txr.1: with-dyn-lib relates not only to deffi but also deffi-var and deffi-sym.
* Version 205.txr-205Kaz Kylheku2019-01-151-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* ffi: arrays: be more forgiving of length mismatches.Kaz Kylheku2019-01-151-0/+4
| | | | | | | | | | * ffi.c (min): New macro. (ffi_array_put_common): Tolerate sequences which are shorter than the array. Use seq_info to classify the sequence and use separate code for the vector and list case, avoiding taking the length of the list. * txr.1: Documented.
* New function: square.Kaz Kylheku2019-01-051-0/+20
| | | | | | | | | | | | | The square function calulates (* x x) but is faster for bignum integers by taking advantage of mp_sqr. * arith.c (square): New function. * eval.c (eval_init): Register square as intrinsic. * lib.h (square): Declared. * txr.1: Documented.
* doc: formatting under lop.Kaz Kylheku2018-12-241-2/+2
| | | | | | * txr.1: Closing quote didn't come out in .codn; we must use the \(dq code in this context. Let's make the opening quote \(dq also for consistency.
* doc: grammar fixes under registeer-tentative-def.Kaz Kylheku2018-12-241-4/+2
| | | | | * txr.1: Wrong tense/person of "to expect"; spurious occurrence of foo identifier deleted.
* doc: formatting under caseql*.Kaz Kylheku2018-12-241-1/+1
| | | | * txr.1: .meti should be used to typeset code inline.
* Version 204.txr-204Kaz Kylheku2018-12-171-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* nzerop: new function.Kaz Kylheku2018-12-131-1/+24
| | | | | | | | | | * arith.c (nzerop): New function. * eval.c (eval_init): Register nzerop intrinsic. * lib.h (nzerop): Declared. * txr.1: Documented.
* Version 203.txr-203Kaz Kylheku2018-11-291-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* doc: bad formatting under --noninteractiveKaz Kylheku2018-11-281-1/+3
| | | | * txr.1: Fix .code macro occurring in middle of line.
* New range testing functions.Kaz Kylheku2018-11-271-0/+52
| | | | | | | | | | | * eval.c (eval_init): Register in-range and in-range* intrinsics. * lib.c (in_range, in_range_star): New functions. * lib.h (in_range, in_range_star): Declared. * txr.1: Documented.
* doc: caseql* macro expands cases in global envKaz Kylheku2018-11-271-1/+1
| | | | | | * txr.1: Use the correct term "global environment" rather than "dynamic environment" to desribe the scope in which caseq*, caseql* and casequal* expand the key forms.
* doc: avoid "empty lexical environment".Kaz Kylheku2018-11-271-4/+5
| | | | | | | | | * txr.1: Replace the term "empty lexical environment" with "global environment" in a few places. In one case, it is removed, and the surrounding wording is adjusted. The "empty lexical environment" term is poor because the situations which it describes retain visibility of the "global lexical" variables.
* doc: clarify pretty printing.Kaz Kylheku2018-11-251-3/+34
| | | | | * txr.1: adding more details to description of the effect of pretty printing.
* print: keep colon in keyword symsKaz Kylheku2018-11-251-1/+9
| | | | | | | | * lib.c (obj_print_impl): Always include leading colon when printing keyword symbols, regardless of pretty flag. Subject to backward compatibility. * txr.1: Compat note added.
* doc: refresh documentation of make-lazy-consKaz Kylheku2018-11-251-8/+34
| | | | | | * txr.1: Documentation of make-lazy-cons revised with important clarifications and details, and removal of some overly informal language.
* logxor: fix seriously broken function.Kaz Kylheku2018-11-251-0/+7
| | | | | | | | | | | | | Reported by Guillaume le Vaillant. * arith.c (logxor): Fix broken behavior when the arguments are the same nonzero fixnum, or the same bignum object. (logxor_old): New function: verbatim copy of previous logxor. * eval.c (eval_init): Register logxor intrinsic to the broken function if compatibility is 202 or less. * txr.1: Compat note added.
* Version 202.txr-202Kaz Kylheku2018-11-221-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* doc: clarify delimited continuation compiled semanticsKaz Kylheku2018-11-181-10/+30
| | | | | | | | | | * txr.1: Text describing the changes in behavior, under delmited continuations, of compiled code that mutates variables seemed unclear; it is revised. Also, in the section that discusses compiled versus interpreted differences under Lisp Compilation, a paragraph is added mentioning delimited continuations, referring the reader to this detailed section.
* doc: move functionpKaz Kylheku2018-11-171-14/+14
| | | | | * txr.1: functionp belongs under Functions, not Global Environment.
* doc: use bulleted list under copy.Kaz Kylheku2018-11-171-56/+29
| | | | | * txr.1: Present the type cases of the copy function using a more compact and visually appealing bulleted list.
* copy: call copy-fun for functions.Kaz Kylheku2018-11-171-0/+6
| | | | | | * lib.c (copy): Handle FUN type through copy_fun. * txr.1: Documented.
* compile: handle functions that have environments.Kaz Kylheku2018-11-131-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch, the compile function can handle interpreted function objects that have captured environments. For instance, if the following expression is evaluated (let ((counter 0)) (labels ((bm () (bump)) (bump () (inc counter))) (lambda () (bm)))) then a function object emerges. We can now feed this function object to the compile function; the environment will now be handled. Of course, the above expression is already compileable; compile-toplevel handles it and so does the file compiler. This patch allows the expression to be interpreted and then the function object to be compiled, without access to the surrounding expression. The compiled function will contain a compiled version of the environment, carrying compiled versions of the captured variables and their contents. * eval.c (env_vbindings, env_fbindings, env_next): New static functions. (eval_init): Register env-vbinding, env-fbindings and env-next intrinsics. * share/txr/stdlib/compiler.tl (sys:env-to-let): New function. (usr:compile): Wrap the interpreted lambda terms with let bindings carefully reconstructed from their captured environments. * txr.1: Documented new intrinsic functions.
* copy-fun: duplicate a function, with own environment.Kaz Kylheku2018-11-131-0/+36
| | | | | | | | | | | | | | | | | * eval.c (deep_copy_env): New function. (eval_init): Register copy-fun intrinsic. * eval.h (deep_copy_env): Declared. * lib.c (copy_fun): New function. * lib.h (copy_fun): Declared. * vm.c (vm_copy_closure): New function. * vm.h (vm_copy_closure): Declared. * txr.1: Documented copy-fun.