| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* streamc (shell, shell_arg): External variables become
internal.
|
|
|
|
|
|
|
| |
* stream.c (stdio_close): Recognize stderr, not only stdin and
stdout, as one of the streams not to be closed. This fixes
situations when stderr is closed and exception handling tries
to use it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before uw_rthrow calls uw_unwind_to_exit_point, it decrements the
reentry_count, so that function is not protected against
re-entry. We could protect some of its internal code agains
re-entry, like the use of a bad stderr stream, if we extend
the scope of that variable.
* unwind.c (reentry_count): New static variable, moved to file
scope from uw_rthrow function.
(uw_unwind_to_exit_point): Bump up the reentry count in two
places where we print diagnostics and terminate. If the
diagnostic code hits an exception, the uw_rthrow will see
the positive reentry count and abort.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Exception processing should refer to the original, top-level
value of *stderr* rather than the current dynamic value, even
if unwinding has not yet taken place. Using the dynamic value
can not only cause critical output to disappear, but it leads
to a false positive identification of the "unhandled exception
in early initialization" situation, a diagnostic which is
emitted on the C stderr if the Lisp one is unavailable,
which is assumed to be due to initialization not having
yet completed.
* stream.c (top_stderr): New global variable.
(stream_init): GC-protect top_stderr, and initialize it with
the same object that goes into the *stderr* top-level binding.
* stream.h (top_stderr): Declared.
* unwind.c (uw_unwind_to_exit_point, uw_rthrow): Use
top_stderr instead of std_error macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (regex_compile): In the string case when regex_parse
needs to be called, redundant argument defaulting is being
performed on error_stream, defaulting it to nil. The
regex_parse function doesn't like that; it no longer accepts
nil as a facsimile of missing. The right thing to do here is
nothing: just pass error_stream to regex_parse as-is and let
it do the defaulting. And that is how the code was initially
until commit a8b0e36b1760e51a8a3a25d4e22a325e407ef3d4 in March
of 2014, which introduced the redundant defaulting.
Reported by Paul A. Patience
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All expand-time errors go through expand_error for
compiler-stylen error reporting.
* eval.c (not_bindable_error, dotted_form_error): Only
expander helper functions call these helpers so they get
switched to expand_error.
(expand_opt_params_rec, expand_params_rec, expand_param_macr,
expand_lisp1, expand_lisp1_value, expand_lisp1_setq,
expand_setqf, expand_qquote_rec, expand_vars,
expand_fbind_vars, me_case, me_whilet, me_iflet_whenlet,
me_load_for, expand_catch_clause, expand_switch, me_l1_val,
me_l1_setq): Use expand_error instead of eval_error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (bind_macro_params): Take the error reporting
function as a functional argument which points either to
eval_error or expand_error. Update all the recursive calls to
pass it down. Replace all calls to eval_error with this
function pointer.
(me_interp_macro, op_mac_param_bind, op_mac_env_param_bind):
Call bind_macro_params with expand_error as the function, so
that under the right circumstances, the error will go to
standard error, as well as being thrown as an exception.
In the case of me_interp_macro, this is clear. The reason we
do it for the other two is that their primary use case is
inside macros.
(op_tree_case, op_tree_bind): Pass eval_error to
mac_param_bind, preserving existing behavior.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_exception): New parameter distinguishes whether
this function is called from expansion time. If so, it behaves
similarly to the compile-error funtion in error.tl: if
a recursive load is in effect, a there is no error handler,
then deferred warnings are dumped to standard error, followed
by the error message. Then the exception is thrown.
(eval_error, eval_warn): Pass zero to eval_exception to
indicate that this is not expansion time.
(expand_error, missing_arg_error, excess_args_error,
no_dot_check, syn_check): New static functions.
(me_def_variable, me_each, me_for, me_gen, me_gun, me_delay,
me_when, me_unless, me_while_until, me_whie_until_star,
me_equot, me_case, me_dotimes, me_lcons, me_mlet,
me_load_time, me_l1_val, me_l1_setq, me_assert): Add syntactic
checks to built-in macros.
(do_expand): Add syntactic checks for a number of special
operators.
* unwind.c (catch_frame_s): New symbol variable.
(uw_late_init): Initialize catch_frame_s and use that in
registering the catch-frame structure.
* unwind.c (catch_frame_s): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
txr can process a Lisp file specified on the command line and
then enter into the listener. In order to always enter the
listener, even if the file errors out, the execution of the
file uses read_eval_stream_noerr, which was written for this
purpose. But this causes a problem for error reporting which
is sensitive to whether or not an error handler exists.
(See the compile-error function, and how it uses find-frame.)
* txr.c (txr_main): Because we already know whether we are
going to be entering the listener, we can split the evaluation
of the Lisp file into two cases: if we will be entering the
listener, we evaluate it with ignored error exceptions.
If we won't be entering the listener, we evaluate normally.
With this, I can run "make tests" now and be taken to the
locaton of certain errors, due to the messages appearing on
standard error.
|
|
|
|
|
|
| |
* tests/018/chmod.tl (os): Fix final parentheses of defvarl form
accidentally encompassing the rest of the source file. Replace tabs with
spaces.
|
|
|
|
|
| |
* stdlib/doc-lookup.tl (os-symbol): Add case for OpenBSD.
(open-url): Same.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* genman.txr (dupes, tagnum): Replace defvar with defvarl.
* stdlib/doc-lookup.tl (os-symbol): Same.
* tests/011/macros-3.tl (x): Same.
* tests/011/mandel.txr (x-centre, y-centre, width, i-max, j-max, n)
(r-max, pixel-size, x-offset, y-offset): Same.
(file, colour-max): Delete (unused) variables.
* tests/012/circ.tl (x): Replace defvar with defvarl.
* tests/012/stack.tl (stack-limited): Same.
* tests/012/struct.tl (s): Same.
* tests/013/maze.tl (vi, pa, sc): Delete variables. Use
function arguments instead.
(usage): Fix typo.
* tests/014/dgram-stream.tl (family): Rename to...
(*family*): ...this.
* tests/014/socket-basic.tl (socktype): Rename to...
(*socktype*): ...this.
(%iters%): Replace defvar with defvarl.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (tainted): Fix typo. Reword sentence.
(rebuild): Remove obsolete references to repatch target.
(clean, distclean): Remove tst directory. Separate directory removals
from file removals. Remove txr-manpage.html and txr-manpage.pdf in both
distclean targets. In non-configured distclean, correct the
removal of .tlo files to be from the stdlib directory rather than from
share (and limit the pattern to *.tlo rather than *.tlo*, since .tlo2
files are no longer generated); and explicitly remove config.h and
config.make, just like the configured distclean.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* checkman.txr (check-synb): Correct :min to :mintimes.
(check-meti): Fix typo in comment.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
Even if built without getrlimit, and even if getrlimit
reports an unlimited stack size, set up a default limit.
* gc.c (DFL_STACK_LIMIT): New preprocessor symbol, defined as
128 kilbytes for a small memory configuration, otherwise
16 megabytes.
(gc_init): Set up a default stack limit unconditionally
based on DFL_STACK_LIMIT before probing getrlimit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|