| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
* arith.c, arith.h, combi.c, combi.h, debug.c, 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, rand.c, rand.h, regex.c, regex.h,
signal.c, signal.h, stream.c, stream.h, sysif.c, sysif.h, syslog.c,
syslog.h, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h:
Update.
* LICENSE, METALICENSE: Likewise.
|
|
|
|
|
| |
A one element list being converted to a string
treated as an empty list, leading to empty string.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
must return the empty string, not nil. Only
lists of non-characters fail to convert to a string.
Since programs may depend on the hitherto wrong,
undocumented behavior, this is made subject to
compatibility.
* txr.1: Added compatibility note.
|
|
|
|
|
|
| |
sequence may be an infinite list in the case that the from argument
specifies a list of indices. We must avoid trying to calculate its
length before we have detected this case.
|
|
|
|
|
|
|
|
|
|
| |
if get_line returns nil.
* stream.c (cat_get_line, cat_get_char, cat_get_byte): The catenated
stream read operations close an exhausted stream before popping
to the next one.
* txr.1: Document closing behavior of catenated streams.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
vi make_random_state.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (in): New function.
* lib.h (in): Declared.
* txr.1: Documented in.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
| |
so that a nil set element is handled properly.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
too early, before the loop which adjusts its value.
Restructuring this slightly to avoid duplicated code, by moving the
!first check later.
|
|
|
|
|
| |
Remove unessential variable last, and move the next variable
into loop scope.
|
|
|
|
|
|
| |
* lib.h (where): Declaration updated.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
then unless opt_compat is 100 or less, provide a more
consistent behavior, rather than splitting the string
into characters. This latter behavior was never documented.
* txr.1: Documented.
* dep.mk: Updated.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Fix cut and paste problem: type_mismatch argument expression
referring to the C function cons rather than the intended
object seq.
|
|
|
|
|
|
|
|
|
| |
* lib.c (do_chand): New static function.
(chandv): New function.
* lib.h (chandv): Declared.
* txr.1: Documented chand.
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register iff as requiring only one arg.
* lib.c (do_iff): Do not check thenfun for nil. Just call it.
(iff): Default thenfun to identity.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
| |
argument, resulting in : symbol being called as a function.
* txr.1: Removing description of situation when the then-function
argument of iff or iffi is specified as nil. This is deprecated
behavior which can be obtained by using the false function.
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the eval and stream modules.
* Makefile (OBJS): Add sysif.o.
* dep.mk: Regenerated.
* eval.c (errno_wrap, daemon_wrap, exit_wrap, usleep_wrap, getpid_wrap,
getppid_wrap, env_hash): Functions moved to sysif.c and changed
to static functions.
(eval_init): Registrations of functions moved to sysif.c.
* lib.c (init): Call sysif_init.
* stream.c (w_stat, statf, mkdir_wrap, chdir_wrap, getcwd_wrap,
makedev_wrap, minor_wrap, major_wrap, mknod_wrap): Functions
moved to sysif.c and become static functions.
(stream_init): Registration of stat moved to sysif.c.
(open_files, open_files_star): Bugfix: no longer erroneously included
in #ifdef HAVE_UNISTD_H block.
* stream.h (mkdir_wrap, chdir_wrap, getcwd_wrap, makedev_wrap,
minor_wrap, major_wrap, mknod_wrap, symlink_wrap, link_wrap,
readlink_wrap): Declarations removed.
* sysif.c: New file.
* sysif.h: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
relies on lazy_str_get_trailing_list and the behavior
of that function changed because (split-str "" any-separator)
changed from returning nil to returning the empty string.
The resulting behavior change of lazy_str_get_trailing_list was later
described in the documentation, thereby codifying it.
This patch changes the lazy_str_get_trailing_list behavior,
which is poor, and causes infinite looping. We do not want
an extra empty string prepended, because it looks like
a spurious line.
* lib.c (lazy_str_get_trailing_list): if split_str produces
a the list (""), then just return the unmaterialized list from
the lazy string without prepending that one-element list to it.
* txr.1: Updated documentation for lazy-str-get-trailing-list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
a function that returns t, as documented.
|
|
|
|
|
| |
lacking the semantics of returning the last value,
or the first true value, respectively.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(opt_gc_delta): New global variable.
(make_obj): Use opt_gc_delta rather than MALLOC_DELTA_THRESH.
(gc_set_delta, gc_wrap): New static functions.
(gc_late_init): New function.
* gc.h (gc_late_init): Declared.
* genvim.txr: scan gc.c also.
* lib.c (init): call gc_late_init.
* txr.1: Document new --gc-delta option and the functions
gc and gc-set-delta.
* txr.c (help): Help text for --gc-delta.
(txr_main): Parse --gc-delta option.
* txr.h (opt_gc_delta): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
*flo-min*, *flo-max*, *flo-epsilon*, *pi* and *e*.
* genvim.txr: Include arith.c in scan for symbols.
* lib.c (init): arith_init() must now be called after eval_init().
* txr.1: Documented new variables..
* txr.vim: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
low level C pointers, while we execute code that can cons memory.
* lib.c (list_str): Protect the str argument.
(int_str): Likewise.
* regex.c (search_regex): protect the haystack string,
while using the h pointer to its data, since regex_run
can use the derivative-based engine which conses.
* stream.c (vformat_str): Protect str argument, since
put_char might conceivably cons.
(vformat): Protect fmtstr.
|
|
|
|
|
|
|
|
| |
* 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.
|