summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
...
* new macros: hlet, hlet*.Kaz Kylheku2018-04-191-0/+22
| | | | | | | | | | * lisplib.c (yield_set_entries): Add hlet and hlet* to autoload list. * share/txr/stdlib/yield.tl (hlet-expand): New function (hlet, hlet*): New macros. * txr.1: Documented.
* compiler: don't expand top-level forms twice.Kaz Kylheku2018-04-181-1/+7
| | | | | | | | | | * share/txr/stdlib/compiler.tl (usr:compile-toplevel): Support optional parameter indicating that no expansion is required. (usr:compile-file): Call compile-toplevel with a t argument for the new expanded-p parameter, so no further expansion takes place. * txr.1: Document new optional parameter of compile-toplevel.
* Version 191.txr-191Kaz Kylheku2018-04-101-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim, protsym.c: Regenerated.
* doc: new package fallback use by printer.Kaz Kylheku2018-04-101-1/+3
| | | | | * txr.1: Update the description of how the printer avoids ambiguity when making use of the packag fallback list.
* doc: document new pub package.Kaz Kylheku2018-04-091-11/+32
| | | | | | * txr.1: Fix places which say that *package* is initialized to the user package. Under *package*, describe the pub package. Compat notes added.
* doc: vm-fun-p described.Kaz Kylheku2018-04-091-0/+22
| | | | * txr.1: Document vm-fun-p.
* compiler: implement with-compilation-unit macro.Kaz Kylheku2018-04-091-0/+35
| | | | | | | | | | | | * lisp.c (compiler_set_entries): Add with-compilation-unit to autoload symbols for compile module. * share/txr/stdlib/compiler.tl (usr:with-compilation-unit): New macro. (usr:compile-file): Use with-compilation-unit macro to dump warnings if a file is processed alone. * txr.1: Documented.
* doc: document force-flag.Kaz Kylheku2018-04-091-5/+92
| | | | | | * txr.1: Documented force-break and the altered return value of width-check. The existence of a stream's force flag is mentioned under width check.
* doc: document disassemble.Kaz Kylheku2018-04-091-0/+51
| | | | * txr.1: Adding description of disassemble function.
* doc: describe new ldiff.Kaz Kylheku2018-04-091-87/+160
| | | | | * txr.1: ldiff documentation moved under Sequence Manipulation and rewritten. Compatibility note added.
* doc: copy-paste errors in structs.Kaz Kylheku2018-04-081-3/+3
| | | | | | * txr.1: Fixed syntax synopsis under struct-type using structp. Improved some wording here. Fixed static-slot-home's syntax synopsis wrongly referring to static-slot-ensure.
* doc: document more about file compilation.Kaz Kylheku2018-04-081-0/+143
| | | | | * txr.1: Add descriptions of compile-file, compile-only and eval-only.
* doc: starting to document compilation.Kaz Kylheku2018-04-081-7/+286
| | | | | * txr.1: Description of load includes treatment of .tlo files. New major section on Lisp compilation.
* macro param lists: remove colon hack.Kaz Kylheku2018-04-041-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Going forward, when : appears as the argument of an optional parameter in destructuring, it is treated as an ordinary object, and not as "this argument is missing". That is now a feature of function calls only. Rationale: interferes with macros. For instance, the pattern (test : then else) doesn't correctly express the arguments of if, because (if x y :) eats the semicolon. The defaulting behavior is not useful because usually there is no default value for optional structure, other than nil. * eval.c (bind_macro_params): Only implement the colon hack under compatibility with 190. * share/txr/stdlib/place.tl (defplace gethash, defplace fun, defplace symbol-function, defplace symbol-macro, defplace symbol-value): Remove uses of : for defaulting the ssetter argument. This illustrates how useless the feature is for macro destructuring; all these just replace with nil. * txr.1: Clarify that macro parameter lists don't implement the colon trick. It was never explicitly specified that this is the case, but could have been inferred from the statements which indicate that macro parameter lists copy the features of function parameter lists. Added compat notes.
* doc: codify infinite looping behavior of each.Kaz Kylheku2018-03-301-0/+6
| | | | | | | | | * txr.1: the each, append-each and all other variants of operators exhibit inifite looping if the list of bindings is empty. In that case, the terminating condition that at least one list is empty, is never true. The behavior is consistent under compilation and interpretation, so let's just document it.
* doc: null char in str out stream: incorrect.Kaz Kylheku2018-03-301-4/+8
| | | | | | | * txr.1: The described behavior regarding null bytes output into string output streams is incorrect. In fact they are effectively dropped by the put-char operation. Let's not commit to any specific behavior. Also mention pseudo-null.
* doc: incorrect text in rlet exampleKaz Kylheku2018-03-301-3/+2
| | | | * txr.1: Example isn't about swapping variables.
* doc: mistake in ldiff example.Kaz Kylheku2018-03-301-1/+1
| | | | * txr.1: A let in the example should be let*.
* doc: fix too-wide-for-80-cols syntax synopses.Kaz Kylheku2018-03-291-3/+6
| | | | | * txr.1: defmacro, macrolet and mac-param-bind syntax synopses are too wide under 80 column "man txr": breaking up.
* packages: drop no-fallback-list interning restriction.Kaz Kylheku2018-03-091-30/+6
| | | | | | | | | | | | | Removing the restriction that qualified pkg:sym syntax may not cause interning to take place if pkg has a nonempty fallback list. This serves no purpose, only hindering the flexibility of the package system. * parser.y (sym_helper): When processing a qualified symbol, if the package exists, just intern it. * txr.1: Revise all text which touched on the removed rule, to remove all traces of it from the documentation.
* New function: bignum-len.Kaz Kylheku2018-03-061-0/+32
| | | | | | | | | * arith.c (bignum_len): Wew function. (arith_init): Register bignum-len intrinsic. * arith.h (bignum_len): Declared. * txr.1: Documented.
* bugfix: missing actions in reset-struct.Kaz Kylheku2018-02-281-1/+30
| | | | | | | | | | | | * struct.c (reset_struct): Perform the post-init actions are performed, not only the init actions. Also, catch exceptions and call finalizers, just like in a new structure instantiation. * txr.1: Document the requirements for finalizers being called by reset-struct, and clarify the issue of possible duplicate finalization registration. Add compat notes.
* doc: wrong pluralizations of "function".Kaz Kylheku2018-02-271-3/+3
| | | | | | * txr.1: Fix three unrelated occurrences of the same mistake: "functions is", in reference to a single function.
* Version 190.txr-190Kaz Kylheku2018-02-181-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim, protsym.c: Regenerated.
* New listener feature: greedy evaluation feature.Kaz Kylheku2018-02-171-0/+69
| | | | | | | | | | | | | | | | * eval.c (eval_intrinsic_noerr): New function. * eval.h (eval_intrinsic_noerr): Declared. * parser.c (listener_greedy_eval_s): New symbol variable. (repl): Implement greedy evaluation loop, enabled by the *listener-greedy-eval-p* special. (parse_init): Intern the *listener-greedy-eval-p* symbol, storing it in the listener_greedy_eval_s variable. Register the symbol as a special variable. * txr.1: Documented *listener-greedy-eval-p* variable and the greedy evaluation feature that it controls.
* Lisp load function supports .txr files.Kaz Kylheku2018-02-161-23/+78
| | | | | | | | | | | | * eval.c (load): Instead of throwing error when a .txr file is opened, process it according to sensible requirements. * match.c (v_load): Store bindings in the current environment frame before evaluating Lisp, and then update afterward. This allows .txr files loaded from Lisp to continue matching with the current bindings and extend those bindings. * txr.1: Update documentation of load.
* Copyright year bump 2018.Kaz Kylheku2018-02-151-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.c, 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/awk.tl, share/txr/stdlib/build.tl, share/txr/stdlib/cadr.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/txr-case.tl, share/txr/stdlib/type.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, win/cleansvg.txr: Extended Copyright line to 2018.
* doc: fix compat note 156, again.Kaz Kylheku2018-02-141-2/+4
| | | | | | * txr.1: Add missing text to compensate for text that was accidentally edited out, regarding the return value of the empty case of caseq/caseql/casequal.
* New listener variable: *listener-pprint-s*.Kaz Kylheku2018-02-121-0/+21
| | | | | | | | | | * parser.c (listener_pprint_s): New symbol variable. (repl): Check new variable after each evaluation and print accordingly. (parse_init): Initialize listener_print_s with interned symbol and register the variable. * txr.1: Document *listener-pprint-s*.
* Version 189.txr-189Kaz Kylheku2018-02-061-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim, protsym.c: Regenerated.
* doc: write Equality Substitution section.Kaz Kylheku2018-02-051-0/+63
| | | | | | * txr.1: Several places in the document refer to a section called Equality Substitution which supposedly exists under the Structures section. As of now, it actually does!
* doc: clarify text under constantpKaz Kylheku2018-02-051-3/+3
| | | | | * txr.1: Restructure long sentence for readability, fixing awkward comma in the process.
* doc: more detail in ref/refset re: structs.Kaz Kylheku2018-01-311-5/+32
| | | | | | * txr.1: Describe fallback of ref and refset onto list-like operations if lambda/lambda-set are not supported.
* doc: grammatic agreement under equal method.Kaz Kylheku2018-01-301-1/+1
| | | | * txr.1: "behavior ... becomes" second person agreement.
* doc: bad formatting of lambda-set syntaxKaz Kylheku2018-01-301-1/+1
| | | | * txr.1: Fix run-on parenthesis.
* doc: clarification in :maxgap example.Kaz Kylheku2018-01-261-1/+1
| | | | | * txr.1: a :maxgap of zero also means that the collected items must match immediately.
* doc: fix "five lines" typo in :maxgap description.Kaz Kylheku2018-01-261-1/+3
| | | | | | Reported by Martin Dvořák. * txr.1: Word "five" should be "n".
* doc: fix mistake in summary of @(repeat)Kaz Kylheku2018-01-261-2/+2
| | | | | | | Reported by Martin Dvořák. * txr.1: In pattern matching clauses, repeat and rep are shorthands for collect and coll.
* doc: formatting of in directives intro.Kaz Kylheku2018-01-261-1/+3
| | | | * txr.1: use mono font for @(output).
* doc: some clarifications about dwim brackets.Kaz Kylheku2018-01-251-6/+13
| | | | | | txr.1: The equivalences between [x i] and some functions like ref are dynamic; they depend not only on the type ofx, but also whether i is a range or integer.
* doc: update car, cdr, rplaca, rplacd.Kaz Kylheku2018-01-081-26/+114
| | | | | | | | | | | * txr.1: Update the documentation to reflect the current handling of objects, eliminating some contradictions in the process, like text which says that rplacd is erroneous on anything but conses and lazy conses, followed by text which states other kinds of objects are allowed. The semantics of car and cdr forms as places is described strictly in terms of rplaca and rplacd, so the mechanism is then described in one place.
* sub and replace redirect to structure methods.Kaz Kylheku2018-01-011-0/+81
| | | | | | | | | | | | | * lib.c (replace_obj): New static function. (sub): Handle struct case via lambda method. (replace): Handle struct case via replace_obj. * txr.1: Documented. * tests/012/aseq.tl (add): The lambda method now has to handle a range argument. One test case uses the last function, which for non-lists relies on sub, which now calls the lambda method if the object has one.
* New methods rplaca and rplacd.Kaz Kylheku2017-12-301-0/+66
| | | | | | | | | | | | | | | * eval.c (eval_init): Register rplaca and rplacd using new rplaca_s and rplacd_s symbol variables. * lib.c (rplaca_s, rplacd_s): New symbol variables. (rplaca): Handle struct object via rplaca method, if it has one, otherwise lambda-set, if it has that, or else error out. (rplacd): Handle struct object via rplacd method. * lib.h (rplaca_s, rplacd_s): Declared. * txr.1: Documented rplaca and rplacd methods.
* doc: invoke-catch: no such function as get-framesKaz Kylheku2017-12-291-2/+3
| | | | | * txr.1: Fix wording under invoke-catch which refers to a nonexistent function called get-frames.
* read, iread: source location recording now conditional.Kaz Kylheku2017-12-291-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recording of source location info incurs a time and space penalty. We don't want to impose this on programs which are just reading large amounts of Lisp data that isn't code. * eval.c (eval_init): Register lisp-parse and read functions to the newly introduced nread function rather than lisp_parse. lisp_parse continues to record source location info unconditionally. * parser.c (rec_source_loc_s): New symbol variable. (parser_common_init): Set the new member of the parser structure, rec_source_loc, according to the current value of the special var *rec-source-loc*. (lisp_parse_impl): New second argument, rlcp_p. If true, it overrides the rec_source_loc member of the parser structure to true. (lisp_parse): Pass true argument to rlcp_p parameter of lisp_parse_impl, so parsing via lisp_parse always records source loc info. (nread): New function. (iread): Pass true argument to rlcp_p parameter of lisp_parse_impl, so *rec-source-loc* controls whether source location info is recorded. (parse_init): Initilize rec_source_loc_s symbol variable, and register the *rec-source-loc* special var. * parser.h (struct parser): New member, rec_source_loc. (rec_source_loc_s, nread): Declared. * parser.y (rlcp_parser): New static function. Like rlcp but does nothing if parser->rec_source_loc is false. (rlc): New macro. (grammar): Replace rlcp uses with rlc, which expands to a call to rlcp_parser. (rlrec): Do nothing if source loc recording is not enabled in the parser. (make_expr, uref_helper): Replace rlcp with rlc. This is possible because these functions have a parser local variable that the macro expansion can refer to. (parse_once): Override rec_source_loc in the parser to 1, so that source loc info is always recorded when parsing is invoked through this function. * txr.1: Documented *rec-source-loc* and added text under read and iread.
* hash: read/print consistency regression.Kaz Kylheku2017-12-281-7/+26
| | | | | | | | | | | | | | | | | | | | | | TXR 188 makes a slight mess of the #H notation. An :eql-based hash table prints as #H(() ...), but when that notation is read, it produces an :equal-based hash table. No aspect of this situation was intended; the intent was that the notation stays the same as before, and just the hash function changes to make :equal-based the default. Let's just go with this and have #H(() ...) denote :equal-based tables. * hash.c (hash_print_op): Print an :eql-based for eql-based hash tables, and nothing for equal-based ones. In compatibility mode with 188 and older, reproduce the old behavior, rendering equal-based tables with :equal-based and the absence of a symbol for eql-based. * txr.1: Updated places that touch on :equal-based and added compatibility notes. * tests/009/json.expected: updated, since equal-based hash tables now print without :equal-based keyword.
* doc: document listener :prompt properly.Kaz Kylheku2017-12-281-1/+1
| | | | | * txr.1: There is no :print command in the listener to print the current prompt; it is actually the :prompt command.
* Version 188.txr-188Kaz Kylheku2017-12-191-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim, protsym.c: Regenerated.
* New functions: rlist and rlist*.Kaz Kylheku2017-12-181-0/+95
| | | | | | | | | | These easily express discontinuous ranges. * eval.c (rlist_fun, rlist_star_fun, rlist, rlist_star): New static functions. (eval_init): Register rlist and rlist* intrinsics. * txr.1: Documented.
* doc: listener: clarify about deletion in selection mode.Kaz Kylheku2017-12-151-3/+11
| | | | | | * txr.1: Clarify that Ctrl-D is the only deletion command which copies into the clipboard, and only in visual selection mode.