| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.h (us_lcons_fun): New inline function.
(us_cons_bind): New macro.
* eval.c (lazy_mapcar_func, lazy_mapcarv_func, range_func,
range_star_func, generate_func, giterate_func, ginterate_func,
expand_right_fun, repeat_infinite_func, repeat_times_func,
pad_func): Use us_cons_bind, us_car, us_cdr, us_rplaca,
us_rplacd and us_lazy_cons_func, which skip the type check.
* lib.c (lazy_conses_func, lazy_appendv_func, rem_lazy_func,
lazy_flatten_func, lazy_flatcar_fund, tuples_func,
partition_by_func, partition_func, split_func,
split_star_func, partition_star_func, lazy_interpose_fun,
take_list_fun, take_while_list_fun, take_until_list_fun,
lazy_where_has_func): Likewise.
|
|
|
|
|
| |
* txr.1: Update the possibly misleading dialect note about
treatment of foo:bar in ANSI CL.
|
|
|
|
|
|
|
|
| |
* lib.c (lazy_where_func, lazy_where_hash_func): New static
functions.
(where): Rewritten to generate lazy list.
* txr.1: Doc updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On platforms that have the C99 fpclassify, we can use it to
banish infinity and NaN representations. If such a thing
arises, we throw an exception rather than producing an object
that prints as #<bad-float>.
* configure: add detection for fpclassify.
* lib.c (bad_float): New inline function and macro.
(flo): If the argument is other than zero, a normal
value or a subnormal, then throw an exception. We thereby
refuse to admit such objects into our numeric object
system.
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (out_of_range_float): New static function.
(grammar): Check for flo_str returning nil in several places;
that value is returned for out of range floats. This is not
documented!
* txr.1: Document athat flo-str returns nil for out-of-range
floats.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register seq-begin, seq-next and
seq-reset.
* lib.c (seq_iter_s): New symbol variable.
(seq_iter_mark): New static function.
(seq_iter_ops): New static structure.
(seq_begin, seq_next, seq_reset): New functions.
(obj_init): Intern seq-iter symbol, used as class name for
iterators.
* lib.h (seq_iter_s, seq_begin, seq_next, seq_reset):
Declared.
* txr.1: Documented.
|
|
|
|
|
|
| |
* txr.1: Document that floor, mod, floor-rem and other
functions in this family throw an exception if the
divisor is zero.
|
|
|
|
|
|
|
|
|
| |
* arith.c (expt): The function overhauled. Raising integers to
negative integers now works. Raising zero to a negative is
diagnosed as a division by zero for operands of all kinds.
* txr.1: Documentation updated for expt, and also division by
zero error is documented for the / function.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/defset.tl (defset-expander): Drop getform
argument. Obtain the arguments of the place in a variable
called args, which is then explicitly destructured with
tree-case to match the params list. Having all of the original
arguments in args, we can work backwards to replace some of
them with gensyms. The resulting gensym-ized list is used
to generate the access call to the operator named by name.
* txr.1: Update doc to get rid of get-form. Updated and
corrected the long form example.
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (struct_set_entries): Add missing entry for lnew
in the name array. This is not just a missing auto-load issue.
Because we don't intern the symbol, struct.tl ends up defining
a sys:lnew macro, and not usr:lnew. The symbol usr:lnew
doesn't exist and so when application code tries to use lnew,
it's trying to invoke pub:lnew.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/defset.tl (defset-expander): Check for
restpar being an atom and handle differently. We still don't
handle the case where (b . c) is matched against a rest
parameter; in this case the mapcar will process an improper
list. I.e. the improper form must have an atom which matches
the position of the rest parameter.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
| |
* defset.tl (defset-expander): Add logic to expand parameter
list to determine additional paramters that may come out of
the expansion, as well as additional symbols that may be
visible as a result as a result of processing in the expanded
body. These symbols are included in the same way as original
the original parameters.
* txr.1: Documented defset's support for parameter list macros.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|