summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
...
* Version 171.txr-171Kaz Kylheku2017-03-141-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* doc: typeset references to directives as code/codn.Kaz Kylheku2017-03-141-26/+74
|
* split, split*, partition, partition*: allow neg indices.Kaz Kylheku2017-03-141-2/+30
| | | | | | | | | | * lib.c (partition_split_common): Filter the list of indices, displacing any negative values by the length of the sequence, removing any that are still negative. This is subject to compatibility. (partition_star): Likewise. * txr.1: Document, and add compat notes.
* Print method can return : to decline printing.Kaz Kylheku2017-03-131-1/+17
| | | | | | | | * struct.c (struct_inst_print): Check return value of print method call. If it is the colon keyword, then do not return but rather continue to the regular struct printing code. * txr.1: Documented.
* doc: bungled text under in-package.Kaz Kylheku2017-03-131-3/+2
| | | | | * txr.1: Fix sentence fragmentation and redundant text in last paragraph under in-package.
* Add in-package directive.Kaz Kylheku2017-03-131-0/+34
| | | | | | | | | | | | * match.c (in_package_s): New symbol variable. (syms_init): Initialize in_package_s. * match.h (in_package_s): Declared. * parser.y (check_parse_time_action): Add case for in-package. Evaluate just with eval, as a case of the in-package macro. * txr.1: Documented.
* New directive: mdo.Kaz Kylheku2017-03-121-3/+51
| | | | | | | | | | | | | | | * eval.h (progn_s): Declarationa added. * match.c (mdo_s): New symbol variable. (syms_init): Initialize mdo_s. * match.h (mdo_s): Declared. * parser.y (check_for_include): Renamed to check_parse_time_action and implements mdo, not only include. (clauses_rev): Follow rename of function. * txr.1: Documented.
* New functions starts-with and ends-with.Kaz Kylheku2017-03-121-0/+47
| | | | | | | | | | | * eval.c (eval_init): Register starts-with and ends-with intrinsics. * lib.c (starts_with, ends_with): New functions. * lib.c (starts_with, ends_with): Declared. * txr.1: Documented.
* New rmismatch function.Kaz Kylheku2017-03-121-0/+30
| | | | | | | | | | * eval.c (eval_init): Register rmismatch intrinsic. * lib.c (rmismatch): New function. * lib.h (rmismatch): Declared. * txr.1: Documented
* New: struct-from-plist and struct-from-args.Kaz Kylheku2017-03-121-0/+45
| | | | | | | | | * struct.c (struct_init): Register new functions. (struct_from_plist, struct_from_args): New functions. * struct.h (struct_from_plist, struct_from_args): Declared. * txr.1: Documented.
* match-fun: make last two args optional.Kaz Kylheku2017-03-121-4/+7
| | | | | | | | * eval.c (eval_init): Update registration of match-fun. * match.c (match_fun): Do defaulting on third and fourth arg. * txr.1: Documenation updated.
* Drop the annoying need for - for standard input.Kaz Kylheku2017-03-081-0/+18
| | | | | | | | | | | | | * match.c (open_data_source): If there is nothing in the files array and data is t (indicating a request to open a data source), then use standard input. Subject to the compatibility option. * Makefile (txr-manpage.html): Drop use of the txr - argument in rule recipe. * txr.1: Document that - isn't necessary. Added to compatibility notes.
* uref: the a.b.c syntax extended to .a.b.cKaz Kylheku2017-03-061-2/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now it is possible to use a leading dot on the referencing dot syntax. This is the is the "unbound reference dot". It expands to the uref macro, which denotes an unbound-reference: it produces a function which takes an object as the argument, and curries the reference implied by the remaining arguments. * eval.c (uref_s): New global symbol variable. (eval_init): Intern uref symbol and init uref_s. * eval.h (uref_s): Declared. * lib.c (simple_qref_args_p): A qref expression is now also not simple if it contains an embedded uref, meaning that it cannot be rendered into the dot notation without ambiguity. (obj_print_impl): Support printing (uref a b c) as .a.b.c. * lisplib.c (struct_set_entries): Add uref to the list of autoload triggers for struct.tl. * parser.l (DOTDOT): Consume any leading whitespace as part of recognizing the DOTDOT token. Otherwise the new rule for UREFDOT, which matches (mandatory) leading space will take precedence, causing " .." to be scanned wrong. (UREFDOT): Rule for new kind of dot token, which is preceded by mandatory whitespace, and isn't consing dot (which has mandatory trailing whitespace too, matched by an earlier rule). * parser.y (UREFDOT): New token type. (i_dot_expr, n_dot_expr): New grammar rules. (list): Handle a leading dot on the first element of a list as a special case. Things are done this way because trying to work a UREFDOT into the grammar otherwise causes intractable conflicts. (i_expr): The ^, ' and , punctuators are now followed by an i_dot_expr, so that the expression can be an unbound dot. (n_expr): Same change as in i_expr, but using n_dot_expr. Plus new UREFDOT n_expr production. * share/txr/stdlib/struct.tl (uref): New macro. * txr.1: Documented.
* doc: missing description of a group-reduce param.Kaz Kylheku2017-03-051-2/+16
| | | | | * txr.1: Describe the filter-fun optional argument of group-reduce.
* doc: formatting under umeth.Kaz Kylheku2017-03-041-1/+1
| | | | * txr.1: Broken syntax markup.
* Version 170.txr-170Kaz Kylheku2017-02-281-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* doc: give some examples of accept interaction.Kaz Kylheku2017-02-271-0/+101
| | | | | * txr.1: Example given for how @(accept) interacts with @(next) and with the function call mechanism.
* doc: horizontal trailer.Kaz Kylheku2017-02-261-0/+26
| | | | | * txr.1: Add missing documentation of the existence of horizontal @(trailer) syntax.
* doc: block syntax horizontal and vertical.Kaz Kylheku2017-02-261-0/+26
| | | | | | * txr.1: Document that block syntax can be horizontal or vertical, and likewise that the accept and fail directives can be in horizontal or vertical context.
* doc: don't refer to BLOCKS section.Kaz Kylheku2017-02-261-6/+6
| | | | | * txr.1: Multiple places were referring to a section called BLOCKS. It is called Blocks.
* doc: print methods print, not pretty-print.Kaz Kylheku2017-02-261-1/+1
| | | | | | * txr.1: Fix misleading text which says that print methods are called to pretty-print objects. They are called for all printing: regular or pretty.
* New floor-rem, ceil-rem and round-rem.Kaz Kylheku2017-02-261-9/+23
| | | | | | | | | | | | * arith.c (trunc_rem): Move function to below round function. Make second argument optional, defaulting to one. (floor_rem, ceil_rem, round_rem): New functions. * eval.c (eval_init): Registration of trunc-rem altered for optional argument. New registrations for floor-rem, ceil-rem, round=rem. * txr.1: Documented for new functions folded with trunc-rem.
* Second argument optional in trunc.Kaz Kylheku2017-02-251-74/+84
| | | | | | | | | | | | | | * arith.c (trunc1): New static function. (trunc): Detect a missing second argument and call func1. * eval.c (eval_init): Update registration of trunc intrinsic to make second arg optional. * txr.1: Describe optional argument of trunc. Trunc documentation is merged with the floor, ceil and round section. The mod and trunc-rem functions are split off into their own sections, leaving the / function described by itself. The documentation of / is substantially revised.
* doc: horizontal-vertical issues in block and accept.Kaz Kylheku2017-02-251-0/+44
| | | | | | | * txr.1: Document what happens when a vertical block catches a horizontal accept, a horizontal block catches a vertical accept, or a horizontal block catches a horizontal accept from a different line.
* doc: special interactions with accept.Kaz Kylheku2017-02-251-17/+123
| | | | | | * txr.1: Documenting all the special interactions with accept that have been recently added: next directive, functions, finally.
* Adding round function.Kaz Kylheku2017-02-251-4/+25
| | | | | | | | | | | * arith.c (round1): New static function. (roundiv): New function. * configure: New test for C99 round function. * eval.c (eval_init): Register round intrinsic. * txr.1: Documented.
* floor and ceil do division, with optional second arg.Kaz Kylheku2017-02-241-14/+47
| | | | | | | | | | | | | | | Also, with one argument, these functions handle ranges. * arith.c (floordiv, ceildiv): New functions. (floorf, ceili): Handle ranges. * eval.c (eval_init): Register floor and ceil to new functions. * lib.h (floordiv, ceildiv): Declared. * txr.1: Documentation updated.
* Support horizontal form of @(throw).Kaz Kylheku2017-02-131-0/+14
| | | | | | | * match.c (dir_tables_init): Wire throw_s into horizontal dispatch table via hv_trampoline. * txr.1: Documented.
* Version 169.txr-169Kaz Kylheku2017-02-111-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Add rassoc and rassql functions.Kaz Kylheku2017-02-111-3/+50
| | | | | | | | | | | * eval.c (eval_init): Register rassoc and rassql intrinsics. * lib.c (rassoc, rassql): New functions. * lib.h (rassoc, rassql): Declared. * txr.1: Documented rassoc and rassql, with small fixes to assql and assoc.
* Use non-hacky representation for deferrable warnings.Kaz Kylheku2017-02-101-20/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deferrable warnings now get their own subtype, defr-warning. The tag is a regular argument: no funny dotted argument list. * eval.c (eval_defr_warn): Throw new style deferrable warning. (me_op, no_warn_expand): Catch defr-warning rather than warning. Use uw_muffle_warning to suppress it. (gather_free_refs): Parse new representation of deferrable warning. (expand_with_free_refs): Catch defr-warning rather than warning. * lib.c (defr_warning_s): New symbol variable defined. (obj_init): Initialize defr_warning_s. * lib.h (defr_warning_s): Declared. * share/txr/stdlib/error.tl (compile-defr-warning): Throw new-style deferrable warning. * unwind.c (uw_muffle_deferrable_warning): Function removed. (uw_throw): Bugfix: handle warnings by checking by subtype rather than exactly for the warning type. Distinguish deferrable warnings by subtype rather than argument list shape. (uw_defer_warning): Take the new style args and reconstruct the (msg . tag) representation for a deferred warning, so the other functions don't have to change. (uw_late_init): Register defr-warning as exception subtype of warning. * unwind.h (uw_muffle_deferrable_warning): Decl removed. * txr.1: Adjusted all documentation touching on the subject of the representation of deferrable warnings.
* Better way for releasing deferred warnings.Kaz Kylheku2017-02-101-4/+17
| | | | | | | | | | | | | | | | | | | | We should be re-throwing deferred warnings as ordinary warnings, not dumping them to a stream. * eval.c (eval_exception): Use uw_release_deferred_warnings instead of uw_dupm_deferred_warnings. (load): Likewise. * parser.c (read_eval_ret_last): Likewise. * txr.c (txr_main): Likewise. * unwind.c (uw_release_deferred_warnings): New function. * unwind.h (uw_release_deferred_warnings): Declared. * txr.1: Documented release-deferred-warnings and updated documentation for dump-deferred-warnings.
* doc: dotimes heading formatting.Kaz Kylheku2017-02-071-1/+2
| | | | | | * txr.1: Split dotimes syntax across two lines, to prevent wrapping when rendered to 80 column man page output.
* Version 168.txr-168Kaz Kylheku2017-02-021-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Adding whena macro.Kaz Kylheku2017-02-051-0/+17
| | | | | | | | | | We have ifa and conda; whena is conspicuously absent. * lisplib.c (ifa_set_entries): Add autoload entry for whena. * share/txr/stdlib/ifa.tl (whena): New macro. * txr.1: Documented whena.
* Expose rlcp_tree function.Kaz Kylheku2017-02-041-2/+28
| | | | | | | * eval.c (eval_init): Register rlcp-tree intrinsic. * txr.1: Documented rlcp-tree. Also documented that rlcp doesn't overwrite location info.
* doc: typo under hidden sym.Kaz Kylheku2017-02-041-1/+1
| | | | | * txr.1: "sane name" -> "same name". We need aspell to grok semantics.
* Version 167.txr-167Kaz Kylheku2017-02-021-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* awk: support list of string as input source.Kaz Kylheku2017-01-291-3/+13
| | | | | | | | * share/txr/stdlib/awk.tl (sys:awk-state loop): Allow an input source to be a list of strings, which is converted to a stream. * txr.1: Documented.
* doc: new package example showing function override.Kaz Kylheku2017-01-291-0/+39
| | | | | | | * txr.1: Example showing + symbol being replaced in a custom package with a local symbol, and a function being bound which overloads + to allow strings and numbers.
* Expose defer-warning and dump-deferred-warnings.Kaz Kylheku2017-01-261-0/+53
| | | | | | | * unwind.c (uw_late_init): Register defer-warning and dump-deferred-warnings intrinsics. * txr.1: Documented.
* Version 166.txr-166Kaz Kylheku2017-01-261-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* awk macro: provide name of current input via fname.Kaz Kylheku2017-01-261-0/+24
| | | | | | | | | | * share/txr/stdlib/awk.tl (sys:awk-state): New slot, file-name. (sys:awk-state loop): Set file-name from current input name, or else from the stream name property if the current input is a stream object. (sys:awk-mac-let): New awk macro, fname. * txr.1: Documented fname.
* awk macro: bind *stdin* to current input stream.Kaz Kylheku2017-01-261-0/+11
| | | | | | | | * share/txr/stdlib/awk.tl (sys:awk-state loop): Instead of using the lexical variable stin, use *stdin*, so that the standard input stream is re-bound. * txr.1: Documented binding and scope of *stdin*.
* doc: update compat notes: new 165 value.Kaz Kylheku2017-01-251-0/+16
| | | | | * txr.1: Describe the Lisp expansion neglect in the pattern language that is fixed for 166, reversible with -C.
* Local macrolets in build become functions.Kaz Kylheku2017-01-251-1/+6
| | | | | | | | | | * share/txr/stdlib/build.tl (sys:list-builder-macrolets): Function renamed to sys:list-builder-flets. Builds local functions instead of macrolets. (build): Follow rename of sys:list-builder-macrolets. * txr.1: Documentation updated and example added of use of add as a higher order function.
* New handle* macro, analogous to catch*.Kaz Kylheku2017-01-251-1/+15
| | | | | | | | | | | * share/txr/stdlib/except.tl (sys:expand-handle): New function. (handle): Use sys:expand-handle to expand arguments. The previously unused :whole form argument is now put to use, and correctly captured using :form rather than :whole. (handle*): New macro. * txr.1: Documented.
* New catch*, giving access to exception symbol.Kaz Kylheku2017-01-251-1/+15
| | | | | | | | | | | | | | | | | | * eval.c (op_catch): The sys:catch operator now passes the exception symbol as the first argument of each clause. This means the catch macro must be adjusted. * share/txr/stdlib/except.tl (catch): Macro now inserts a gensym dummy first argument into each clause to take the symbol passed by the sys:catch operator. (catch*): New macro, which is identical to the previous catch macro, and thus exposes the symbol passed as the first argument. * txr.1: Documented catch*. * tests/012/struct.tl: Some gensym numbers need adjusting in one test case.
* Expose plist to alist functions.Kaz Kylheku2017-01-241-1/+67
| | | | | | | | * eval.c (eval_init): Register plist-to-alist and improper-plist-to-alist intrinsics. * txr.1: Documented improper plist concept and new functions.
* New memp function for searching a plist.Kaz Kylheku2017-01-241-5/+43
| | | | | | | | | | * eval.c (eval_init): Register memp intrinsic. * lib.c (memp): New function. * lib.h (memp): Declared. * txr.1: Documented.