| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (do_expand): A wrong thing is being done here:
the macro is extended using the original parameter
syntax, that has not been processed by expand_params.
The body is then expanded using that environment.
This subtly breaks support for parameter macros in tree-bind.
They work, but there are spurious warnings about undefined
variables during expansion, and the wrong scope handling
can introduce bugs. The right thing is to derive new_menv
by pulling the parameter symbols from params_ex.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (defset_instantiate, defset_set_entries): New
static functions.
(lisplib_init): Register auto-load of defset.tl, keyed on
defset symbol.
* share/txr/stdlib/defset.tl: New file.
* share/txr/stdlib/paramt.tl (param-parser-base opt-syms):
New method.
* txr.1: Documented.
|
|
|
|
|
|
| |
* txr.1: The hash function doesn't support a keyword
like :seed <n> to specify the hash seed. Adding an explanation
of why. Spoiler: security reason.
|
|
|
|
|
| |
* txr.1: Fold make-hash over two lines to avoid 80 col
overflow under man.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't want (fboundp '(lambda ...)) to be true, or
(symbol-function '(lambda ...)) to yield a function.
This also fixes funny print formatting of lambda
expressions.
* eval.c (lookup_fun): Do not recognize lambda expressions.
Also, return nil for unknown syntax; don't bother looking
it up in the hashes.
(do_eval): We now have to check for a lambda expression in the
car position to evaluate it; lookup_fun will no longer do
that.
(op_fun): The interpreted fun oprator must also check for
lambda itself.
(do_expand): A small code change is required here to avoid
spuriously warning about a lambda in the car position.
|
|
|
|
|
|
| |
* eval.c (fmakunbound, mmakunbound): Replace comma operator
with statement terminator, an unintentional stylistic
oddness. No behavior change.
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl: use load-for macro to
load the param module.
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_load_for): New function.
(rt_load_for): New static function.
(eval_init): Register load-for macro and sys:rt-load-for
intrinsic function.
* txr.1: Documented.
|
|
|
|
|
|
| |
* eval.c (usr_var_c): New symbol variable.
The existing var_s hold sys:var, not usr:var.
(eval_init): var symbol interned in usr package.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (struct_s): Now defined here.
(eval_init): struct now interned here.
* eval.h (struct_s): Declared.
* ffi.c (struct_s): Definition removed.
(ffi_init) struct no longer interned here.
|
|
|
|
|
| |
* parser.c (lino_getl, lino_gets): Return null pointer on EOF,
restoring original behavior that was broken by recent patches.
|
|
|
|
|
| |
* parser.c (lino_getl): Same fixes that were applied two weeks
ago to lino_gets in commit b76c5760. Always check for copy and paste!
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (compiler comp-fun): Recognize
a lambda expression argument. The neglect to do this is
causing a miscompilation of (fun (lambda ...)) to a single
getf instruction that processes raw syntax at run time and
yields an interpreted lambda.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (lambda-apply-transform):
Fix failure to bind the additional expresions to the rest
variable, causing a too many arguments error to be reported.
That is ((lambda (. x)) 1) would fail to compile.
When binding the trailing fixed arguments to rest, we also
pull in the apply list; this matches interpreted behavior,
for instance ((lambda (a . b) (list a b)) 1 2 . 3) must return
(1 (2 . 3)). In this case, the 3 comes into this function
as (3) via the apply-list-expr argument; if we don't include
that and bind only the remaining fix-args, then we get
the output (1 (2)).
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (compiler comp-fun-form): Fix
an instance of sym not being unquoted into the quasiquote
template, causing the compiler to compile a call to the
nonexistent function called sym.
|
|
|
|
|
|
|
|
|
|
| |
Some upcoming work is going to use these structures.
* share/txr/stdlib/compiler.tl (param-parser-base
fun-param-parser, mac-param-parser): These struct
definitions move to param.tl.
* share/txr/stdlib/param.tl: New file.
|
|
|
|
|
| |
* share/txr/stdlib/asm.tl (op-getlx dis, op-setlx dis): Decode
the small operand destination field correctly as such.
|
|
|
|
|
|
| |
* txr.1: Editing a buffer that has more lines than the
terminal can display sort of works but is is sub-par;
let's document this.
|
|
|
|
|
|
| |
* linenoise.c (LINENOISE_MAX_LINE): Change to 4096.
* txr.1: Updated.
|
|
|
|
|
| |
* txr.1: Add missing word in a sentence under The Update
Expander.
|
|
|
|
|
| |
* txr.1: In a few places, we are referring to sys:expand which
has been made public as usr:expand.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The optimized character insert case must handle the situation
of the cursor going off the edge of the screen when a
character is output in the last column in a manner that
is consistent with the regular insert, leaving the linenoise
structure in the same state that a full refresh would.
* linenoise/linenoise.c (refresh_multiline): In the optimized
character insert case indicated by need_refresh == 2, we
must add the check for the cursor being in the dead spot past
the edge of the screen, just like we do later in the function
for the regular refresh case. In that case we must advance the
cursor to the next line to get it out of the dead spot, and
adjust maxrows if necessary. We know we are in the dead spot
from the two rows values output by screen_rows. That function
puts out a nrow value that exceeds rows when that is the case.
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (move_cursor_multiline): If the npos
argument happens to be equal to the current position (the
operation is a null move), then no movement is generated. In
that case, no ab_append operation is called, and ab.b will
stay null; this null pointer then gets passed to
lino_os.puts_fn as the string to output, and that will blow
up. This situation hasn't actually been observed.
|
|
|
|
|
|
| |
* Makefile (dbg/%-win.o, opt/%-win.o): Don't pass
CONFIG_WIN_MAIN=1 preprocessor symbol; it's not referenced
anywhere, and never has been.
|
|
|
|
|
|
|
|
|
|
| |
The -- symbol is not interned in the usr package. This
means that the keyparams.tl code is interning the symbol --
in the sys package, and look for that as a delimiter.
Application code is interning its own -- symbol,
such as pub:-- and passing that.
* lisplib.c (keyparams_set_entries): Intern the -- symbol.
|
|
|
|
|
|
|
|
| |
* txr.1: Moving description of hash table sfrom under make-hash
function into an intro section under Hashing Library.
Revising some of the text on weak keys and values, adding
discussion of hash seed, and mentioning clearhash in the text
that discusses deletion of keys from a hash being traversed.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register bracket intrinsic.
* lib.c (bracket): New function.
* lib.h (bracket): Declared.
* txr.1: Documented.
|
|
|
|
|
| |
* ffi.c (ffi_type_common_mark): We must mark tft->tag field
whih is used by the cptr type and is otherwise nil.
|
|
|
|
|
|
|
|
| |
* ffi.c (make_ffi_type_enum): Allocate the sym_num an num_sym
hashes before the type object. That ensures they are older,
and may be assigned into the object without setcheck.
Also, move those assignments earlier, before the loop which
populates the hashes.
|
|
|
|
|
|
| |
* hash.c (clearhash): Assignment of new table into hash
requires setcheck, because it's putting a new object into an
old one.
|
|
|
|
|
|
| |
* hash.c (hash_grow): The new_table value is stored in
h->table twice. First directly and then via the set macro.
Let's just use setcheck, which avoids the intermediate loc object.
|
|
|
|
|
|
|
| |
* parser.c (parser_circ_def): When we lazily add the
circ_ref_hash to the parser, this is possibly a wrong-way
assignment (pointer to a baby object being stored
into a mature object). The handling for this is missing.
|
|
|
|
|
| |
* txr.1: If a platform has multiple path separator characters
and one of them is preferred, it appears first. Document this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (symbol_needs_prefix): revisiting the wrongheaded
requirements codified in 7bc150f, because the ergonomics
is bad. In a package that has a local symbol that has the
same name as one in a fallback list, that symbol is always
printed with a prefix, which is annoying. The new rules
are simple: if the symbol being printed is the one which is
visible, then it gets no package prefix. Also, this
function now handles the full responsibility for the prefix
calculation, including for keyword symbols and uninterned
symbools. It returns nil to indicate no prefix is needed, or
else a character string. Moreover, logic is added to detect
symbols which have a home package, but are uninterned from it,
which should be printed with the "#" prefix. Lastly, this
function is optimized to avoid unnecessary gethash operations.
If a symbol S's home package is P, and P contains no hidden
symbols (overwhelmingly common situation), then S is interned
in P; no need to do the hash lookup to check this.
(obj_print_impl): Symbol printing simplified: if
symbol_needs_refix returns non-nil, that string value is
the prefix.
|
|
|
|
|
|
|
| |
* hash.c (us_hash_count): New function. Blindly assumes that
the argument is a hash.
* hash.h (us_hash_count): Declared.
|
|
|
|
|
|
|
| |
* 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.
|