| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register bit as intrinsic.
* lib.h (bit): Declared.
* mpi-patches/add-bitops (mp_bit): New function.
* txr.1: Documented bit
|
|
|
|
|
|
|
| |
leaks caused by wrongly initializing the temporary destination operand
for mp2_comp with a size, which mp2_comp then clobbers by doing the same
thing. Also plug memory leaks that happen in in out-of-memory return
case.
|
|
|
|
| |
* txr.1: document hash support for select and where.
|
|
|
|
|
|
|
|
|
|
|
|
| |
manipulate argument lists.
* eval.c (apply_frob_args): Rewrite to non-destructive
one-pass version.
(iapply): Likewise.
* lib.c (term): New function.
* lib.h (term): Declared.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when bit field operands are negative, affecting logand, logor, logxor,
lognot, logtrunc, logtest and ash. In addition, logtest was found to
return the logical inverse of its correct value.
* arith.c (logtest): Fix broken boolean polarity
of return value.
* mpi-patches/add-bitops (mp_2comp): Fix incorrect
treatment of negative values.
(mp_and): Fix incorrectly ordered statements, which
cause failure when operands are negative.
|
|
|
|
|
|
|
|
|
|
| |
(iapply, me_ip): new static functions.
(do_apf): Bugfix: use apply_intrinsic, not apply.
(do_ipf, ipf): New static functions.
(eval_init): initialize iapply_s. register me_ip macro
expander, and the iapply and ipf functions.
* txr.1: Documented iapply, ipf and ip.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as intrinsics.
* lib.c (tok_where): New function.
* lib.h (tok_where): Declared.
* regex.c (range_regex): New function.
* regex.h (range_regex): Declared.
* txr.1: Documented tok-where and range-regex.
|
|
|
|
| |
trying to print cons function pointer as value.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a non-list sequence.
(eval_init): Register transpose and zip as intrinsics.
* lib.c (curry_12_1_v): New static function.
(transpose, mapcar_listout): New functions.
(mapcar): Redefined in terms of mapcar_listout.
* lib.h (transpose, mapcar_listout): Declared.
* txr.1: Documented transpose and zip.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
quasilierals: i.e. the forms X and Y in `@{X}`
and `@{X Y}`, where X and Y can be Lisp symbol macros or compound
forms that is a macro call.
* eval.c (expand_quasi): Handle the var forms in a quasi.
* parser.y (n_exprs_opt, q_var): New grammar nonterminals.
q_var is a clone of o_var, but with different construction behavior.
It fixes the bug that o_var applies expand_meta to embedded
Lisp forms, which is not appropriate for TXR Lisp quasiliterals.
(quasi_item): Derive q_var rather than o_var.
|
|
|
|
|
|
|
|
|
|
|
| |
collecting loops.
* lib.c (tuples_func, where, sel): Catch return value of
list_collect and update tail variable.
* match.c (do_txeval): Likewise.
* parser.y (expand_meta): Likewise for list_collect_nconc.
|
|
|
|
|
|
| |
(eval_init): Register apf as intrinsic.
* txr.1: Document apf.
|
|
|
|
|
|
|
| |
* eval.c (eval_error): Use last_form_evaled if form is null.
(apply): Substitute apply symbol if ctx_form is null.
(apply_intrinsic): Do not pass fake (apply) context form to
apply, just pass nil.
|
|
|
|
|
|
|
|
|
| |
(me_ret, tf, nilf, do_retf, retf): New static functions.
(eval_init): Initialize identity_s, and use it for registration
of identity. Register ret macro, and the retf, tf and nilf
functions.
* txr.1: Documentation for ret, retf, tf and nilf.
|
|
|
|
|
|
|
|
|
|
| |
and intended design.
* eval.c (do_eval): When calling do_eval_args to evaluate
the arguments of a compound form that is a function call,
do not pass down the lookup function, but substitute &lookup_var.
Passing down the lookup function means tha all evaluation
enclosed in (dwim ...) or [...] follows the Lisp-1 style.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(eval_init): Use new list_f instead of func_n0v(identity).
Register multi as intrinsic. Register me_ap as ap macro.
* lib.c (list_f): New global variable.
(multi): New function.
(multi_sort): Use list_f in place of func_n0v(identity).
(obj_init): gc-protect and initialize list_f.
* lib.h (list_f, multi): Declared.
* txr.1: Documented multi and ap.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (member, member_if): New functions.
* lib.h (member, member_if): Declared.
* txr.1: Documented.
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
| |
Removed dubious statement which clamps nargs to the number
of fixed parameters, breaking variadic calls.
Test case: (mapcar 'list '(1 2)) -> ((1) (2))
Note: generic_funcall is only used when non-function objects
are used as functions; variadic funcalls were not broken.
|
| |
|
|
|
|
|
|
|
|
| |
(eval_init): Use null_f in existing registration of null
and not. Add registration for not_null as "true",
and for null_f as "false".
* txr.1: Documented true and false.
|
|
|
|
|
|
|
|
|
| |
* lib.c (tuples_func): New static function.
(tuples): New function.
* lib.h (tuples): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clean up code which chooses rendering for characters.
Print C0 and C1 control characters, as well as D800-DFFF,
FFFE and FFFF and characters above FFFF using hex;
others are printed using the #\<char> notation.
* parser.y (char_from_name): map "pnul" to DC00.
* txr.1: Documented pnul, clarified character
printing rules, and added a cautionary note about
possible ambiguity in printing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
find_min and seqp as intrinsics.
* lib.c (gt_f, lt_f): New variables.
(to_seq): renamed to toseq.
(seqp): New function.
(minmax): New static function.
(replace_str, replace_vec): Follow to_seq renaming.
(find_max, find_min, pos_max, pos_min): New functions.
(obj_init): gc-protect and initialize gt_f and lt_f.
* lib.h (gt_f, lt_f): Declared.
(to_seq): Declaration updated to toseq.
(seqp, find_max, find_min, pos_max, pos_min): Declared.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
where and select.
* lib.c (generic_funcall): Support a sequence as an argument
to a sequence.
(where, sel): New functions.
* lib.h (where, sel): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
omitted. This was broken in version 89, by the
2014-04-08 commit.
* eval.c (rangev_func, range_star_v_func): Only perform
numeric tests between from and to if to is not nil.
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (do_txeval): If a variable is not in the bindings, fall
back on treating it as a TXR Lisp dynamic variable. This allows
us to refer to the stdlib variable from a quasistring in a
@(load ...) directive.
* txr.c (sysroot_init): Register new variable, *txr-version*.
* share/txr/stdlib/ver.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
checking for leading slash.
* stream.c (abs_path_p): New function.
(stream_init): Register abs_path_p as abs-path-p.
* stream.h (abs_path_p): Declared.
* txr.1: Documented abs-path-p.
* dep.mk: Updated.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
line.
(PREINSTALL): New variable holding a step for the install recipe.
(pax tar zip): New targets.
* configure (txr_ver): Version now added to config.make, passed
through to txr.c.
(gen_config_make): bindir, datadir and mandir are established
using gmake's regular macro assignment (=) rather than
expanding assignment (:=). This allows us to override the
prefix variable after configure time.
* lib.h (wli_noex): New macro.
(wli): Retarget to wli_noex, so that argument is subject
to macro replacement.
* txr.c (version): Use TXR_VER defined on compiler command line,
rather than hard-coded string literal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to cmp_str. Add registrations for str_eq, str_lt,
str_gt, str_le, and str_lt.
* lib.c (string_cmp): Name changes to cmp_str, and the
function fixed so that it actually works.
The name change doesn't affect anyone because the function
was too broken to use due to the incorrect type dispatch.
(string_lt): Name changes to str_lt.
(str_eq, str_gt, str_le, str_ge): New functions.
* lib.h (string_cmp, string_lt): Declarations renamed.
(str_eq, str_gt, str_le, str_ge): New declarations.
* txr.1: Document string-cmp to cmp-str rename, that
string-lt is deprecated, and the new str<, str>,
str>=, str<= and str= functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (PROG): Removing ./ prefix from variable name; adding it
to invocations of $(PROG) in some rules.
(txr.o): Pass several strings as macros on the command line:
TXR_REL_PATH, EXE_SUFF and PROG_NAME.
* configure (bindir, datadir, mandir): These variables become
just relative paths from the prefix.
* txr.c (sysroot): Use the TXR_REL_PATH, EXE_SUFF and PROG_NAME
preprocessor symbols defined on the command line to avoid
hard-coding strings like "bin/txr" and "bin/txr.exe" which
actually should reflect the value of the bindir variable.
|
|
|
|
|
|
| |
Add missing parentheses in expression.
(sysroot_init): On Windows, filter progpath to change
backslashes to forward slashes.
|
|
|
|
| |
in old flexes too.
|
|
|
|
|
|
|
|
|
| |
the path based on the "sysroot" where it is actually installed.
* txr.c (progname_8u, progpath): New static variables.
(get_self_path, sysroot_helper, sysroot, sysroot_init): New
static functions. Sysroot creates a stdlib variable.
(main): Initialize progname_u8 value, and call sysroot_init.
|
|
|
|
|
|
| |
start argument.
* txr.1: Documented.
|
|
|
|
|
| |
bindings, and need the -B option. One test case does not
need the -l option which now implies -B.
|
|
|
|
|
|
| |
Also, put in missing check for -f being erroneously clumped.
* txr.1: Documented.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
be explicitly requested by the -B option.
* match.c (opt_nobindings): Variable removed.
(opt_print_bindings): New variable.
(extract): Print bindings or "false" if opt_print_bindings is true.
* stream.c (output_produced): Variable removed.
(stdio_put_string, stdio_put_char, stdio_put_byte): Remove
update of output_produced.
* stream.h (output_produced): Declaration removed.
* txr.1: Documentation updated.
* txr.c (txr_main): Option 'b' does nothing. 'B', 'l', 'a',
and '--lisp-bindings' set opt_print_bindings to 1.
* txr.h (opt_nobindings): Declaration removed.
(opt_print_bindings): Declared.
* unwind.c (uw_throw): When exiting due to a query error or
file error, print false when opt_print_bindings is true.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
namely that empty strings and vectors are not nil.
The nullify function is introduced. It is also exposed to
users, as is the existing make_like function.
* eval.c (mapcarv, mappendv, lazy_mapcar, lazy_mapcarv):
Use nullify to handle non-list inputs correctly.
(eval_init): Registering make_like and nullify as intrinsics.
* lib.c (copy_list, to_seq, list_collect_nconc, list_collect_append,
reverse, lazy_appendv_func, lazy_appendv, ldiff, memq, memql,
memqual, remq, remql, remqual, remove_if, keep_if, rem_lazy_rec,
remq_lazy, remql_lazy, remqual_lazy, remove_if_lazy, keep_if_lazy,
countqual, countql, countq, count_if, some_satisfy, all_satisfy,
none_satisfy, do_chain, chainv, do_and, andv, do_or, orv,
cat_vec, assoc, assql, mapcar, mapcon, mappend, sort, multi_sort,
find, find_if, posqual, posql, posq, pos, pos_if, set_diff,
search): Use nullify for correctness. Some functions fixed
so return sequence matches type of input sequence.
(nullify): New function.
* lib.h (nullify): Declared.
* txr.1: Documented nullify and ake-like.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (search_list): New static function.
(search): New function.
* lib.h (search): New function declared.
* txr.1: Documented.
* txr.vim: Regenerated.
|
| |
|
|
|
|
|
|
| |
catch backslashes occurring within a regex, not followed by a
character. This can happen in dynamically parsed regexes
such as "abc\\".
|
|
|
|
|
| |
numbers if they are defined. In a newer flex, they are prefixed
by YY_.
|
|
|
|
|
|
|
|
|
|
|
|
| |
from lang_flags. Adding a test for determining
which flag reveals BSD functions. This is due to the
braindamaged way feature selection macros work on
FreeBSD. There is no way to say "give me only the
functions from a certain version of the Unix spec,
plus traditional BSD functions", so we have to resort to
using the internal symbol __BSD_VISIBLE. Also, changing
the detection test for daemon function to the
pointer-based approach.
|
|
|
|
| |
This is subsumed by -D_XOPEN_SOURCE=500.
|
| |
|