summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
* matcher: first pattern macro, sme.Kaz Kylheku2021-04-191-0/+125
| | | | | | | | | | | | * lisplib.c (match_instantiate): Intern sme symbol. * share/txr/stdlib/doc-syms.tl: Update with sme entry. * share/txr/stdlib/match.tl (sme): New defmatch macro. * tests/011/patmatch.tl: New tests for sme. * txr.1: Documented.
* doc: reversed maphash parameters.Kaz Kylheku2021-04-191-1/+1
| | | | | * txr.1: The function is first, then the hash. Reported by Ray Perry.
* defmatch: pass form to mac-param-bind.Kaz Kylheku2021-04-191-0/+22
| | | | | | | | * share/txr/stdlib/match.tl (defmatch): Pass *match-form* to mac-param-bind so that the context is available to defmatch macros via the :form parameter. * txr.1: Documented use of :form in defmatch.
* matcher: new @(scan) operator.Kaz Kylheku2021-04-181-0/+64
| | | | | | | | | | | | | | * share/txr/stdlib/match.tl (compile-scan-match): New function. (compile-match): Hook scan operator into compiler. * lisplib.c (match_set_entries): Ensure scan is interned in usr package. * txr.1: Documented. * share/txr/stdlib/doc-syms.tl: Updated with new entry for scan.
* matcher: allow user-defined patterns via defmatchKaz Kylheku2021-04-171-3/+94
| | | | | | | | | | | | | | | | | * lisplib.c (match_set_entries): Register defmatch and *match-symbol* to autoload match.tl. * share/txr/stdlib/doc-syms.tl: Updated with entries for defmatch and *match-macro*. * share/txr/stdlib/match.tl (*match-macro*): New special variable holding hash. (compile-match): Handle macros via *match-macro* hash. (defmatch): New macro. * txr.1: Documented. * tags.tl: Recognize defmatch forms.
* streams: revise stream-max-len over strings.Kaz Kylheku2021-04-171-14/+15
| | | | | | | | | | | | | | | | The maximum number of characters printed from a string is too small, if it is directly taken from the stream-max-len value. We are going to multiply it by 8, and clamp the minimum characters at 24. * lib.c (max_str_chars): New inline function. (lazy_str_put, out_lazy_str, out_quasi_str): Use inline function to determine maximum number of chracters to print. Also bugfix here: decrement and test max_chr in the loop, not max_len. This bug was copy-pasted across all these functions. (obj_print_impl): Similarly revise the printing of strings. * txr.1: Documentation updated.
* doc: implement typesetting of keystrokes.Kaz Kylheku2021-04-131-112/+423
| | | | | | | | | | | | | | | | | | | | This commit relies on parallel improvements in man2html, up through commit ac186529b6b5f80906c3215a67c98505db7bb156 "Implement .M2HT request for HTML passthrough." * genman.txr: Add CSS block targetting the kbd element, providing 3D styling for keyboard input. * txr.1: Define two new macros, .key and .keyn. These are defined in three different ways: in man page output, we put square brackets around keystrokes. In typeset groff output, we put a square border around them using a box macro cribbed from groff documentation. In HTML, we use .M2HT to wrap a <kbd> tag around the keystrokes. Documentatio is updated to use these macros for all keystrokes. We no longer separate keystroke sequence elements with commas.
* doc: redocument UTF-8 in source and literals.Kaz Kylheku2021-04-101-32/+48
| | | | | | | | | | | * txr.1: Because invalid UTF-8 bytes are allowed in string literals, that documentation needs to be updated. I'm rewriting it substantially to clarify the difference between text streams and parsing source. In the discussion of escape sequences in string literals, the wording is improved. Because the source code is UTF-8, we could plausibly support escapes which specify bytes (that are then decoded), so that's not the correct rationale for not supporting it.
* doc: remove some hyphenation.Kaz Kylheku2021-04-091-10/+10
| | | | | * txr.1: Do not hyphenate two's complement and C language, except in phrases like "C-language-style whatever".
* doc: lambda: add pointers to alternative notations.Kaz Kylheku2021-04-091-0/+75
| | | | | | * txr.1: Under the lambda operator, point to the op notational family, functional combinators and the OOP-related method and slot indirection.
* doc: more details in string literals section.Kaz Kylheku2021-04-091-0/+14
| | | | | * txr.1: advise user that numeric escapes in string literals are not byte-wise, but specify code points.
* doc: big patch: hyphenation, wording, formatting.Paul A. Patience2021-04-091-473/+573
| | | | | * txr.1: Numerous issues of hyphenation, formatting, and errors in typography and formatting are addressed.
* doc: bad syntax under doc function.Kaz Kylheku2021-04-081-1/+1
| | | | * txr.1: Fix formatting.
* Version 256txr-256Kaz Kylheku2021-04-071-3/+3
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Bumped. * txr.vim, tl.vim: Regenerated.
* doc: document null-safe method call.Kaz Kylheku2021-04-051-4/+26
| | | | | * txr.1: The notation obj.?(fun ...) exists, but is not documented. Let's fix that.
* doc: remove superfluous words.Kaz Kylheku2021-04-041-1/+1
| | | | | * txr.1: under "File-Wide Insertion of Gensyms", remove superfluous verb phrase from sentence.
* doc: vice versa formatting.Kaz Kylheku2021-04-041-1/+1
| | | | | * txr.1: Under "Treatment of Literals", fix lack of close double quote in italicization of vice versa.
* doc: clarify definition of top-level form.Kaz Kylheku2021-04-041-3/+6
| | | | | | | * txr.1: In the definition of what is a top-level form to the compiler, replace poor wording about macro-expansion in rule 6, and add a rule which makes it clear that the rules are recursive.
* doc: note about environment handling in compile.Kaz Kylheku2021-04-041-1/+11
| | | | | | * txr.1: Add notes about environment handling when an interpreted function is compiled, and how hlet/hlet* can be used to obtain sharing.
* doc: fix missing item periods.Kaz Kylheku2021-04-041-20/+20
| | | | * txr.1: All missing item number periods added.
* doc: double word in awk intro.Kaz Kylheku2021-04-041-1/+1
| | | | * txr.1: Fix "implement implement".
* awk: relax restriction on :name.Kaz Kylheku2021-04-041-6/+9
| | | | | | | | * share/txr/stdlib/awk.tl (sys:awk-expander): Do not impose stricter restrictions on :name than the block mechanism itself. * txr.1: Documentation updated.
* doc: block names need not be symbols.Kaz Kylheku2021-04-041-1/+7
| | | | | * txr.1: The block implementation doesn't care whether blocks are symbols; anything comparable with eq may be used.
* lib: new function for documentation lookup.Kaz Kylheku2021-04-031-1/+47
| | | | | | | | | | | | | | | | * genman.txr: dump contents of symhash into a doc-syms.tl library file, as a defvarl form. * lisplib.c (doc_instantiate, doc_set_entries): New static functions. (lisplib_init): Register autoload for doc-lookup module to symbols doc and *doc-url*. * share/txr/stdlib/doc-lookup.tl: New file. * share/txr/stdlib/doc-syms.tl: Likewise. * txr.1: Documented.
* doc: dialect note capitalization.Kaz Kylheku2021-03-311-8/+8
| | | | * txr.1: Consistently capitalize Dialect Note
* doc: PP fixes.Kaz Kylheku2021-03-311-4/+0
| | | | | * txr.1: Remove two unnecessary .PP directives and a blank line before one.
* doc: formatting of notes under circle, erase notation.Kaz Kylheku2021-03-311-3/+7
| | | | | | * txr.1: Don't use TP* for notes and dialect notes because it doesn't fit these paragraphs that don't have an indented margin.
* doc: bad indenation under if directive.Kaz Kylheku2021-03-311-1/+1
| | | | * txr.1: Add .PP to deindent after example.
* doc: fix wording under --lispKaz Kylheku2021-03-311-2/+2
| | | | | * txr.1: Fix grammar problem and wording for --lisp and --compiled.
* doc: split up -l or --lisp-bindingsKaz Kylheku2021-03-311-1/+2
| | | | | * txr.1: Give the two -l and --lisp-bindings synonyms in the same way was other synonyms, as two separate .IP items.
* doc: blank lines after IP sections.Kaz Kylheku2021-03-301-21/+0
| | | | | | | | * checkman.txr (check-ip): New pattern function for checking for IP, coIP and meIP macros followed by blank line. This causes a formatting issue in HTML. * txr.1: Fix numerous instances of problem caught by check-ip.
* doc: missing RS/RE.Kaz Kylheku2021-03-301-0/+2
| | | | * txr.1: add .RS/.RE pair in Quote and Quasiquote.
* doc: incorrect synopsis of push.Kaz Kylheku2021-03-301-4/+5
| | | | | | * txr.1: Under the summary of place-mutating operations, rewrite the description of push which falsely claims that the pushed item is returned.
* doc: copy and paste of :wrap under window-mapKaz Kylheku2021-03-301-1/+1
| | | | * txr.1: Fix about :reflect wrongly referring to :wrap.
* doc: fix under stream indentationKaz Kylheku2021-03-301-1/+1
| | | | * txr.1: indent-foff misspelled as intent-foff.
* doc: numerous grammar fixes.Paul A. Patience2021-03-281-21/+25
| | | | | * txr.1: Fix grammar, punctuation, formatting, and cases of misspellings landing on dictionary words.
* doc: fix space before period.Kaz Kylheku2021-03-281-2/+2
| | | | | * txr.1: Fix two occurrences of \*(TL being separated from a period by a space in the ARGUMENTS AND OPTIONS section.
* Version 255txr-255Kaz Kylheku2021-03-261-3/+3
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Bumped. * txr.vim, tl.vim: Regenerated.
* doc: improve wording under copy-hash.Kaz Kylheku2021-03-261-5/+6
| | | | | * txr.1: Relationship between make-similiar-hash and copy-hash is expressed more accurately.
* ffi: support float type as variadic argument.Kaz Kylheku2021-03-221-2/+57
| | | | | | | | | | | | | | | | | | | The float type promotes to double when passed as a variadic argument. This patch adds internal FFI types which models that promotion. It uses double for its C type, while still performing the range checks for float. Also, the types be-float and le-float are rejected from being variadic arguments. * share/txr/stdlib/ffi.tl (analyze-argtypes): Rewrite function, adding validation and substitution for the variadic part of the argument type list. Map float type to double, and reject be-float and le-float. * txr.1: Documented.
* poll: iterate sequences efficiently.Kaz Kylheku2021-03-161-1/+1
| | | | | | | * sysif.c (poll_wrap): Use seq_iter for efficience when poll_list is a vector or other generalized sequence. * txr.1: Change wording to say that poll-list is a sequence.
* doc: improve predicate pattern description.Kaz Kylheku2021-03-151-5/+10
| | | | | * txr.1: Fix wrong word; clarify what is first form and second form.
* doc: pattern matching: revise, take out of beta.Kaz Kylheku2021-03-151-67/+140
| | | | | | | | * txr.1: structural pattern matching intro is divided into sections, rearranged and reworded, with additional detail, especially in regard to variables. Also, "a the" typo fixed in list pattern notation section. Pattern matching is now taken out of beta; the paragraph about the beta status is removed.
* doc: formally document meta-syntax.Kaz Kylheku2021-03-151-7/+84
| | | | | | | | | * txr.1: Add a missing section defining meta-symbols, meta-numbers and meta-expressions, which explains the sys:var and sys:expr shorthand. Also documented are corner cases involving deceptive floating-point syntax. Everywhere in the document, we normalize "meta-variable" as "meta-symbol".
* cat-str: seq_iter conversion,Kaz Kylheku2021-03-141-7/+11
| | | | | | | * lib.c (cat_str): Traverse sequences of strings efficiently using seq_iter framework. * txr.1: Document.
* doc: rewrite macro intro.Kaz Kylheku2021-03-121-20/+31
| | | | * txr.1: Rewrote Macros section intro paragraphs.
* doc: mistaken reference to command-getKaz Kylheku2021-03-121-1/+1
| | | | | * txr.1: The description of command-get-buf mistakenly refers to command-get.
* Version 254txr-254Kaz Kylheku2021-03-101-3/+3
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Bumped. * txr.vim, tl.vim: Regenerated.
* lib: new functions join, join-with.Kaz Kylheku2021-03-091-9/+66
| | | | | | | | | | | | | | | | | | | | | | | | | That old cat-str function is often a pain, requiring the pieces as a list. We have a sys:fmt-join that is undocumented. That functions is now exposed as usr:join, and documented. Also introducing join-with that takes a separator as the leftmost argument. Thus (op join-with "::") gives us a function that joins pieces with :: in between. * eval.c (eval_init): Regiser fmt_join function under join symbol also. Register join-with. * lib.c (join_with): New function. (fmt_join): Now a wrapper for join_with that passes a nil separator. * lib.h (join_with): Declared. * share/txr/stdlib/optimize.tl (basic-blocks join-blocks): Rename the local function join, which now triggers a warning about a standard function being redefined. * txr.1: Redocumented cat-str, and documented join-with and join.
* compiler: optimization control.Kaz Kylheku2021-03-081-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | * lisplib.c (compiler_set_entries): Register *opt-level* symbol for auto-loading. * share/txr/stdlib/compiler.tl (*opt-level*): New special variable. (compiler comp-let): Eliminate frames only at level 3. (compiler comp-lambda-impl): Lift load time at level 3. (compiler comp-arith-form): Constant-folding only at lvl 1. (compiler comp-fun-form): Algebraic substitutions and reductions and constant-folding only at level 1. (compiler comp-apply-call): Constant folding at level 1. (compiler optimize): Optimizations off if level zero. Thread jumps and eliminate dead code at level 2. Flow-analysis based optimizations at level 3. Additional optimizations at level 4. (compile comp-block): Block elimination at level 3. (compile-toplevel): Rebind *opt-level*, giving it value zero if it is previously nil. * share/txr/stdlib/optimize.tl (basic-blocks get-insns): Just retrieve the instructions, letting caller decide whether to call late-peephole or not. * txr.1: Documented *opt-level*.