| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Fix various minor issues and stylistic issues.
* configure: Remove repeated word and add missing word.
* txr.1: Fix various minor, not-so-minor and stylistic issues.
In particular, struct-from-args was misspelled in the .mets line and
open-subprocess was missing from the .coNP line.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (match_set_entries): Intern the match-error symbol.
Register autoloads for must-match and must-match-case.
* stdlib/match.tl (match-error): Register exception symbol, as subtype
of match-error.
(must-match, must-match-case): New macros.
* tests/011/patmatch.tl: Test cases.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Update registrations of lazy-stream-cons
and get-lines with one more optional argument.
* lib.c (simple_lazy_stream_func_nt, lazy_stream_func_nt): New
static functions.
(lazy_stream_cons): Take a new argument, no_throw_close,
defaulting it to nil. When calling close_stream directly, pass
the inverted value of no_throw_close. Choose the new _nt
functions for the lazy list if no_throw_close is true; those
functions pass nil as the second argument of close_stream.
* lib.h (lazy_stream_cons): Declaration updated.
* match.c (v_next_impl, open_data_source, match_fun): Pass
down the nothrow value to lazy_stream_cons, or else nil in
situations when that is not applicable or there is no such
value. Thus the :nothrow feature of v_next will now not only
ensure that there is no exception when opening the stream but
also when closing it. Unusual situations encountered when
the lazy list reads from the stream still throw.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: Document do being applied to do/op.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We extend the matching context structures to keep track of the
underlying stream from which lines are being taken via the lazy list.
Then the implementation of the @(eof) directive, when it hits the eof
condition, can use this stream to gain access to the termination status.
* match.c (match_line_ctx, match_files_ctx): New member, stream.
(ml_all): Take stream argument and initialize new member.
(h_call, do_match_line): Pass stream argument to h_call.
(mf_all, mf_file_data): Take stream argument and initialize new member.
(mf_from_ml): Propagate stream from line context to file context.
(freeform_prepare, v_next_impl, match_filter, match_fun, extract): Pass
stream argument where now needed.
(v_eof): Implement termination status binding via the stream stored
in the context.
(open_data_source): Store stream in match files context.
* tests/010/eof-status.txr: New file.
* tests/010/eof-status.expected: New file.
* Makefile (tst/tests/010/eof-status.ok): -B option for new test.
* txr.1: Documented eof directive, argument and all.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (strm_base_init): Add new element to the initializer to
initialize the close_result member to nao, indicating that the close
operation has not been invoked.
(strm_base_mark): Mark the close_result value, if it isn't nao.
This is just in case it is a heap object. The structure delegate
mechanism opens the possibility that the stream is actually user code
that can return anything so we have to be careful.
(close_stream): Only call ops->close if close_result is nao, indicating
that close had never been called (or possibly that it had been called
bu threw an exception) and store the return value in close_result,
otherwise return the previously stored value.
* stream.h (struct strm_base): New member, close_result.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (linenoise): Force the printing of prompts
if the input file descriptor is a tty.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The :prompt-on command will enable prompting in plain mode.
* linenoise/linenoise.c (struct lino_state): New member, show_prompt.
(line_enable_noninteractive_prompt): New function.
(linenoise): In the plain mode loop, the show_prompt flag is on, show
the prompt. For continuation lines, show a condensed prompt, which
consists of the suffix of the full prompt, starting on the last
non-whitespace character.
* linenoise/linenoise.h (lino_enable_noninteractive): Declared.
* parser.c (repl): Implement :prompt-on command which enables the
above mode.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: Document that if close-stream is applied to a closed stream,
then nil is returned without throwing an exception.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (stdio_close, pipe_close): Fix throw_on_error
argument not being defaulted correctly, so that errors are
thrown even when the argument is omitted.
* strudel.c (strudel_close): Here, we also must default the
argument. The corresponding close method does not have an
optional argument; it is mandatory. The documentation is
bungled for it, though.
* txr.1: Fix documentation of structure delegate streams with
regard to the close method. It does not take offs and whence
parametrs, but throw-on-error-p, which is mandatory.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (linenoise): If we are in
noninteractive mode, then do not just read one line and return
it. If an enter_callback is defined then keep accumulating
lines while the callback indicates incomplete syntax, until
EOF occurs or the syntax appears complete. Return the lines
glued together, with \n characters replaced by \r, so the line
is correctly entered into the history, and the trailing LF
obliterated, as usual.
* txr.1: Documented new multi-line behavior of plain mode.
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/struct.tl (sys:new-expander): If the argument of
new* or lnew* is dwim, then treat that as an expression,
rather than as a boa-style construction.
* tests/012/oop.tl: Tests for new* focusing on this issue.
* txr.1: Documented.
|
|
|
|
|
|
| |
* txr.1: Fix code -> codn.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (read_bad_json_s): New symbol variable.
(parser_common_init): Propagate value of *read-bad-json* into
read_bad_json flag in parser structure.
(parser_init): Initialize read_bad_json_s and register the
*read-bad-json* dynamic variable.
* parser.h (struct parser): New member, read_bad_json.
(read_bad_json_s): Declared.
* parser.y (json_val): Support an opt_comma symbol just before
the closing bracket or brace.
(opt_comma): New nonterminal symbol. Recognizes ',' or nothing.
Error is flagged if ',' is recognized, and *read-bad-json*
is nil.
* y.tab.c.shipped: Updated.
* tests/010/json.tl: New tests.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The subtypep function has poor requirements, handling only type
symbols. Let's extend it to handle structure type objects.
* lib.c (subtypep): In all cases when an argument is considered to be a
possible structure symbol, and thus subject to find_struct_type,
consider whether it already is a struct type, and just take it as-is.
* tests/012/type.tl: New tests.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hash tables with weak keys and values now support a choice of both
possible semantics: under and-semantics, an entry lapses when both the
key and value are unreachable. Under or-semantics, an entry lapses if
either the key or value is unreachable.
The and-semantics is new. Until TXR 266, only or-semantics was
supported. This will be the default: when a hash table is specified
as :weak-keys and :weak-vals, it will have or-semantics.
The keywords :weak-or and :weak-and specify weak keys and values,
with the specific semantics. They are utually exclusive, but tolerate
the presence of :weak-keys and :weak-vals.
The make-hash function is being extended such that if its leftmost
argument, <weak-keys>, is specified as one of the keywords :weak-and
or :weak-or, then the hash table will have weak keys and values with the
specified semantics, and the <weak-vals> argument is ignored
(values are weak even if that argument is false).
* eval.c (eval_init): Initially register the top_vb,
top_mb, top_smb, special and builtin hashes as ordinary hashes: no weak
keys or values. Then use tweak_hash to switch to weak keys+vals
with and-semantics. We do it this way because the keywords are not yet
initialized; we cannot use them.
* hash.h (enum hash_flags, hash_flags_t): Moved to header. Member
hash_weak_both renamed to hash_weak_or. New member hash_weak_and.
(weak_and_k, weak_or_k): New keyword variables.
(hash_print_op): Handle hash_weak_and by printing :weak-and.
(hash_mark): Handle hash_weak_and by marking nothing, like hash_weak_or.
(do_make_hash): Check first argument against the two new keywords and
set flags accordingly. This function is called from eval_init before
the keywords have been initialized, in which case weak_keys ==
weak_and_k is true when both are nil; we watch for that.
(tweak_hash): Now returns void and takes a hash_flags_t argument which
is simply planted.
(do_wak_tables): Implement hash_weak_and case. Remove the compat 266
stuff from hash_weak_or. Compatibility is no longer required since we
are not changing the default semantics of hash tables. Phew; that's a
load of worry off the plate.
(hashv): Parse the two new keywords, validate and provide semantics.
(hash_init): Initialize weak_and_k and weak_or_k kewyords.
* hash.h (enum hash_flags, hash_flags_t): Moved here now.
(weak_and_k, weak_or_k): Declared.
* lib.c (compat_fixup): Remove call to parse_compat_fixup.
* parser.c (parse_init): Create stream_parser_hash with and-semantics.
(parse_compat_fixup): Function removed.
* parser.h (parse_compat_fixup): Declaration removed.
* txr.1: Hash documentation updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From now on, hash tables with both weak keys and values have
dijunctive retention semantics. If either the key or value of
an entry is reachable, then the entry stays. This is subject
to compatibility.
* hash.c (do_weak_tables): Expire an entry if neither the key
nor the value is reachable. In 266 or lower compatibility
mode, expire an entry if either the key or value is
unreachable, like before.
* txr.1: Document the change, with compat notes. Add a
cautionary note about the referencing issue which defeats weak
key or weak value tables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit reverts the April 11, 2020 commit
a4c376979d15323ad729e92e41ba43768e8dc163, subject line
"hash: bugfix: spurious retention in weak processing".
That commit is a regression.
This revert requires a follow-up; the commit was trying to
fix an issue which now reappears. It will have to be
fixed differently.
The regression is that in a situation in which data is
referenced through two or more dependent weak tables, entries
that are reachable can spontaneously disappear from downstream
tables.
Suppose H0 and H1 are weak-key tables. Suppose the program
holds a datum K0, which is the only reference through which
D1 is reached, in the following chain:
K0 -> [H0] -> K1 -> [H1] -> D1
K0 is a key in hash table H0, which has weak keys.
The the associated value K1 is a key in H1, which then
references D1. H0 holds the only reference to K1,
and H1 holds the only reference to D1.
During the first GC marking phase, because we do not mark any
part of a table which has weak keys, when we process H0
we do not mark the value K1. Thus K1 looks unreachable.
In the second weak hash processing pass, because K1 was
treated as unreachable, the <K1, D1> entry in H1 is
incorrectly expired.
This issue affects TXR's origin_hash and form_to_ln_hash,
which are in this relationship. The problem was uncovered in
recent tags.tl work, manifesting as a spurious disappearance
of line number info when processing .txr files. The line
number info disappeared for entries which were traced through
the origin_hash via the macro-ancestor function (see the
unexpand function in tags.tl).
* hash.c (hash_mark): Only skip marking tables that have
both weak keys and values. For weak key tables, mark all the
values and vice versa: for weak value tables, mark the keys.
* txr.1: Text resembling original text restored.
|
|
|
|
|
|
| |
* txr.1: Add missing requirement: warm-up is also not
performed if make-random-state is a vector. Improve the
wording overall.
|
|
|
|
|
|
|
|
|
| |
* rand.c (make_random_state): Recognize buffer object as
sources of bits for seeding.
* tests/013/rand.tl: New file.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/doc-syms.tl: Updated.
* sysif.c (rlim_s, cur_s, max_s): New symbol variables.
(rlim_st): New variable.
(getrlimit_wrap, setrlimit_wrap): New functions.
(sysif_init): gc-protect rlim-st. Initialize symbol
vsariables. Create rlim struct type. Register getrlimit and
setrlimit intrinsics. Register variables rlim-saved-max,
rlim-saved-cur, rlim-infinity, rlimit-core, rlimit-cpu,
rlimit-data, rlimit-fsize, rlimit-nofile, rlimit-stack and
rlimit-as.
* txr.1: Documented under new Unix Resource Limits section.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
| |
txr.1: Interchange the first and second arguments of
file-put-json, file-put-jsons, file-append-json,
file-append-jsons, command-put-json and command-put-jsons.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A build-id is a string optionally embedded into TXR at build
time which can be displayed with a command line option. It can
help developers who are juggling multiple builds in their
workspace to identify what they are running.
* Makefile (txr.o, txr-win.o): If a build_id has been
defined, then define the TXR_BUILD_ID macro on the command
line when compiling these object files.
* configure (build_id): New variable.
(help) Describe build_id.
(gen_config_make): Generate build_id and build_id_exp make
variables.
* txr.1: Documented --build-id option.
* tsr.c (build_id): Conditionally defined global variable.
(help): Brief help string for --build-id.
(txr_main): Process --build-id option.
|
|
|
|
|
| |
* txr.1: Revise description of --version command line option
for grammar and accuracy.
|
|
|
|
|
|
| |
* txr.1: In a paragraph about the differences between compiled
and interpretd behavior, complete a sentence about hlet/hlet*
variables. Spotted by Paul A. Patience.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Fix minor issues.
* txr.1: Fix various grammatical errors, typos and other issues.
Notably, use en dashes rather than hyphens for ranges of numbers;
replace "exponential notation" with "E notation", which is more commonly
used (according to Wikipedia; see
https://en.wikipedia.org/wiki/Scientific_notation#E_notation); clarify
that with-stream is better than with-resources for opening exactly one
stream; and use past tense in the Compatibility Version Values section.
|
|
|
|
|
|
|
|
|
| |
* stdlib/doc-lookup.tl (open-url): Treat empty BROWSER variable
as if it were unset (i.e., ignore it). Otherwise the doc
function silently fails rather than falling back to alternative
URL-opening methods.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c, stream.h (add_suffix): New function.
(stream_init): add-suffix intrinsic registered.
* tests/018/path.tl: Tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c, lib.h (chk_substrdup): New function.
* stream.c, stream.h (trim_short_suffix, trim_long_suffix):
New functions.
(stream_init): trim-short-suffix and trim-long-suffix
intrinsics registered.
* tests/018/path.tl: New tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (separate): New function.
* lib.h (separate): Declared.
* eval.c (eval_init): Register separate intrinsic.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register built-in-type-p intrinsic.
* lib.c (buitin_type_p): Rename to built_in_type_p since the
word built-in is hyphenated. The function also tests
whether the argument is a COBJ class.
(cobj_class_exists): Function removed.
* stdlib/doc-syms.tl: Updated.
* stdlib/struct.tl (defstruct): Add built-in-type-p check.
* struct.c (make_struct_type): Call only built_in_type_p;
cobj_class_exists is gone.
* txr.1: Document built-in-type-p.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The change which allows stype_handle to recognize struct
instances, and obtain their type, has some possibly unwanted
ramifications, since the function is widely used.
Let's refactor things so that, for now, only the
struct_type_name function takes advantage of this flexibility.
* struct.c (stype_handle_impl): New static function, copy of
stype_handle, but taking an obj_ok Boolean argument to
indicate whether an object instance is an acceptable argument,
whose type should be fetched.
(stype_handle): Now a wrapper around stype_handle_impl passing
nil for the obj_ok argument.
(stype_handle_obj): New static function. Passes t for the
ok_obj argument of stype_handle_impl.
(struct_type_name): Call stype_handle_obj instead of
stype_handle.
(super): Take advantage of stype_handle_obj to reduce code.
* txr.1: Update documentation of struct-type-name, and improve
that of super.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Paul A. Patience discovered the hidden "feature" of
with-resourcers, that the three-argument form of the binding
(var init cleanup) causes the with-resources form to terminate
if init returns nil. The (var init) syntax doesn't generate
this logic.
* stdlib/with-resources.tl (with-resources): Do not emit the
when form unless <= 265 compatibility is in effect.
* tests/012/oop-mac.tl: New file.
* txr.1: Compat note added.
|
|
|
|
|
|
| |
* txr.1: Document that the suffix argument to base-name may be
given as nil, which is the same as omitting it. Nearby wording
improved. Give rationale for this, and add examples.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit_in_editor): Treat empty EDITOR variable as
if it were unset (i.e., do nothing).
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
| |
* checkman.txr (check-spaces): New pattern function for checking for
spurious spaces (i.e., two spaces or more in a row) in .meIP, .meti and
.mets macros.
* txr.1: Fix two instances of spurious spaces ("@\ newline" and
"@\ space" examples). Conform the "@\x hex-digits" and "@\ octal-digits"
examples to the fixed ones; this is more intuitive since there must be
no space before the digits in the escape sequence.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (MIN_STACK_LIMIT): New preprocessor symbol.
(gc_init): If the system stack limit is too low, don't
treat that the same way as a missing or unlimited limit.
Instead clamp to the minimum value and hope for the best.
So that is to say, the system limit cannot be used as a
mechanism to set a ridiculously low stack limit in TXR; the
only way to do that is to use the set-stack-limit function.
* txr.1: Documentation updated. Also fixed 326767 typo which
should be 32767.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Another requirements tweak to short-suffix and long-suffix:
ignore one or more trailing slashes, instead of just one.
This harmonizes with base-name, which does same, that
requirement being copies from the POSIX basename utility.
* stream.c (short_suffix, long_suffix): If sl points to a
trailing slash which is the start of a suffix that consists of
nothing but trailing slashes, then we pretend it isn't there.
* tests/018/path.tl: Adjusted two existing test cases, and
added more.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: Fix "funtion" in description of new find-true
function.
|
|
|
|
|
|
|
| |
* txr.1: The suffix of path "abc." is ".". Fix the description for this
case (which suggested the suffix was the empty string, which was the
case before commit bf2e5199e8dbc4e6fd4fcac5dab1ea16f4ec5970) and one of
the examples.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Fix typos.
* txr.1: Correct alist-remove and alist-nremove's argument
lists (the keys are variadic). Remove "(the empty string)" from
abs-path-p examples because it formats bizarrely in man output
and is anyway mentioned in the description. Remove spurious
spaces from .mets lines interfering with the formatting. Add some
missing .code and .meta directives. Unitalicize words of Latin
origin that have entered the dictionary ("de facto" and "vice
versa"). Add hyphens to compound words used as adjectives. Remove
hyphen from "non-matching". Move periods inside parentheses
containing full sentences. Add missing words. Remove repeated
words. Fix various other minor issues.
* txr.c (help): Fix a typo. Clarify a description. Add missing
periods. Make some other minor changes.
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: There is no cptr-put function; it is called cptr-out.
The last paragraph refers to cptr-out and it is referenced
elsewhere. It has to be cptr-out because it implements the
"out semantics" in FFI conversion which pairs with "put";
cptr-put would be a different function, which is not currently
implemented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: Make consistent the style for ellipses in .coNP lines (i.e.,
without the word "and"). Emend some incorrectly named symbols. Fix
various typos and other inconsistencies in .coNP lines.
* checkman.txr (check-func): Add exception for caar. Add missing
patterns for "Pattern macro", "Operator/function" and "Macro/function".
* stdlib/doc-syms.tl: Updated.
|
|
|
|
| |
* txr.1: Exception hierarchy diagram now includes opt-error.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (path_vcat): New static function.
(stream_init): Register path-cat instrinsic to path_vcat
rather than path_cat.
* tests/018/path.tl: path-cat tests: all examples from
documentation, plus others.
* txr.1: Documented existing behaviors that were not clear,
like when inputs are empty. Documented new variadic semantics.
Examples added.
|
|
|
|
|
| |
* txr.1: Corrections to three examples, where one operand is
empty, and thus the other is returned.
|