| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* txr.1: Missing @, added for comma.
|
|
|
|
|
| |
* txr.1: mlet circular references are detected at
evaluation time, not by the macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register revappend and nreconc
intrinsics.
* lib.c (list_collect_nreconc): New function.
(revlist): New static function.
(list_collect_revappend): New function.
(revappend, nreconc): New functions.
* lib.h (revappend, nreconc): Declared.
(list_collect_nreconc, list_collect_revappend): Declared.
* txr.1: Documented revappend and nreconc.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register group-reduce intrinsic.
* hash.c (group_reduce): New function.
* hash.h (group_reduce): Declared.
* txr.1: Documented group-reduce.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (block_star_s): New symbol variable.
(op_block_star): New static function.
(do_expand): Handle block* symbol.
(return_star, abscond_star): New static functions.
(eval_init): Initialize block_star_s variable.
Register block* operator and return* and sys:abscond*
functions.
* txr.1: Documented new operator and functions.
|
|
|
|
|
|
|
|
| |
* eval.c (op_for): Establish the block before doing any
evaluation, subject to the compatibility option.
* txr.1: Updated documentation for for, exchanging
steps 1 and 2. Added compatibility notes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The read function no longer works like it used to on an
interactive terminal because of the support for .. and .
syntax on a top-level expression.
The iread function is provided which uses a modified syntax
that doesn't support these operators on a top-level
expression. The parser thus doesn't look one token ahead,
and so iread can return immediately.
* eval.c (eval_init): Register iread intrinsic function.
* parser.c (prime_parser): Only push back the recently seen
token when priming for a regular Lisp read. Handle
the prime_interactive method by preparing a SECRET_ESCAPE_I
token.
(lisp_parse_impl): New static function, formed from previous
lisp_parse. Takes a boolean argument indicating interactive
mode.
(prime_parser_post): New function.
(lisp_parse): Now a wrapper for lisp_parse_impl which
passes a nil to indicate noninteractive read.
(iread): New function.
* parser.h (enum prime_parser): New member, prime_interactive.
(scrub_scanner, iread, prime_parser_post): Declared.
* parser.l (prime_scanner): Handle the prime_interactive case
the same way as prime_lisp.
(scrub_scanner): New function.
* parser.y (SECRET_ESCAPE_I): New token type.
(i_expr): New nonterminal symbol. Like n_expr, but doesn't
support dot or dotdot operators, except in nested
subexpressions.
(spec): Handle SECRET_ESCAPE_I by way of i_expr.
(sym_helper): Before freeing the token lexeme, call
scrub_scanner. If the token is registered as the scanner's
most recently seen token, the scanner must forget that
registration, because it is no longer valid.
(parse): Call prime_parser_post.
* txr.1: Documented iread.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/yield.tl (sys:rcv-item): New struct type.
(sys:obtain-impl): Handle rcv-item, produced by a no-argument
yield-from, which requests an immediate resumption with
the previously given resume value. The reply value
is renamed the resume value.
(yield-from, yield): Form argument is optional.
* txr.1: Rewrote obtain and yield documentation with
lesser focus on implementation and greater focus on
abstract semantics.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (set_dyn_env): Static function becomes external.
* eval.h (set_dyn_env): Declared.
* match.c (eval_with_bindings, eval_progn_with_bindings):
Evaluate Lisp code in null lexical environment. Instead
install the pattern variables as dynamic, so they shadow
global variables. A compatibility check for 121 or earlier
provides the old behavior.
* txr.1: Document scoping rules, and added compatibility
notes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (revive_cont): Don't wrap cons cell around
passed arg; just pass it directly. We don't need
that convention any more.
* capture_cont: Take functional argument. Pass the captured
continuation to the function. If the function returns,
return whatever it returned. When resuming, return the
continuation argument.
(uw_capture_cont): Take functional second argument
and pass to capture_cont. Context form becomes third
argument.
(uw_late_init): Update registration of sys:capture-cont
to three arguments, two required.
* unwind.h (uw_capture_cont): Declaration updated.
* share/txr/stdlib/yield.tl (sys:yield-impl): Not
needed any more; all this was doing was implementing
a call/cc style interface around sys:capture-cont
which can now be used directly.
(yield-from): Use sys:capture-cont directly.
(suspend): Simplified to the point of triviality
with new sys:capture-cont.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register intrinsic functions rcons,
rangep from and to.
(eval_init): Register rangep intrinsic.
* gc.c (mark_obj): Traverse RNG objects.
(finalize): Handle RNG in switch.
* hash.c (equal_hash, eql_hash): Hashing for for RNG objects.
* lib.c (range_s, rcons_s): New symbol variables.
(code2type): Handle RNG type.
(eql, equal): Equality for ranges.
(less_tab_init): Table extended to cover RNG.
(less): Semantics defined for ranges.
(rcons, rangep, from, to): New functions.
(obj_init): range_s and rcons_s variables initialized.
(obj_print_impl): Produce #R notation for ranges.
(generic_funcall, dwim_set): Recognize range objects for indexing
* lib.h (enum type): New enum member, RNG. MAXTYPE redefined
to RNG value.
(TYPE_SHIFT): Increased to 5 since there are now 16 type
codes.
(struct range): New struct type.
(union obj): New member rn, of type struct range.
(range_s, rcons_s, rcons, rangep, from, to): Declared.
(range_bind): New macro.
* parser.l (grammar): New rule for recognizing
the #R sequence as HASH_R token.
* parser.y (HASH_R): New terminal symbol.
(range): New nonterminal symbol.
(n_expr): Derives the new range symbol.
The n_expr DOTDOT n_expr rule produces rcons expression rather
than const.
* match.c (format_field): Recognize rcons syntax in fields
which is now what ranges translate to. Also recognize range
object.
* tests/013/maze.tl (neigh): Fix code which destructures
range as a cons. That can't be done any more.
* txr.1: Document ranges.
|
|
|
|
| |
* txr.1: Compatibility -> COMPATIBILITY
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (yield_set_entries): Added "suspend" to
end of name.
* share/txr/stdlib/yield.tl (suspend): New macro.
* txr.1: Documented suspend. Replaced subtly incorect
shift/reset implementation example with suspend implementation.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
| |
* txr.1: Improperly terminated .cblk.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/yield.tl (sys:obtain-impl): Pass
sys:cont-free symbol to each abandoned continuation
to release its stack buffer.
(obtain): Handle the sys:cont-free symbol in the
lambda, so the initial lambda can be treated
uniformly with continuation functions.
* txr.1: Documented sys:obtain-impl.
* unwind.c (sys_cont_free_s): New symbol variable.
(cont_mark): Check for null stack pointer and avoid marking.
(revive_cont): If arg is sys:cont-free, then free the
continuation and return nil. If the continuation has a null
stack buffer, throw an error.
(uw_late_init): Initialize sys_cont_free_s.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/yield.tl (sys:obtain-impl): Add a finalizer
to the returned closure which will feed sys:cont-poison object
to the most recently captured continuation. Thus abandoned
obtain blocks which have become garbage shall have their
unwinding performed.
* txr.1: Documented the finalization behavior.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (sys_cont_poison_s): New symbol variable.
(revive_cont): If the argument is the poison symbol, then
unwind through the continuation all the way back to
revive_cont's own block, instead of to the continuation's very
top block. Thus the continuation is not restarted but
completely unwound.
(uw_late_init): Initialize sys_cont_poison_s.
* txr.1: Documented sys:cont-poison.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (sys_abscond_from_s): New symbol variable.
(op_abscond_from): New static function.
(do_expand): Handle abscond-from like return-from.
(eval_init): Initialize sys_abscond_from_s and
register sys:abscond-from operator.
* share/txr/stdlib/yield.tl (yield-from): Use
sys:abscond-from instead of return-from, to avoid
tearing down the continuation's resources that it may
need when restarted.
* txr.1: Documented sys:abscond-from and added
a mention to the Delimited Continuations introduction.
* unwind.c (uw_abscond_to_exit_point): New static function.
(uw_block_abscond): New function.
* unwind.h (uw_block_abscond): Declared.
|
|
|
|
|
|
| |
* txr.1: Some wording changes and dialect note that
flet and labels do not genearate implict named
blocks in the function bodies.
|
|
|
|
|
|
|
| |
* lisplib.c (hash_set_entries): Change with-hash-table-iter
to with-hash-iter.
* txr.1: Likewise.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (yield_set_entries, yield_instantiate):
New static functions.
(dlt_register): Registered new functions.
* share/txr/stdlib/yield.tl: New file.
* txr.1: Documented obtain, yield-from, obtain-block
and yield.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (sys_capture_cont_s): New variable.
(uw_capture_cont): Second argument is now a context
form rather than a symbol; eval_error is used for error
reporting. The form's operator symbol si used in the
error message, or else sys:capture-cont if the
context argument is null or missing.
(uw_late_init): Initialize sys_capture_cont_s.
* unwind.h (uw_capture_cont): Declaration updated.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* eval.c (form_k): New keyword symbol variable.
(bind_macro_params): Implement form_k.
(eval_init): Initialize form_k.
* txr.1: Documented :form parameter.
|
|
|
|
|
|
|
|
|
|
|
| |
Expansion of places now gives priority to place macros.
Moreover, it iterates over place macro and ordinary macro
expansion.
* share/txr/stdlib/place.tl (sys:trigger-load): Removed.
(sys:pl-expand): Rewritten.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (sys_cont_s): New symbol variable.
(uw_pop_block): New function, supporting uw_block_end macro.
Special logic is needed for popping blocks now, because a
block can be a captured stub at the top of a continuation,
which must not be popped in the
regular manner.
(struct cont): New struct type.
(cont_destroy, cont_mark): New static functions.
(cont_ops): New static structure.
(revive_cont, capture_cont): New static functions.
(uw_capture_cont): New functions.
(uw_init): Initialize sys_cont_s.
Register sys:capture-cont intrinsic.
* unwind.h (enum uw_frtype): New enum member
UW_CAPTURED_BLOCK. When a block is captured as a stub copy of
the prompt block of a delimited continuation, its type is
changed from UW_BLOCK to this new type. This does two things:
it makes the block invisible to block-related code that does
nothing with continuations (code that looks for UW_BLOCK
and ignores anything else). Secondly, there is some special
handling related to UW_CAPTURED_BLOCK frames.
(uw_pop_block, uw_capture_cont): Declared.
(uw_block_begin): New local pointer uw_rslt introduced
which helps communicate the result variable over to the
uw_block_end macro (so we don't have to add a variable
argument to the latter).
(uw_block_end): Use uw_pop_block instead of uw_pop_frame.
* txr.1: Documented delimited continuations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Test for ftruncate and chsize.
* stream.c (unimpl_truncate): New static function.
(fill_stream_ops): Default the truncate operation to unimpl_truncate.
(null_ops): Initialize truncate to unimpl_truncate.
(stdio_truncate): New static function.
(stdio_ops, tail_ops): Initialize truncate to stdio_truncate.
(pipe_ops, dir_ops, string_ops, byte_in_ops, string_out_ops,
strlist_out_ops, cat_stream_ops): Initialize truncate to null,
so it gets defaulted by fill_stream_ops.
(truncate_stream): New function.
(stream_init): Register truncate-stream intrinsic.
* stream.h (struct strm_ops): New member, truncate.
(strm_ops_init): New truncate argument added to macro.
(truncate_stream): Declared.
*syslog.c (syslog_strm_ops): Initialize truncate to null.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: mention defmeth in Structures intro plus
a number of wording changes and corrections.
|
|
|
|
|
| |
* txr.1: Bad syntax formatting in defmeth.
Missing .desc under with-objects.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
| |
* stream.c (formatv): New 'b' case along side 'o', handling
binary in straightforward way for bignums, and with binary
formatting loop code for fixnums.
* txr.1: Documented b.
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (stype_handle): New static function.
(make_struct_type, super, make_struct, static_slot,
static_slot_set, static_slot_ensure, slotp, static_slot_p):
Use stype_handle,
* txr.1: Documented that static-slot and static-slot-set
take type as a symbol.
|
|
|
|
| |
* txr.1: .cblk with no closing .cble.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defmeth): New macro.
* struct.c (struct struct_type): New member, dvtypes.
(struct_init): Register static-slot-ensure
intrinsic.
(make_struct_type): Initialize dvtypes of newly instantiated
struct_type struct. If a super is specified, add new type
to the super's dvtypes.
(struct_type_mark): Mark st->dvtypes.
(static_slot_ensure): New function.
* struct.h (static_slot_ensure): Declared.
* txr.1: Documented defmeth and static-slot-ensure.
|
|
|
|
|
|
|
|
|
|
| |
System depends on environment variables, and also causes
SIGINT and SIGQUIT to be ignored.
* stream.c (sh): Function rewritten in terms of sh,
in two platform variants.
* txr.1: Documented that sh doesn't use system as of TXR 120.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* combi.c (perm_list, perm_str, rperm_list, reperm_gen_fun,
rperm_vec, comb_vec, rcomb_list, rcomb_vec, rcomb_str):
Follow rename of list_vector to list_vec.
* eval.c (vector_list_s): Global variable renamed to
vec_list_s.
(expand_qquote): Follow vector_list_s to vec_list_s.
(eval_init): Follow renames of all identifiers. Functions
num-chr, chr-num, vector-list and list-vector are
registered under new names, while remaining registered
under old names.
* eval.h (vector_list_s): Declaration renamed.
* filter.c (url_encode): Follow chr_num to chr_int rename.
* lib.c (make_like, interpose, shuffle): Follow vector_list to vec_list rename.
(tolist, replace, replace_list): Follow list_vector to list_vec rename.
(num_chr): Renamed to int_chr.
(chr_num): Renamed to chr_int.
(vector_list): Renamed to vec_list.
(list_vector): Renamed to list_vec.
* lib.h (num_chr, chr_num, list_vector, vector_list):
* Declarations renamed.
* parser.y (vector): Follow vector_list to vec_list rename.
* txr.1: Updated documentation for num-chr, chr-num,
list-vector and vector-list with new names, and notes
about the old names being supported, but obsolescent.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (uw_find_frame): New function.
(uw_late_init): Registered find-frame intrinsic.
* unwind.h (uw_find_frame): Declared.
* lib.h (default_arg_strict): New inline function.
Will not replace nil value with default.
* txr.1: Documented find-frame.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (types_s, jump_s): New symbol variables.
(frame_type, catch_frame_type, handle_frame_type): New globals
denoting struct types.
(uw_get_frames, uw_invoke_catch): New functions.
(uw_late_init): Initialize new global variables.
Register get-frames and invoke-catch intrinsics.
* unwind.h (uw_get_frames, uw_invoke_catch): Declared.
* txr.1: Documented frame, catch-frame,
handle-frame, get-frames and invoke-catch.
|
|
|
|
| |
* txr.1: suports only VT100.
|
|
|
|
| |
* txr.1: Object Type and Equivalence split into two.
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (type_set_entries, type_instantiate): New static
functions.
(lisplib_init): Register new functions in dl_table.
* share/txr/stdlib/type.tl: New file, providing typecase
* txr.1: Documented typecase.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (handler_bind_s): New symbol variable.
(op_handler_bind): New static function.
(do_expand): Traverse handler-bind forms.
(eval_init): Initialize handler_bind_s variable and register handler-bind
operator.
* lisplib.c (except_set_entries, except_instantiate): New functions.
(lisplib_init): Register new functions in dl_table.
* parser.c (intr_s): New symbol variable.
(repl_intr): Throw exception of type intr, rather than error.
This way we can interrupt accidental exception handling loops involving
exceptions derived from error.
(parse_init): Initialize intr_s.
* share/txr/stdlib/except.tl: New file, defines handle macro.
* unwind.c (uw_push_handler): New function.
(invoke_handler): New static function.
(uw_throw): Search loop looks for and processes handlers in addition to
catches.
* unwind.h (uw_frtype_t): New enum member, UW_HANDLE.
(struct uw_catch): Move member visible so it
is in the same position as in struct uw_handler.
(struct uw_handler): New struct type.
(union uw_frame): New member ha of type struct uw_handler.
(uw_push_handler): Function declared.
* txr.1: Added introductory paragraphs to Exception Handling section.
Documented handler-bind and handle. Some minor errors corrected.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register hash-begin and hash-next intrinsics.
* lisplib.c (hash_set_entries, hash_instantiate): New static functions.
(lisplib_init): Register new tables in dl_table.
* share/txr/stdlib/hash.tl: New file.
* txr.1: Document with-hash-iter macro.
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (make_struct): Add unwind protection around
the initialization of the struct object, which calls
the partially initialized object's finalizers if
initialization is abandoned by a non-local exit.
* txr.1: Document the behavior, under make-struct and
the new macro.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): Rearrange the
generated instance initialization function so that if a :fini
block was specified, it is performed first. Thus if the
remaining initialization code is abandoned, it is possible to
intercept that and invoke the finalizer, which can clean
up any mess left behind.
* txr.1: Document changed order.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|