| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* lib.h (cobj_ops_init): New macro.
* hash.c (hash_ops, hash_iter_ops): Initialize with cobj_ops_init.
* rand.c (random_state_ops): Likewise.
* regex.c (char_set_obj_ops, regex_obj_ops): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
(sign_extend): New function.
* eval.c (eval_init): Register sign-extend intrinsic.
* lib.h (sign_extend): Declared.
* txr.1: Documented sign-extend.
* tl.vim, txr.vim: Updated.
|
|
|
|
|
|
|
|
|
|
|
| |
the dup and flip intrinsics.
* lib.c (do_dup): New static function.
(dupl): New function.
* lib.h (dupl): Declared.
* txr.1: Documented dup and flip.
|
|
|
|
|
|
|
|
|
|
|
| |
(plusp, minusp): New functions.
* eval.c (eval_init): Register plusp and minusp.
* lib.h (plusp, minusp): Declared.
* txr.1: Documented plusp and minusp, and the
handling of characters by zerop.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
aligned, affecting OS X port.
* configure: Detect a SIZEOF_WCHAR_T when detecting integer
type that will hold a pointer. In the lit_align test,
if we are on Apple Mac OSX, use a lit_align of 2,
so the logic kicks in for padding literals and handling
misalignment.
* lib.h (litptr): Add a case for LIT_ALIGN < 4 and
SIZEOF_WCHAR_T == 4. In this case we do the arithmetic
on the pointer using short *, and then convert to
wchar_t.
* HACKING: New section 2.4.3 about new wchar_t hack.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (unique): New function.
(uniq): Becomes wrapper around unique.
* lib.h (unique): Declared.
* txr.1: Documented unique, and equivalence between uniq and unique.
* tl.vim, txr.vim: Regenerated.
|
|
|
|
| |
* lib.h (func_n1ov, func_n2ov, func_n3ov): Declared.
|
|
|
|
| |
* lib.h (func_n0o): Declaration removed.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (in): New function.
* lib.h (in): Declared.
* txr.1: Documented in.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (lequal, gequal, lequalv, gequalv): New functions.
* lib.h (lequal, gequal, lequalv, gequalv): Declared.
* txr.1: Documented lequal and gequal.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
the lessv and greaterv functions instead of less and greater.
* lib.c (lessv, greaterv): New functions.
* lib.h (lessv, greaterv): Declared.
* txr.1: Document variadic nature of less and greater.
|
|
|
|
|
|
|
|
| |
* lib.c (sort_group): New function.
* lib.h (sort_group): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Registered wrap and wrap* intrinsics.
* lib.h (wrap_star, wrap): Declared.
* txr.1: wrap and wrap* documented.
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register new functions as intrinsics.
* lib.h (succ, ssucc, sssucc, pred, ppred, pppred): Declared.
* txr.1: Documented.
|
|
|
|
|
|
| |
* lib.h (where): Declaration updated.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
for generic semantics.
* lib.h (max2, min2): Parameter names changed to avoid suggesting
that the operands are numbers.
* txr.1: Documentation for min and max updated.
|
|
|
|
|
|
|
|
|
| |
* lib.c (do_chand): New static function.
(chandv): New function.
* lib.h (chandv): Declared.
* txr.1: Documented chand.
|
|
|
|
|
|
|
|
|
| |
(string_extend): Use chk_grow_vec.
(vec_set_length): Avoid subtractions for comparing numbers.
* lib.h (chk_grow_vec): Declared.
* stream.c (snarf_line, string_out_put_string): Use chk_grow_vec.
|
|
|
|
|
|
|
| |
(throw_mismatch): New function.
* lib.h (throw_mismatch): Declared.
(type_mismatch): Declaration turned into inline function.
|
|
|
|
|
|
|
|
|
|
| |
(GREP_CHECK): New macro.
(enforce): Rewritten using GREP_CHECK, with new checks.
* arith.c, combi.c, debug.c, eval.c, filter.c, gc.c, hash.c, lib.c,
* lib.h, match.c, parser.l, parser.y, rand.c, regex.c, signal.c,
* signal.h, stream.c, syslog.c, txr.c, unwind.c, utf8.c: Remove
trailing spaces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (do_not): New static function.
(notf): New function.
* lib.h (notf): Declared.
* txr.1: Documented notf.
* share/txr/stdlib/txr-case.txr (bindable): Eliminated.
(txr-if): Use functional expression, taking advantage of notf.
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to C++ style casts when compiling as C++.
* lib.h (strip_qual, convert, coerce): New casting macros.
(TAG_MASK, tag, type, wli_noex, auto_str, static_str,
litptr, num_fast, chr, lit_noex, nil, nao): Use cast macros.
* arith.c (mul, isqrt_fixnum, bit): Use cast macros.
* configure (INT_PTR_MAX): Define using cast macro.
* debug.c (debug_init): Use cast macro.
* eval.c (do_eval, expand_macro, reg_op, reg_mac, eval_init):
Use cast macros.
* filter.c (filter_init): Use cast macro.
* gc.c (more, mark_obj, in_heap, mark, sweep_one, unmark): Use
cast macros.
* hash.c (hash_double, equal_hash, eql_hash, hash_equal_op,
hash_hash_op, hash_print_op, hash_mark, make_hash, make_similar_hash,
copy_hash, gethash_c, gethash, gethash_f, gethash_n, remhash,
hash_count, get_hash_userdata, set_hash_userdata, hash_iter_destroy,
hash_iter_mark, hash_begin, hash_uni, hash_diff, hash_isec): Use
cast macros.
* lib.c (code2type, chk_malloc, chk_malloc_gc_more, chk_calloc,
chk_realloc, chk_strdup, num, c_num, string, mkstring, mkustring,
upcase_str, downcase_str, string_extend, sub_str, cat_str, trim_str,
c_chr, vector, vec_set_length, copy_vec, sub_vec, cat_vec,
cobj_print_op, obj_init): Likewise.
* match.c (do_match_line, hv_trampoline, match_files, dir_tables_init):
Likewise.
* parser.l (grammar): Likewise.
* parser.y (parse): Likewise.
* rand.c (make_state, make_random_state, random_fixnum, random):
Likewise.
* regex.c (CHAR_SET_L2_LO, CHAR_SET_L2_HI, CHAR_SET_L1_LO,
CHAR_SET_L1_HI, CHAR_SET_L0_LO, CHAR_SET_L0_HI, L0_full, L0_fill_range,
L1_full, L1_fill_range, L1_contains, L1_free, L2_full, L2_fill_range,
L2_contains, L2_free, L3_fill_range, L3_contains, L3_free,
char_set_create, char_set_cobj_destroy, nfa_state_accept,
nfa_state_empty, nfa_state_single, nfa_state_wild, nfa_state_set,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (cobj_print_op): In the format call, cast
the C pointer to val, since the ~p conversion now
takes a val rather than void *.
(cptr_equal_op, obj_print, obj_pprint): Remove cast to
void *, since obj now already has the type that ~p expects.
* lib.h (struct any): Use mem_t * instead of void *.
* parser.h (yyscan_t): Repeat the definition from inside
the Flex-generated lex.yy.c.
(yylex_init, yylex_destroy, yyget_extra, yyset_extra): Re-declare
using yyscan_t typedef in place of void *.
* parser.l (yyget_column, yyerrprepf): Re-declare using yyscan_t.
(grammar): Use yyg in place of yyscanner in calls to yyerrprepf.
* parser.y (yylex, %lex-param): Use yyscan_t instead of void *.
(parse): Use yyscan_t for local variable.
* signal.c (stack): Change type from void * to mem_t *.
* stream.c (vformat): Conversion specifier p extracts val
instead of void *.
(run): Use casts that only remove const, not all the way to void *.
* txr.1: Documented p conversion specifier of format.
* Makefile (OBJS-y): Initialize with := to make sure it is a
simple variable, and not a macro.
(SRCS): New variable, listing source files.
(enforce): New rule for enforcing coding conventions.
Currently checks for void * occurrences.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
zero, return the other operand.
(lcm): New function.
* eval.c (eval_init): Retarget registration of gcd to
variable argument gcdv function. Register lcm.
* lib.c (gcdv, lcmv): New functions.
* lib.h (gcdv, lcm, lcmv): Declared.
* txr.1: Re-document gcd with coverage of lcm.
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (gt_f, lt_f): Global variables removed.
(greater_f): New variable.
(greater): New function.
(find_max, pos_max): Use greater_f as default for testfun,
rather than gt_f.
(find_min, pos_min): Use less_f as default for testfun,
rather than lt_f.
(obj_init): Remove references to gt_f and lt_f.
GC-protect and initialize greater_f.
* lib.h (greater_f): Declared.
(gt_f, lt_f): Declarations removed.
* txr.1: Documented greater, and use of less and greater
in pos-min, pos-max, find-min and find-max.
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(eval_init): Register less as intrinsic. Retarget merge intrinsic to
merge_wrap for proper argument defaulting which is missing from merge,
and which we don't want to introduce there since internal calls
to merge don't erquire it. Change registration of sort so it has
only one required argument, not two.
* lib.c (less_f): New global variable.
(less_tab): New static array.
(less_tab_init): New static function.
(less): New function.
(sort): Default lessfun argument to the less function.
(obj_init): GC-protect the less_f variable.
Initialize it with a function object made from the less function.
(init): Call less_tab_init.
* lib.h (enum type): New enumeration member MAX_TYPE, an alias
for the largest type.
(less_f, less): Declared.
* txr.1: Documented new less function, and that the lessfun
argument in sort and merge is optional, defaulting to less.
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
intrinsics.
* lib.c (chr_isblank, chr_isunisp): New functions.
* lib.h (chr_isblank, chr_isunisp): Declared.
* regex.h (spaces): Declaration for existing variable added.
* txr.1: Documented chr-isblank and chr-isunisp.
* genvim.txr: Add missing sysif.c.
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rather than the list-based notation for derivative-based
regexes, and an encapsulated COBJ for NFA-based regexes.
* lib.c (compiled_regex_s): Variable removed.
(obj_init): Initialization of compiled_regex_s removed.
* lib.h (compiled_regex_s): Declaration removed.
* regex.c (struct regex, regex_t): New type.
(regex_destroy): Object is now a regex_t, not nfa_t.
(regex_mark): New function.
(regex_obj_ops): Register regex_mark operation.
(reg_nullable, reg_derivative): Remove cases that handles
compiled_regex_s.
(regex_compile): Output of dv_compile_regex becomes
a cobj nwo. Output of nfa_compile_regex must be
embedded in regex_t structure.
(regexp): Drop the check for compiles_regex_s.
(regex_nfa): Function removed.
(regex_run, regex_machine_init): Use cobj_handle to retrieve regex_t *
pointer and dispatch appropriate code based on regex->kind.
|
|
|
|
|
|
|
|
|
| |
Returns minimum supported emulation.
* lib.h (compat_fixup): Declaration fixed.
* txr.c (compat): Replace hard-coded min version
by return value of compat_fixup.
|
|
|
|
|
|
|
|
|
| |
* lib.c (partition_star_func): New static function.
(partition_star): New function.
* lib.h (partition_star): Declared.
* txr.1: Documented partition*.
|
|
|
|
|
|
|
|
|
| |
* lib.c (partition_func): New static function.
(partition): New function.
* lib.h (partition): Declared.
* txr.1: Documented partition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(obj_init): Change exception symbol names with underscores
to use friendly dashes instead.
(compat_fixup): New function.
* lib.h (compat_fixup): Declared.
* txr.1: Change occurrences of exception symbols from
underscores to dashes.
* txr.c (txr_main): Call compat_fixup when -C option
is processed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to account for new parameter.
* lib.c (syntax_error_s): New symbol_variable.
(obj_init): New symbol variable initialized.
* lib.h (syntax_error_s): Declared.
* parser.h (lisp_parse): Declaration updated.
* parser.l (lisp_parse): Takes third parameter.
* txr.1: Third parameter of read described.
* txr.c (txr_main): Pass colon_k to third parameter of lisp_parse
to obtain exception throwing behavior.
* unwind.c (uw_init): Register syntax-error as subtype of error.
|
|
|
|
|
|
|
|
| |
* lib.c (uniq): New function.
* lib.h (uniq): Declared.
* txr.1: Documented uniq.
|
|
|
|
|
|
|
|
| |
* lib.c (nconcv): New function.
* lib.h (nconcv): Declared.
* txr.1: Documented nconc.
|
|
|
|
|
|
|
|
|
| |
* lib.c (partition_by_func): New static function.
(partition_by): New function.
* lib.h (partition_by): Declared.
* txr.1: Documented partition-by.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
* lib.c (do_juxt): New static function.
(juxtv): New function.
* lib.h (juxtv): Declared.
* txr.1: Documented juxt.
|
|
|
|
|
|
|
|
|
|
|
| |
(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*.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 (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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|