summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
* HTML doc: markup in lower case.Kaz Kylheku2015-12-151-1/+1
| | | | | | | | Requires updated man2html which puts out lower case. * genman.txr: All matched and generated HTML is lower case. * txr.1 (NP*): Use lower case h4 tag in M2SS macro.
* Improved documentation of macro parameter lists.Kaz Kylheku2015-12-141-18/+64
| | | | | | * txr.1: Improved wording, better explanation, explanation that nested macro lists support all features, and specified meaning of :whole inside nested lists.
* Pluralization under Equality Substitution.Kaz Kylheku2015-12-131-1/+1
| | | | * txr.1: "unless they are the same object."
* Clean up formatting in conventions section.Kaz Kylheku2015-12-131-26/+5
| | | | | | | | txr.1: Lose the useless use of conditional evaluation. Everything is doable with the meIP macro. Only one piece of conditional evaluation is needed for different wording: textual man page says "angle brackets" whereas formatted page refers to italic font.
* Fix example under conda.Kaz Kylheku2015-12-121-1/+1
| | | | * txr.1: Remove spurious z in example.
* Improvement in type tree diagram.Kaz Kylheku2015-12-121-4/+8
| | | | | * txr.1: Structures move under cobj types, which are indicated with angle brackets to show they are not programmer-visible.
* Update typeof documentationKaz Kylheku2015-12-121-3/+19
| | | | * txr.1: more types are listed under typeof.
* Formatting under func-get-name.Kaz Kylheku2015-12-111-1/+1
| | | | * txr.1: Misuse of << in syntax block.
* symbol-function semantics change; new symbol-macro.Kaz Kylheku2015-12-101-39/+145
| | | | | | | | | | | | | | | | | | | | | | | * eval.c (symbol_function): Only retrieve function binding, and not macro or operator bindings, unless compatibility <= 127 is in effect. (symbol_macro): New function. (fboundp): Only test for existence of function, not macro or operator, unless <= 127 compatibility is in effect. (fmakunbound): Do not remove macro binding, unless compatibility <= 127 is in effect. (eval_init): Register sys:top-mb variable for use in place.tl library module. Register symbol-macro intrinsic function. * share/txr/stdlib/place.tl (sys:get-mb): New function (symbol-macro): New syntactic place. * txr.1: Updated incorrect documentation about environments from the perspective that macros and functions coexist. Documented symbol-macro. Updated symbol-function, fboundp and fmakunbound documentation. Added missing documentation for mmakunbound. Reference to fboundp under define-place-macro revised to mboundp. Added compatibility notes.
* Version 127.txr-127Kaz Kylheku2015-12-091-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Bugfix: ifa must allow dwim expressions.Kaz Kylheku2015-12-091-5/+19
| | | | | | | | * share/txr/stdlib/ifa.tl (ifa): Accept dwim expressions as the condition. Moreover, treat [f x] as a one-argument call, even though it is the two-argument form (dwim f x). * txr.1: Documented.
* Spacing around major headings early in doc.Kaz Kylheku2015-12-091-1/+2
| | | | * txr.1: Blank line before SYNOPSIS and DESCRIPTION.
* ifa documentation improvementKaz Kylheku2015-12-091-29/+82
| | | | | | | | * txr.1: The ifa rules are organized as numbered clauses. The definition of it-candidate is given up front. Rule 4 is corrected: the it variable is bound to the argument expression, not merely its value. Examples refer to rules and new ones added.
* Fix under ifa.Kaz Kylheku2015-12-081-9/+9
| | | | | * txr.1: Remove text fragment, and clarify treatment of not, null and false.
* Allow defmacros and defuns to co-exist.Kaz Kylheku2015-12-081-0/+14
| | | | | | | | | | | | | | | Already we have the situation that there is an if function and an if macro, and same for and and or. This change allows such situations to be programmer-defined. * eval.c (op_defun): Don't remhash the name from the toplevel macro bindings. (op-defmacro): Don't remhash the name from the toplevel function bindings. * txr.1: Document the permissive behavior as dialect notes under defmacro and defun.
* Adding mboundp and mmakunbound.Kaz Kylheku2015-12-081-3/+11
| | | | | | | | | * eval.c (mboundp, mmakunbound): New static functions. (eval_init): Registering mboundp and mmakunbound intrinsics. * txr.1: Documenting new functions. Also clarifying that fboundp checks for an operator macro binding (not a symbol macro binding).
* New function macro-ancestor.Kaz Kylheku2015-12-081-0/+18
| | | | | | | * eval.c (eval_init): Register lookup_origin as macro-ancestor intrinsic. * txr.1: Documented.
* Update under source-loc-str.Kaz Kylheku2015-12-081-8/+24
| | | | | * txr.1: formatting fix in syntax section. Added explanation that macro expansions inherit source loc info from expander.
* Documentation section restructuring.Kaz Kylheku2015-12-081-43/+47
| | | | | * txr.1: TXR pattern language condensed into fewer sections with deeper nesting. Some sections renamed.
* Clarifications under dwim operator.Kaz Kylheku2015-12-081-24/+46
|
* Remove opinion point of view.Kaz Kylheku2015-12-081-5/+2
| | | | | * txr.1: Under dwim operator, describe [...] notation without asserting that it is preferred.
* Fixes under Consecutive VariablesKaz Kylheku2015-12-081-7/+9
| | | | * txr.1: Tense agreement, clarification. Italicize de facto.
* Replace "discussed" with "described".Kaz Kylheku2015-12-081-13/+13
|
* Wording under sys:abscond-from.Kaz Kylheku2015-12-081-1/+1
| | | | * txr.1: replace colloquial word choice.
* Fix outdated references to .. denoting cons.Kaz Kylheku2015-12-081-14/+12
| | | | | * txr.1: Upgrade text under Callable Objects and Operator dwim.
* remove nonexistent function from synopsis.Kaz Kylheku2015-12-071-1/+1
| | | | | * txr.1: There is no such function as range-regst. This should be search-regst.
* range-regex returns range, not cons.Kaz Kylheku2015-12-071-4/+4
| | | | | | | | | | | * regex.c (range_regex): Return range. (search_regst): Use appropriate accessors on range returned by range_regex. * lib.c (tok_where): Destructure range returned by range_regex, using range_bind. * txr.1: Documented changed behavior.
* static-slot-ensure always processes subtypes.Kaz Kylheku2015-12-011-33/+34
| | | | | | | | | | | * struct.c (static_slot_ensure): Restructured function so that the subtypes of stype are processed even if stype already has the static slot. This way static-slot-ensure can be used to overwrite a static slot value, not only establish one. And thus defmeth can redefine methods. * txr.1: Revamped static-slot-ensure doc, and added notes about redefining to defmeth.
* Bugfix: structs not inheriting late static slot values.Kaz Kylheku2015-12-011-5/+24
| | | | | | | | | | | | | | | | | | | | | | This bug doesn't affect static slots that are defined in defstruct, because those get initialized in the new type by the static init function. The bug is that the values of static slots added later with static_slot_ensure are not inherited by subtypes that are created later still. (Since static_slot_ensure propagates a slot to subtypes which already exist, those types get the slot value.) * struct.c (make_struct_type): Copy the contents of the static slot array of the supertype into the new type, so that static slot values are inherited. We can just use memcpy because the ordering of static slots is the same in the new type, and the inherited ones precede the new ones, due to the way the all_slots list is combined. * txr.1: Clarify inheritance of static slots.
* defun can define methods.Kaz Kylheku2015-11-301-0/+24
| | | | | | | | | | | | * eval.c (op_defun): Handle (meth type name) syntax in place of name via sys:defmeth function, which is dynamically resolved and autoloaded as necessary. (builtin_reject_test): When defun is being checked, recognize a (method ...) form and allow it. * struct.h (meth_s): Declaration added. * txr.1: Documented new defun capability.
* func-get-name calculates a name for methods.Kaz Kylheku2015-11-301-17/+42
| | | | | | | | | | | | | | * eval.c (func_get_name): Use try to use new method_name function, if unable to get name from the lexical or global environment for functions. * struct.c (meth_s): New symbol variable. (struct_init): Initialize meth_s variable. (method_name): New function. * struct.h (method_name): Declared. * txr.1: Re-documented func-get-name.
* Version 126.txr-126Kaz Kylheku2015-11-291-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* New macro define-accessor.Kaz Kylheku2015-11-251-0/+72
| | | | | | | | | | | * lisplib.c (place_set_entries): New entry to trigger autoloading for define-accessor. * share/txr/stdlib/place.tl (sys:register-simple-accessor): New function. (define-accessor): New macro. * txr.1: Documented define-accessor.
* New functions window-map and window-mappend.Kaz Kylheku2015-11-251-0/+154
| | | | | | | | | | | | | | | | | * args.h (args_set_fill): New inline function. * eval.c (eval_init): Register window-map and window-mappend intrinics. * lib.c (wrap_k, reflect_k): New keyword variables. (calc_win_size): New static function. (window_map_list, window_map_vec): New static functions. (window_map, window_mappend): New functions. (obj_init): Initialize wrap_k and reflect_k. * lib.h (window_map, window_mappend): Declared. * txr.1: Documented window-map and window-mappend
* Version 125.txr-125Kaz Kylheku2015-11-201-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* last function becomes generic.Kaz Kylheku2015-11-201-3/+11
| | | | | | * lib.c (last): Handle non-list sequences via sub function. * txr.1: Updated description of last.
* TXR_COMPAT option.Kaz Kylheku2015-11-201-1/+31
| | | | | | | | | * txr.c (txr_main): Implement handling of TXR_COMPAT environment variable. Also, before entering interactive mode, if compatibility has been set via TXR_COMPAT, emit an informative message about this. * txr.1: Documented TXR_COMPAT.
* New equality substitution.Kaz Kylheku2015-11-201-2/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the equal method is defined for structs, its return value is used in their place for hashing and comparison. * eval.h (eq_s, eql_s, equal_s): Declared. * hash.c (equal_hash): If a COBJ defines an equalsub function, we call it. If it returns non-nil, we take the object in its place and recurse. * lib.c (equal): Refactored to support equality substitution. (less): Support equality substitution. * lib.h (cobj_ops): New function pointer member, equalsub. Only struct instances define this, currently. (cobj_ops_init): Add null entry to initializer for equalsub. (cobj_ops_init_ex): New initialiation macro for situations when the equalsub member must be provided. * struct.c (struct struct_type): new member eqmslot. (make_struct_type): Initialize emslot to zero. (static_slot_set, static_slot_ensure): If eqmslot is -1, indicating positive knowledge that there is no equal method static slot, we must invalidate that with a zero: it is no longer known whether there is or isn't such a slot. (get_equal_method, struct_inst_equalsub): New static functions. (struct_inst_ops): Initialize the equalsub member using new cobj_ops_init_ex macro. * txr.1: Document equality substitution.
* Introducing lazy structs.Kaz Kylheku2015-11-201-1/+76
| | | | | | | | | | | | | | | | | | | | | | | * share/txr/stdlib/struct.tl (lnew): New macro. * struct.c (struct_type): Turn id into a bitfield one bit smaller than cnum. New Boolean bitfield lazy. (struct_init): Register make-lazy-struct intrinsic. (make_struct): Initialize lazy bitfield to zero. (lazy_struct_init, check_init_lazy_struct): New static functions. (make_lazy_struct): New function. (copy_struct, clear_struct, replace_struct, reset_struct, lookup_slot, struct_inst_equal, struct_inst_hash): Call check_init_lazy_struct on all structures involved. (lookup_slot): Call check_init_lazy_struct. (struct_inst_mark): If the struct is lazy, it has one instance slot which must be marked, holding the argfun function passed into make_lazy_struct. * struct.h (make_lazy_struct): Declared. * txr.1: Documented lnew and make-lazy-struct.
* @(next) takes Lisp expression as source now.Kaz Kylheku2015-11-201-2/+22
| | | | | | | | | | | * match.c (v_next): Evaluate the source expression as TXR Lisp, unless it is meta-expression or meta-variable, or the compatibility option is set to 124 or lower. In those cases treat it as an expression of the TXR Pattern * txr.1: Updated documentation of @(next) and all relevant examples of @(next) everywhere. Added compatibility notes.
* Renaming html filters to get rid of underscore.Kaz Kylheku2015-11-201-12/+12
| | | | | | | | | | | | | | | | | * filter.c (to_html_k, from_html_k, to_html_relaxed_k): Variables removed. (tohtml_k, tohtml_star_k, fromhtml_k): New keyword symbol variables. (to_html_table): Array renamed to tohtml_table. (to_html_relaxed_table): Renamed to tohtml_star_table. (from_html_table): Renamed to fromhtml_table. (html_encode): Refers to tohtml_k. (html_encode_star): Refers to tohtml_star_k. (html_decode): Refers to fromhtml_k. (filter_init): Initialize new symbol variables. Remove old registrations. Register filters under old names too. * txr.1: Document new names.
* New :to_html_relaxed filter and html-encode*.Kaz Kylheku2015-11-201-1/+19
| | | | | | | | | | | * filter.c (to_html_relaxed_k): New keyword symbol variable. (to_html_relaxed_table): New static array. (html_encode_star): New static function. (filter_init): Initialize new symbol variable. Register new filter. Register html-encode* function. * txr.1: Documented :to_html_relaxed filter and html-encode* function.
* @(rep) as shorthand for @(coll :vars nil).Kaz Kylheku2015-11-201-1/+21
| | | | | | | | | | | | | * match.c (h_coll): Check for rep symbol, and handle similarly to v_coll. Use symbol in error message. (dir_tables_init): Bind rep symbol to h_coll. * parser.y (elems): Don't generate rep_elem phrase structure for the sake of catching "rep outside of output"; this production now conflicts with the intent to allow this. (elem): Add various REP productions which clones of COLL. * txr.1: Documented new @(rep) usage.
* Provide butlast function.Kaz Kylheku2015-11-201-0/+24
| | | | | | | | | | * eval.c (eval_init): Registered butlast intrinsic. * lib.c (butlast): New function. * lib.h (butlast): Declared. * txr.1: Documented butlast.
* Functors: structs callable as functions.Kaz Kylheku2015-11-201-0/+30
| | | | | | | * lib.c (generic_funcall): If an object is used as a function, get its lambda method and call that. * txr.1: Document functors.
* New uslot function and usl macro.Kaz Kylheku2015-11-201-0/+50
| | | | | | | | | | | | | | * struct.c (struct_init): Register uslot intrinsic function. (uslot_fun): New static function. (uslot): New function. * struct.h (uslot): Declared. * share/txr/stdlib/struct.tl (usl): New macro. * lisplib.c (struct_set_entries): Add usl macro. * txr.1: Documented uslot and usl.
* Version 124.txr-124Kaz Kylheku2015-11-141-2/+2
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Implementing *print-base* and ~d format directive.Kaz Kylheku2015-11-141-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * debug.c (show_bindings): Use ~d for level, so as not to be influenced by *print-base*. (debug): Use ~d for line numbers. * lib.c (gensym): Use ~d conversion specifier for formatting gensym counter into symbol name. * match.c (LOG_MISMATCH, LOG_MATCH): Use ~d for line number references. (h_skip, h_coll, h_fun, h_chr, match_line_completely, v_skip, v_fuzz, v_gather, v_collect, v_output, v_filter, v_fun, v_assert, v_load, v_line, h_assert, open_data_source): Use ~d for line refs, number of iterations, errno values. * parser.c (repl): Use ~d for prompt line numbers, numbered variables and the expr-<n> string in error messages. * parser.l (yyerrorf, source_loc_str): Use ~d for line numbers. * stream.c (print_base_s): New symbol variable. (formatv): Implement *print-base*. (stdio_maybe_read_error, stdio_maybe_error, stdio_close, pipe_close, open_directory, open_file, open_fileno, open_tail, open_process, run, remove_path): Use ~d for errno values. (stream_init): Initialize print_base_s and register *print-base* special variable. sysif.c (mkdir_wrap, ensure_dir, getcwd_wrap, mknod_wrap, chmod_wrap, symlink_wrap, link_wrap, readlink_wrap, excec_wrap, stat_impl, pipe_wrap, poll_wrap, getgroups_wrap, setuid_wrap, seteuid_wrap, setgid_wrap): Use ~d for errno values and system function results. * txr.1: Documented *print-base* and ~d conversion specifier.
* New global control over float print precision.Kaz Kylheku2015-11-131-5/+52
| | | | | | | | | | | | | | | | | | * configure (have_dbl_decimal_dig): New variable. New configure test to test for DBL_DECIMAL_DIG or __DBL_DECIMAL_DIG__, resulting in FLO_MAX_DIG macro being deposited in config.h. * arith.c (arith_init): Register flo-max-dig variable. * stream.c (print_flo_precision_s): New symbol variable. (formatv): Obtain default precision from *print-flo-precision* special variable, rather than hard coded DBL_DIG. (stream_init): Initialize print_flo_precision_s variable, and register *print-flo-precision* special. * txr.1: Document flo-max-dig, *print-flo-precision*, and change of behavior in format.
* Formatting in generate, giterate heading.Kaz Kylheku2015-11-121-1/+1
| | | | * txr.1: Missing @, added for comma.