| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
* linenoise/linenoise.c (show_help): Rearrange contents.
^X+Tab moves from page 3 to page 2, to a spot where there
is just enough room. That gives us room to place ^X^P on
page 3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue is that when *listener-pprint-p* is set, then
the evaluation is printed using pprinl. The user may have
arranged for that to safely work when there are circular
objects in the print. But then the listener ignores
*listener-pprint-p* when saving the output object as a string
(which is done for the sake of the Ctrl-X Ctrl-P
paste-previous-output feature). The tostring function is used
which can blow up on an object containing circular structure,
even though the object was successfully printed.
The user is puzzled: why was the result of the evaluation
printed completely and perfectly, yet the image has hanged?
* parser.c (repl): Do not use tostring for converting the
evaluated output to a string. Choose between tostring and
tostringp based on the *listener-pprint-p* variable.
|
|
|
|
|
| |
* txr.1: Remove unclear pronoun in remark about addressing
structure.
|
|
|
|
| |
* txr.1: Fix "an" that should be "and".
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_pprof): Instead of emitting open code which
destructures the output of pprof and prints a diagnostic,
let's do that inside a run-time support function called
sys:rt-pprof, so (pprof x) now expands to (rt:pprof (prof x)).
(rt_pprof): New function.
(eval_init): Register sys:rt-pprof intrinsic.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (compiler comp-prof): We must
use the incoming oreg as the destination for prof,
and not try to use output register indicated by the compiled
fragment. That fragment may indicate nil as its output,
which we may not clobber. Since we are telling the sub-compile
to try to put the fragment's output into our oreg, in most
cases they still get merged so a single register is re-used.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (new): Use struct-from-args and
struct-from-plist whenever possible; don't use make-struct
unless the syntax specifies both BOA and plist arguments.
Using struct-from-plist instead of make-struct means we can
now entirely avoid consing a list in compiled code.
Code like (new point x 0 y 0) now allocates nothing but the
struct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We reduce consing in the structure instantiating API.
* struct.c (make_struct_impl): New static function, formed
from make_struct. This takes two "struct args *" arguments,
for both the slot/pair property list and the BOA list.
(make_struct): Now a wrapper for make_struct_impl.
(struct_from_plist): Call make_struct_impl instead of
make_struct, avoiding the args_get_list operation that
potentially conses args on the stack into a list.
Diagnosis is improved because make_struct_impl takes a self
argument.
(struct_from_args): Call make_struct_impl instead of
make_struct.
|
|
|
|
|
|
| |
* arith.c (highest_bit): On GCC, use __builtin_clz.
* mpi/mpi.c (s_highest_bit): Likewise.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* struct.c (struct_type_finalize): We must check slot_cache
for null. The slot symbols of a struct type being finalized
might not have slot caches.
|
|
|
|
|
| |
* RELNOTES: Restore correct date under TXR 209.
Add missing date under 210.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem: in an incremental GC run, when an generation 0
object is determined to be unreachable and has a registered
finalizer, it ends up hanging around until a full GC. This is
because it is marked as if it were reachable (just in case the
finalizer re-introduces it into the object graph) and left to
be processed at the next GC. However, what's missing is that
the object is not in the freshobj array any more, and so it is
not reclaimed by the sweep function. Effectively, it's as if
the object had been promoted to gen 1.
* gc.c (call_finalizers_impl): After invoking a finalizer,
if the object is still in gen 0, add it to the freshobj
array as if it had just been allocated. If there is no room
in the freshobj array, set the full_gc flag, as usual.
|
|
|
|
|
| |
* txr.1: Make it clearer that ftw operates on a list; that
fact was too buried in the documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (save_exe_instantiate, save_exe_set_entries): New
static functions.
(lisplib_init): Register auto-load of save-exe module, keyed
to save-exe symbol.
* share/txr/stdlib/save-exe.tl: New file.
* txr.1: Removing txr-embedded-arg.txr documentation and
documenting save-exe in its place.
* txr-embedded-arg.txr: File removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (scan_until_common): New static function, made from
read_until_match.
(read_until_match): Now just wrapper for scan_until_common.
(scan_until_match, count_until_match): New functions.
(regex_init): Registered new intrinsics scan-until-match and
count-until-match.
* regex.h (read_until_match, scan_until_match): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* stream.c (fill_buf_adjust): New function.
(stream_init): Register fill-buf-adjust intrinsic.
* stream.h (fill_buf_adjust): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* buf.c (buf_alloc_size): New function.
(buf_init): buf-alloc-size intrinsic registered.
* buf.h (buf_alloc_size): Declared.
* txr.1: Documented.
|
|
|
|
| |
* buf.c (length_buf): Replace incorrect name.
|
|
|
|
|
|
|
|
|
| |
* txr.c (sysroot_init): prog_dir is missing a trailing
slash, and this breaks the fallback case when we're running a
renamed txr executable in the build directory. The presence of
the trailing slash had also been documented for the txr-path
variable, which is now obsolescent and undocumented.
That is hereby fixed.
|
|
|
|
|
|
|
|
|
| |
* txr.c (sysroot_init): Make prog_path available via the
txr-exe-path variable. The txr-path variable becomes
obsolescent.
* txr.1: Documented txr-exe-path; removed documentation
for txr-path.
|
|
|
|
|
|
| |
* linenoise.c (edit_in_editor): If we can't read the file,
then preserve the file, and replace the command line buffer
with an error message in which the name of that file appears.
|
|
|
|
|
|
|
|
|
| |
When an external file is edited, and is longer than the
listener's buffer allows, the buffer overflows, trashing the
other fields in the linenoise structure, and memory beyond.
* parser.c (lino_gets): Decrement nchar in the loop.
Also, eliminate useless return case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This relates to the optimized insert at the end of the line.
The following bug manifests itself. When the cursor is not at
the bottom of the screen (e.g. fresh terminal after a clear
screen), if blank lines are added to the buffer and then
backspace is hit, the cursor strangely jumps down by multiple
lines prior to the refresh.
In a Windows CMD.EXE window, this shows up even at the bottom
of the screen, because the CMD.EXE console responds to a
downward movement (ESC[<n>B) beyond the bottom row by
scrolling the screen, rather than clipping the movement.
* linenoise/linenoise.c (refresh_multiline): When doing the
elided refresh (l->need_refresh == 2), we must update not only
l->maxrows but also l->oldrow. Otherwise when we do
the real update, it will think that the cursor is on the first
line, and try to move down to the last line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (uptopow2_0, uptopow2_1, uptopow2_2, uptopow2_3,
uptopow2_4, uptopow2_5, uptopow2): New macros.
(struct struct_id_recycle): Declaration removed.
(struct_id_counter, struct_id_stack): Static variables
removed.
(get_struct_id, recycle_struct_id): Static functions removed.
(struct_type_finalize): No need to recycle struct ID;
don't call removed recycle_struct_id function.
(make_struct_type): Don't call removed get_struct_id to
allocate ID. Rather, cast the struct_type handle pointer to
unsigned integer, and divide by the next smallest power of
two.
|
|
|
|
|
|
|
|
| |
* struct.c (struct struct_inst): When the dirty flag was
added, the id field was not decreased by one bit to make
space, so the desired packing is not being achieved any
more. Let's just use TAG_SHIFT to reserve the maximum bits
that will still let us fit a fixnum into id.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (nelem): New macro.
(struct struct_id_recycle): New struct type.
(struct_id_counter): Initialize to 1 instead of zero.
(get_struct_id, recycle_struct_id): New static functions.
(struct_type_finalize): From each slot symbol, remove the
struct type's ID from it slot cache, and finally recycle the
struct type ID.
(make_struct_type): Use get_struct_id to obtain an ID for the
new struct type, rather than directly incrementing the global
counter.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
| |
When Enter is input in multi-line mode, a ^M appears instead
of advancing to the next line. When the display is refreshed,
the ^M's are properly treated as line breaks.
* linenoise.c (edit_insert): Let's restructure the conditional
ladder here into a switch and handle ENTER by issuing CR-LF.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The associative lists that make up the chains of a hash table
are guaranteed to be made of conses. We can use unsafe
versions of car, cdr, rplaca and rplacd to speed up hash
operations.
* eval.c (op_dohash): Use unsafe operations on hash cell.
* filter.c (trie_compress, regex_from_trie): Likewise.
* hash.c (hash_equal_op, hash_print_op, hash_mark, hash_grow,
hash_assoc, hash_assql, copy_hash_chain, gethash, inhash,
gethash_n, sethash, remhash, hash_next, maphash,
do_weak_tables, group_by, group_reduce, hash_keys_lazy,
hash_keys, hash_values_lazy, hash_values, hash_pairs_lazy,
hash_pairs, hash_alist_lazy, hash_uni, hash_diff,
hash_symdiff, hash_isec, hash_subset, hash_update,
hash_update_1, hash_revget): Likewise.
* lib.c (us_rplaca, us_rplacd): New functions.
(package_local_symbols, package_foreign_symbols, where,
populate_obj_hash, obj_hash_merge): Use unsafe operations on
hash cell
* lib.h (us_rplaca, us_rplacd): Declared.
* parser.c (circ_backpatch, get_visible_syms): Use unsafe
operations on hash cell.
* struct.c (method_name, get_slot_syms): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (env_fbind, env_vbind, reg_symacro): Use gethash_l
instead of gethash_c to eliminate repeated cdr operations
on the same cell.
* hash.c (sethash): Since new_p is never used, eliminated it
and use nulloc.
(group_reduce): Use gethash_l instead of gethash_c.
* lib.c (obj_init): Replace rplacd(gethash_c(...)) pattern
whose return value is not used with with sethash. We lose some
diagnosability here since sethash doesn't take a "self"
argument.
(obj_print_impl, obj_hash_merge): Use gethash_l instead of
gethash_c.
* parser.y (ensure_parser, parser_circ_def, get_visible_syms,
rlset): Use gethash_l instead of gethash_c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Uses of gethash_f can be replaced with gethash_e, which
returns the hash cell directly rather than through a loc
argument. Code that needs the value can call cdr itself.
* hash.c (inhash, hash_isec, hash_update_1): Replace gethash_f
with gethash_e.
(gethash_f): Function removed.
* hash.h (gethash_f): Declaration removed.
* lib.c (use_sym, unuse_sym, find_symbol, unintern,
intern_fallback, in, sel, populate_obj_hash): Replace
gethash_f with gethash_e.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register symdiff intrinsic.
* lib.c (symdiff): New function.
* lib.h (us_car_p, us_cdr_p): New inline functions.
(symdiff): Declared.
* txr.1: Documented, also fixing issues not related to
symdiff doc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also, these functions now support hashes.
* eval.c (eval_init): Register only the deprecated set-diff to
the set_diff function. The diff intrinsic is now going to the
new function named diff.
* lib.c (diff): New function.
(isec, uni): Rewritten to use seq_iter_t.
* lib.h (diff): Declared.
* txr.1: Documentation updated.
|
|
|
|
|
| |
* lib.c (num): Use num_fast instead of an expression that is
identical to the body of that inline function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This has been needed for a while. While we have seq_info for
classifying sequences to nicely dispatch code into various
cases, those cases duplicate code. The code base could benefit
from generic traversal.
* lib.c (seq_iter_get_nil, seq_iter_get_list,
seq_iter_get_vec, set_iter_get_hash): New static functions.
(seq_iter_rewind, seq_iter_init): New functions.
* lib.h (struct seq_iter, seq_iter_t): New struct type and its
typedef name.
(seq_iter_init, seq_iter_rewind): Declared.
(seq_get): New inline function.
|
|
|
|
|
|
|
|
|
| |
* hash.c (hash_from_alist_v): New function.
(hash_init): Register hash-from-alist intrinsic.
* hash.h (hash_from_alist_v): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* hash.c (hash_symdiff): New function.
(hash_init): hash-symdiff intrinsic registered.
* hash.h (hash_symdiff): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* hash.c (hash_uni): The join function must only be called for
the values of keys that exist in both hashes. The broken logic
here unconditionally calls the join function for all keys in
the left hash (using nil as the right join value when the key
doesn't exist in the right hash).
|
|
|
|
|
|
| |
* txr.1: In Notes under load-time, the function is once
referred to as load-value; also the phrase load-time value is
used that can just be load-time.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After the defvar bugfix in the previous commit, the only
differences between .tlo and .tlo2 files are the names of
a few gensyms here and there. In other words, they are
identical code; therefore, there is no point in compiling
them.
* Makefile (STDLIB_TLOS2): Variable removed.
(%.tlo2): Implicit rule removed.
(stage1 stage2): Phony targets removed.
(all): Directly depends on $(STDLIB_TLOS) without stage1
intermediary.
(clean-tlo): Don't remove $(STDLIB_TLOS2).
|
|
|
|
|
|
|
|
|
|
|
| |
The defvar/defparm macro expander marks symbols special only
at macro-expansion time, without actually generating code in
the macro expansion to do this. This means that the compiled
versions of defvar and defparm forms will code will neglect to
create a dynamically scoped variable!
* eval.c (me_def_variable): Add code to the output to mark the
symbol special, for defvar or defparm.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What happens if a FFI closure intercepts an exception, returns
to the foreign code, but that caller does not return to Lisp
where the exception will continue? Suppose the caller invokes
another closure. In that situation, the lingering value of
the s_exit_point variable causes problems for FFI calls.
An example of this is callbacks from an event dispatching
framework such as a GUI. When these callback closures return,
control returns to the event loop, which itself doesn't
immediately return to Lisp code. Rather, it processes more
events and invokes more callbacks.
* ffi.c (ffi_closure_dispatch_safe): One thing we can do
is clear s_exit_point whenever we dispatch a closure.
|
|
|
|
|
|
|
| |
* ffi.c (ffi_closure_dispatch_safe): When initially clearing
a return value that has release semantics, use the padded
size, not the nominal size. Let's get calculate this once and
put it in a local.
|
|
|
|
| |
* ffi.c (pad_retval): If the size is zero, don't pad it.
|
|
|
|
|
|
| |
* ffi.c (ffi_make_closure): Fix wrong argument defaulting on
safe_p_in parameter, which leaves it always true, preventing
unsafely dispatched closures from being created.
|
|
|
|
| |
* txr.1: Run-on period on identifier; extra words.
|
|
|
|
|
| |
* lisplib.c (ffi_set_entries): Add missinig autoload entry for
deffi-cb-unsafe.
|
|
|
|
|
|
|
| |
* ffi.c (make_zstruct): Don't convert zeros to a Lisp type and
don't try to set the slot, if the slot name is nil. That's a
padding slot which doesn't exist in the Lisp type; the slotset
will blow up on it.
|