| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (gc_init): We must check rlim_cur for the RLIM_INFINITY
value indicating unlimited stack, and not misuse this value as a
limit number, otherwise hilarity ensues. This reproduced on
an older platform with make 3.81, which calls setrlimit to
bring about an unlimited stack, passed on to child processes.
Because of this txr segfaulted, as a consequence of a false
positive.
* tests/012/stack.tl (stack-limited): New variable which
indicates whether there is a stack limit. If there isn't, we
avoid running the fork-based test case. Also, we set the stack
limit to 32768 so we have a limit against which to run some of
the tests.
|
|
|
|
|
| |
* lisplib.c (error_set_entries): Autoload error module on
lambda-excess-apply-list, which was recently added.
|
|
|
|
|
| |
* tests/018/path-test.tl: Check that the result of a path-search for
"sh" only ends in "/bin/sh", not that it is precisely "/bin/sh".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (lambda-apply-transform): When processing
optional argument from apply-list, push an entry into
check-opts, so the fixup code is generated for it.
New test cases pass now.
|
|
|
|
|
| |
* tests/012/lambda.tl: Add tests where apply list supplies :
values to optional params, which must trigger defaulting.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compiler test case fails on cases which pass a : value to
an optional argument, which is supposed to trigger defaulting.
* stdlib/compiler.tl (lambda-apply-transform): When processing
an optional argument, if the argument is other than a constant
expression evaluating to the : symbol, add an entry into a
new check-opts list. This is later traversed to add code
before the lambda body to check the optional parmeters for :
values and do the init-form processing. The test cases pass
with this, but it needs to be done in the case when optional
values come from the apply list also; this is not being
tested.
|
|
|
|
|
| |
* stdlib/compiler.tl (lambda-apply-transform): In one case,
the add call is missing to actually emit the rest parameter.
|
|
|
|
|
|
|
|
| |
* tests/common.tl (*compile-test*): New variable.
(vtest): Compile cases via compile-toplevel if *compile-test*
is true, catching compile-time exceptions.
* tests/012/lambda.tl: Set *compile-test* true and repeat file.
|
|
|
|
| |
* stdlib/error.tl (lambda-too-few-args): Fix "inufficient".
|
|
|
|
| |
* tests/012/compile.tl: Add const.tl file.
|
|
|
|
|
| |
* tests/012/compile.tl: Remove suffixes from name list, and
simplify code.
|
|
|
|
| |
* tests/012/lambda.tl: New file.
|
|
|
|
| |
* tests/012/const.tl: New file.
|
|
|
|
|
|
| |
* tree.c (tree_init): Register tnodep as intrinsic function.
This is documented! Another discrepancy found thanks to the
new piece of code in genman.txr.
|
|
|
|
|
|
|
|
|
|
| |
* signal.c (sig_init): Register ITIMER_PROF as the documented
itimer-prof, not the undocumented itimer-prov. Anyone
depending on this will have to fix their code to use the new
variable, or else (defvarl itimer-prof itimer-prov).
This was discovered due to Paul A. Patience's doc-syms
scrubbing code recently added to genman.txr, which identifies
documented symbols not present in the actual image.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* genman.txr: Before generating stdlib/doc-syms.tl, check that the
symbols going into that file (i.e., into the doc-syms variable) are
actually contained in the TXR image (allowing for some exceptions).
Also, reindent some lines.
|
|
|
|
|
|
| |
* lib.c (find_symbol): This function is identical to
find_symbol_fb. The code for searching the fallback list must
be removed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.c (help): Remove -b help text which pertains to an
ancient -b option that was deprecated in 2014. Add correct
help text for -b.
(txr_main): Use split_str for the argument of -b. If it fails
to produce a two-element list, it means the equal sign is
missing; issue an error message and exit. Thereby we avoid
passing nil as the input source argument of lisp_parse.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numerous functions in TXR Lisp treat a nil argument for an
optional parameter as if it were omitted. In the case of
streams, this can cause problems. An accidental nil passed to
an input function can cause it to read from standard input and
hang. In this patch, argument defaulting is tighented for
functions that perform I/O. It's mostly stream parameters, but
not exclusively.
* eval.c (prinl, pprinl): Use default_arg_strict to default
the stream argument, and also re-use that value for the
put_char call.
* lib.c (lazy_stream_cons, print, pprint, put_json): Use
default_arg_strict rather than default_arg.
* parser.c (regex_parse, lisp_parse_impl, txr_parse): Tighten
the defaulting of the input stream and error stream arguments,
streamlining the logic at the same time.
* stream.c (do_parse_mode): Use default_arg_strict for the
mode string argument.
(record_adapter, get_line, get_char, get_byte, get_bytes,
unget_byte, put_buf, fill_buf, fill_buf_adjust,
get_line_as_buf, put_string, put_char, put_byte, put_line,
flush_stream, get_string): Use strict defaulting for stream
argument.
(mkstemp_wrap): Use strict defaulting for suffix.
|
|
|
|
| |
* txr.1: Exception hierarchy diagram now includes opt-error.
|
|
|
|
|
|
| |
* lisplib.c (getopts_set_entries): Add opt-error to list of
interned symbols. Without this, getopts throws sys:opt-error.
Reported by Paul A. Patience.
|
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (lambda-apply-transform): There is a bug
in the case when all required and optional parameters have
been satisfied. In the sub-case when there are no fixed
parameters, we need to handle the run-time situation of there
being a non-empty apply list, but no rest variable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/op.tl (op-expand): The logic involving the multiple
expansions of do is consolidated into one step, so that
everything is taken care of by the time syntax-1 is produced.
Immediately when the initial unsuffixed arguments expand
successfully, we check or the presence of metas and add the @1
if metas are absent. In the case of expanding with the gensym,
we immediately replace that with @1 without using symacrolet.
The do-gen variable is gone. Later, when calculating
lambda-interior, there are no hacky additional passes to deal
with; that block of code just refers to syntax-2. The do case
is folded together with the have-metas case. Also adding
copious comments to this hard-to-follow logic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the case when the do syntax has no metavariables, and it
expands as-is without the addition of symbol in the tail
position, we are doing something wrong: we are adding the
@1 into the expanded version of the form, rather than
the original. For instance:
1> (expand '(do pop a))
(lambda (#:arg-1-0017 . #:arg-rest-0016)
(prog1 (car a)
(sys:setq a (cdr a))
#:arg-1-0017))
Here, the @1 was inserted into the (prog1 ...) form
which is the expansion of pop. This is incorrect;
it must be inserted into the original (pop a)
syntax as (pop a @1).
* op.tl (op-expand): In this case when there are no
metas and no do-gen that can be replaced by @1 via
symacrolet, go back to the original args syntax,
add the arg1 meta into that syntax, and process it
from the beginning through parallel expansions
steps.
* tests/012/op.tl: Couple of tests added.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we compile an immediately applied lambda like
(apply (lambda (a b c) ...) list), we are not emitting code to
handle the run-time situation when there are too many elements
in the list. This shows up in exception handling, for
instance; the compiled version of this executes silently and
returns 42:
(catch (throw 'foo 5) (foo () 42)))
foo is must have a parameter to capture the 5; interpreted
code enforces this.
* stdlib/compiler.tl (lambda-apply-transform): In the
apply-list case, at the end of binding all the optional
arguments, if the parameter list doesn't have a rest
parameter to take any remaining items, we emit code to check
that there aren't any; that everything has been popped out of
the apply list, leaving it nil. If not, we call the
run-time support function lambda-excess-apply-list.
* stdlib/error.tl (lambda-excess-apply-list): New function.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* stream.c (path_cat): Use length_str to enforce a type check.
Otherwise, for instance, (path-cat #() "foo") will return "foo".
|
|
|
|
|
| |
* txr.1: Corrections to three examples, where one operand is
empty, and thus the other is returned.
|
|
|
|
|
|
|
|
|
| |
* stdlib/doc-lookup.tl (open-url): On non-Windows platforms,
search for a program specified by the BROWSER variable,
then by the URL-opening utility, and finally thorugh a
fallback list of browsers.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is like find-if, but returns the value of the predicate
function rather than the item.
* eval.c (eval_init): Register find-true instrinsic.
* lib.c (find_true): New function.
* lib.c (find_true): Declared.
* stdlib/doc-syms.tl: Updated.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (path_test_set_entries): Autoload on path-search.
* stdlib/path-test.tl (path-search): New function.
* tests/018/path-test.tl: New file.
* txr.1: Documented.
* stdlib/doc-lookup.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is common for web browsers like firefox not to fork
themselves into the background when initially run from the
command line. Only when an additional instance is executed
does that instance terminate immediately, passing the URL to
the existing instance. (Which also does not constitute forking
into the background, but does have the effect of an immediate
exit.)
User Paul A. Patience reports that some installations of
xdg-open have the isssue of not handling this situation; these
versions of xdg-open wait for the browser to terminate, which
causes xdg-open to hang until the browser is closed if it is
the initial instance.
* stdlib/doc-lookup.tl (detached-run): New function. Like run,
but forks into the background, running the process in a
detached grandchild whose parent terminates, so that it
becomes an orphan parented to the init daemon. We redirect
*stdout* to *stdnull* because the first instance of the
browser can spit ugly, meaningless diagnostics when it
terminates.
(open-url): Use detached-run instad of run. Don't check the
return value for zero; there is no integer exit status.
|
|
|
|
|
| |
* stdlib/doc-lookup.tl (*doc-url*): Define with defvar,
not defvarl. Problem reported by Paul A. Patience.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch improves the constantp function dramatically. It
now performs a full expansion of its argument, and recognizes
all of the constant foldable functions that the compiler
recognizes.
* eval.c (const_foldable_s): New symbol variable.
(const_foldable_hash): New static variable.
(constantp_noex): Look up function in the hash table of const
foldable functions, including in the case when it appears in a
dwim form as in [+ 2 2] which is (dwim + 2 2). In this case,
recursively check the arguments for constantp_noex.
We get the hash table of foldable functions from the
sys:%const-foldable% variable, which comes from an autoloaded
module.
(constantp): Fully expand the input form, not just m
macroexpand.
(eval_init): Register the const_foldable_s variable.
* lisplib.c (constfun_instantiate, constfun_set_entries): New
static functions.
(lisplib_init): Register auto-loading of constfun module
via new static functions.
* stdlib/compiler.tl; Load the constfun module if
%const-foldable% is not defined.
(%const-foldable-funs%, %const-foldable%): Removed from here.
* stdlib/constfun.tl: New file.
(%const-foldable-funs%, %const-foldable%): Moved here.
* txr.1: Documented changes to constantp.
|
|
|
|
|
|
| |
* eval.c (expand_progn, do_expand): Use the constantp_noex
helper function of constantp on arguments that we have already
fully expanded.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The regex-compile function accepts syntax in which certain
operators like (or ...) can be n-ary. This representation
is converted to the strictly binary form that is understood
by the compiler internals (and which regex-parse outputs),
as well as the regex printer.
Unfrotunately, regex-compile is attaching the original
form with the n-ary operators to the regex object, and the
printer does not reat this; it renders the syntax with
portions missing. It needs the binary form.
* regex.c (regex_compile): Capture the intermediate result
from calling reg_nary_to_bin, and use that as regex_source.
The pass that through the remaining two optimization passes
to obtain regex_sexp which is compiled.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (regex_optimize): New static function, capturing the
three optimization passes.
(regex_compile): Code moved into regex_optimize.
(regex_init): Remove sys:reg-optimize function. Register
regex-optimize.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
| |
* filter.c (regex_from_trie): An empty trie matches nothing,
so we must return the t regex syntax (match nothing), not
nil (match empty string). A hash-based trie matches nothing
if it is empty; but if it has user data, then it matches
the empty string.
* tests/015/trie.tl: Test cases added.
|
|
|
|
|
|
|
|
|
|
| |
* filter.c (regex_from_trie): If a hash key maps to a string,
do not treat that as a trie; it is the value for that node.
A value is only a trie if it is a cons or hash. Also, in this
case do not make a compound regex.
* tests/015/trie.tl: Add duplicate of regex test case using
regex from compressed tree.
|
|
|
|
|
|
|
| |
* filter.c (trie_filter_string): There is no need to convert a
character to string for passing it as a second argument to
string_extend; it takes characters. Also this had beem coded
in a silly way: if chrp is true that implies !stringp.
|
|
|
|
|
|
|
|
|
|
| |
* filter.c (regex_from_trie): The code is neglecting to check
whether there is a match of the input *at* the given hash
table, which is true if it has user data. In that case, the
empty regex must be added as a parallel branch.
* tests/015/trie.tl: The first regex test case works now.
The second one is incorrect and is replaced.
|
|
|
|
|
|
|
|
|
|
| |
This is not a complete fix yet; the test case still fails.
* filter.c (regex_from_trie): The (or ...) operator in the
regex language is strictly binary. Do not produce a
variable-argument or expression.
* tests/015/trie.tl: New file.
|
|
|
|
|
|
|
|
| |
* signal.c (sig_handler): Some older compilers cannot figure
out that stack_lim is not used uninitialized, due to the
conditional logic here, in which two separate code blocks are
guarded by the same condition. Let's initialize the variable,
like the others.
|