| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
debug.h, eval.c, eval.h, filter.c, filter.h, gc.c, gc.h, hash.c,
hash.h, lib.c, lib.h, match.c, match.h, parser.h, parser.l, parser.y,
rand.c, rand.h, regex.c, regex.h, signal.c, signal.h, stream.c,
stream.h, syslog.c, syslog.h, txr.c, txr.h, unwind.c, unwind.h,
utf8.c, utf8.h: Synchronize license header with LICENSE.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
eq_s, eql_s, equal_s): New symbol variables.
(me_case): New static function.
(eval_init): Initialize new variables. Register caseq, caseql and
casequal macros.
Re-register memq, memql, memqual, eq, eql and equal using
new symbol variables.
* txr.1: Document case, caseql and casequal.
|
|
|
|
|
|
|
|
|
| |
* lib.c (do_juxt): New static function.
(juxtv): New function.
* lib.h (juxtv): Declared.
* txr.1: Documented juxt.
|
|
|
|
|
|
|
|
|
| |
Use "/" name in error reporting, not "divi".
* eval.c (eval_init): Change registration of / so only
one argument is required out of two.
* txr.1: Document one-argument division.
|
|
|
|
|
|
|
|
|
|
|
| |
(eval_init): Register mapdo intrinsic.
* lib.c (mapdo): New function.
* lib.h (mapdo): Declared.
* txr.1: Documented mapdo. Documented zero-argument case
for mapcar, mapcar*, mappend and mappend*.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (get_string): New function.
* stream.h (get_string): Declared.
(stream_init): get_string registered as get-string intrinsic.
* txr.1: Documented get-string, and get-lines as a synonym for
lazy-stream-cons. Documented the behavioral difference of
lazy-stream-cons lazy lists for real-time and non-real-time streams.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
library so we can test for math functions.
* arith.c (log2_init): New static function.
(log2, logtwo): New functions.
(l2): New static variable.
(arith_init): Call log2_init.
* configure (lang_flags): Switching _XOPEN_SOURCE
from 500 to 600 to reveal log2.
Adding test for log2.
* eval.c (eval_init): Register log2 intrinsic.
* lib.h (logtwo): Declared.
* txr.1: Documented log2.
|
|
|
|
|
|
|
|
|
| |
* lib.c (lconsp, interpose): New functions.
(lazy_interpose_func, lazy_interpose): New static functions.
* lib.h (lconsp, interpose): Declared.
* txr.1: Documented lconsp and interpose.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (fbind_s, lbind_s, flet_s, labels_s): New symbol globals.
(env_fb_to_fb): New static function.
(lookup_mac): Implement the same shadow check for function macros
that is done for symbol macros, because we now have local functions
that can shadow local macros.
(fbindings_helper, op_fbind, make_fun_shadowing_env,
expand_fbind_vars, me_flet_labels): New static functions.
(expand): Add cases for fbind and lbind.
(eval_init): Intern the four new symbols.
Register sys:fbind and sys:lbind operators.
Register flet and labels macros.
* txr.1: Documented flet and labels.
|
| |
|
|
|
|
|
|
|
|
| |
the caller needs the return value, so the function
can avoid consing up a list that will be thrown away.
(op_let): Pass nil argument to new parameter of bindings_helper.
(op_each, op_for): Pass t to indicate that the return value
is needed.
|
|
|
|
|
|
|
|
|
|
|
|
| |
(me_ap, me_ip): Generate a much simpler macro-expansion:
a call to apf or ipf, rather than lambda syntax.
(me_ado, me_ido): New static functions.
(eval_init): Initialize apf_s and ipf_s variables.
Use them in the registration calls for apf and ipf.
Register ado and ido macros.
* txr.1: Streamlined documentation for ap and ip,
and added ado and ido.
|
|
|
|
| |
should be registered as variadic functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
such as obtained by the where function.
* lib.c (replace_list, replace_str, replace_vec): Allow the
from argument to be a list of index positions, possibly empty.
* txr.1: Condensed syntactic descriptions under dwim operator.
Range Indexing section no longer says that the value nil
can be used as either endpoint of a range. This will not
work any longer since a "from" value of nil looks like an
empty list of indexes. Documented new behavior under
replace, and shortened documentation for replace-list,
replace-str and replace-vec.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register bit as intrinsic.
* lib.h (bit): Declared.
* mpi-patches/add-bitops (mp_bit): New function.
* txr.1: Documented bit
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
(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.
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
(op_dwim, dwim_locs): Removing silly logic of separately calling
eval_lisp1 on the functor, and eval_lisp1_args on its arguments, since
lisp1 evaluation treats all position the same way.
|
|
|
|
|
|
|
|
|
|
|
|
| |
it to be the cell, rather than the new value.
* eval.c (transform_op): Fix use of rplacd that uses return value.
(force): Likewise.
* lib.c (rplaca, rplacd): Return cons.
(rem_lazy_rec, obj_init): Fix use of rplacd that uses return value.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* eval.c (call): New static function.
(eval_args, op_call): Static functions removed.
(eval_init): call_s registered as operator rather than function.
* txr.1: Updated.
|
|
|
|
| |
headers.
|
|
|
|
| |
colon symbol.
|
|
|
|
| |
equivalence comparison for end test, rather than eql.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GC. The issue being solved here is the accuracy of the gc_set function.
The existing impelmentation is too conservative. It has no generation
information about the memory location being stored, and so it assumes
the worst: that it is a location in the middle of a gen 1 object.
This is sub-optimal, creating unacceptable pressure against the
checkobj array and, worse, as a consequence causing unreachable gen 0
objects to be tenured into gen 1.
To solve this problem, we replace "val *" pointers with a structure
of type "loc" which keeps track of the object too, which lets us
discover the generation.
I tried another approach: using just a pointer with a bitfield
indicating the generation. This turned out to have a serious issue:
such a bitfield goes stale when the object is moved to a different
generation. The object holding the memory location is in gen 1, but the
annotated pointer still indicates gen 0. The gc_set function then
makes the wrong decision, and premature reclamation takes place.
* combi.c (perm_init_common, comb_gen_fun_common,
rcomb_gen_fun_common, rcomb_list_gen_fun): Update to new interfaces
for managing mutation.
* debug.c (debug): Update to new interfaces for managing mutation.
Avoid loc variable name.
* eval.c (env_fbind, env_fbind): Update to new interfaces
for managing mutation.
(lookup_var_l, dwim_loc): Return loc type and update to new interfaces.
(apply_frob_args, op_modplace, op_dohash, transform_op, mapcarv,
mappendv, repeat_infinite_func, repeat_times_func): Update to new
interfaces for managing mutation.
* eval.h (lookup_var_l): Declaration updated.
* filter.c (trie_add, trie_compress, trie_compress_intrinsic,
* build_filter, built_filter_from_list, filter_init): Update to new
* interfaces.
* gc.c (gc_set): Rewritten to use loc type which provides the exact
generation. We do not need the in_malloc_range hack any more, since
we have the backpointer to the object.
(gc_push): Take loc rather than raw pointer.
* gc.h (gc_set, gc_push): Declarations updated.
* hash.c (struct hash): The acons* functions use loc instead
of val * now.
(hash_equal_op, copy_hash, gethash_c, inhash, gethash_n, pushhash,
Change to how locations are passed around, for the sake of generational
GC. The issue being solved here is the accuracy of the gc_set function.
The existing impelmentation is too conservative. It has no generation
information about the memory location being stored, and so it assumes
the worst: that it is a location in the middle of a gen 1 object.
This is sub-optimal, creating unacceptable pressure against the
checkobj array and, worse, as a consequence causing unreachable gen 0
objects to be tenured into gen 1.
To solve this problem, we replace "val *" pointers with a structure
of type "loc" which keeps track of the object too, which lets us
discover the generation.
I tried another approach: using just a pointer with a bitfield
indicating the generation. This turned out to have a serious issue:
such a bitfield goes stale when the object is moved to a different
generation. The object holding the memory location is in gen 1, but the
annotated pointer still indicates gen 0. The gc_set function then
makes the wrong decision, and premature reclamation takes place.
* combi.c (perm_init_common, comb_gen_fun_common,
rcomb_gen_fun_common, rcomb_list_gen_fun): Update to new interfaces
for managing mutation.
* debug.c (debug): Update to new interfaces for managing mutation.
Avoid loc variable name.
* eval.c (env_fbind, env_fbind): Update to new interfaces
for managing mutation.
(lookup_var_l, dwim_loc): Return loc type and update to new interfaces.
(apply_frob_args, op_modplace, op_dohash, transform_op, mapcarv,
mappendv, repeat_infinite_func, repeat_times_func): Update to new
interfaces for managing mutation.
* eval.h (lookup_var_l): Declaration updated.
* filter.c (trie_add, trie_compress, trie_compress_intrinsic,
* build_filter, built_filter_from_list, filter_init): Update to new
* interfaces.
* gc.c (gc_set): Rewritten to use loc type which provides the exact
generation. We do not need the in_malloc_range hack any more, since
we have the backpointer to the object.
(gc_push): Take loc rather than raw pointer.
* gc.h (gc_set, gc_push): Declarations updated.
* hash.c (struct hash): The acons* functions use loc instead
of val * now.
(hash_equal_op, copy_hash, gethash_c, inhash, gethash_n, pushhash,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(eval_init): Register me_quasilist as quasilist macro expander.
* lib.c (quasilist_s): New global variable.
(obj_init): quasilist_s initialized.
* lib.h (quasilist_s): Declared.
* match.c (do_txreval): Handle quasilist syntax.
* parser.l (QWLIT): New exclusive state.
Extend lexical grammar to transition to QWLIT state upon
the #` or #*` sequence which kicks off a word literal,
and in that state, piecewise lexically analyze the QLL,
mostly by borrowing rules from quasiliterals.
* parser.y (QWORDS, QWSPLICE): New tokens.
(n_exprs): Integrate splicing form of QLL syntax.
(n_expr): Integrate non-splicing form of QLL syntax.
(litchars): Propagate line number info.
(quasilit): Fix "string literal" wording in error message.
* txr.1: Introduced WLL abbreviation for word list literals,
cleaned up the text a little, and documented QLL's.
|
|
|
|
|
| |
to macro-expand the embedded forms in a quasiliteral except
when they are the very first item.
|
|
|
|
|
|
|
|
| |
* lib.c (last): New function.
* lib.h (last): Declared.
* txr.1: Documented last.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (copy): Bugfix: handle lazy strings. Also, handle hash
tables via copy_hash.
(length): Bugifx: handle lazy strings. Also, handle hash tables
via hash_count.
(empty): New function.
* lib.h (empty): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
(me_unless, me_while, m_until): New static functions.
(eval_init): Register macros unless, while and until.
* txr.1: Document unless, while and until.
|
|
|
|
|
|
| |
(eval_init): Register "when" macro.
* txr.1: Documented when macro.
|
|
|
|
|
|
|
|
|
| |
* arith.h (tofloat, toint): Declared.
* eval.c (eval_init): tofloat and toint registered
as intrinsics.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* rand.c (make_random_state): Do argument defaulting on seed.
Also, mix getpid() into the seed.
(random_fixnum): Bugfix: do proper defaulting on optional
agument, rather than relying on nil.
(random): Fix 2014-02-05 regression. This was totally broken,
ignoring the random state passed in and using the global
random state. This function must only use the state passed in;
there is no defaulting to the global random state.
* txr.1: Documenting that seed is optional in make-random-state.
Describing what guarantees can be expected with regard to
calls made close together temporally.
|