summaryrefslogtreecommitdiffstats
path: root/lib.h
Commit message (Collapse)AuthorAgeFilesLines
* Introduce chk_wmalloc function.Kaz Kylheku2015-09-221-0/+1
| | | | | | | | | | | | | | | Two-fold benefit. Simplifies code which allocates wchar_t arrays. Provides overflow check for the multiplication. * lib.c (chk_wmalloc): New function. (chk_strdup, mkstring, mkustring, upcase_str, downcase_str, sub_str, cat_str, trim_str): Use chk_wmalloc. * lib.h (chk_wmalloc): Declared. * stream.c (make_string_output_stream): Use chk_wmalloc. * utf8.c (utf8_dup_from_uc, utf8_dup_from): Likewise.
* Adding flatcar* function.Kaz Kylheku2015-09-191-0/+1
| | | | | | | | | | | | * eval.c (eval_init): Registered flatcar* intrinsic. * lib.c (lazy_flatcar_scan, lazy_flatcar_func): New static functions. (lazy_flatcar): New function. * lib.h (lazy_flatcar): Declared. * txr.1: Documented, also touching flatten documentation.
* New function: flatcar.Kaz Kylheku2015-09-181-0/+1
| | | | | | | | | | * eval.c (eval_init): Register flatcar intrinsic. * lib.c (flatcar): New function. * lib.h (flatcar): Declared. * txr.1: Documented.
* New functions, subtypep and typep.Kaz Kylheku2015-09-081-0/+3
| | | | | | | | | | | | | | | | * eval.c (eval_init): Register subtypep and typep. * eval.h (list_s): Existing variable declared. * lib.c (atom_s, integer_s, number_s, sequence_s, string_s): new symbol variables. (subtypep, typep): New functions. (obj_init): Initialize new symbol variables. * lib.c (atom_s, integer_s, number_s, sequence_s, string_s): Declared. * txr.1: Documented type hierarchy and the new functions.
* linenoise: use checked allocator for strdup.Kaz Kylheku2015-09-061-0/+1
| | | | | | | | | | * lib.c (chk_strdup_utf8): New function. * lib.h (chk_strdup_utf8): Declared. * linenoise/linenoise.c (chk_strdup_utf8): Declared. (edit_history_next, linenoise, lino_hist_add): Use chk_strdup_utf8 instead of strdup.
* linenoise completion for txr symbolsKaz Kylheku2015-09-051-0/+3
| | | | | | | | | | | | | | | Implement basic tab completion. * lib.c (package_alist, package_name, package_symbols): New functions. * lib.h (package_alist, package_name, package_symbols): Declared. * parser.c (find_matching_syms, provide_completions): New static functions. (repl): Register provide_completions as completion callback with linenoise.
* Syntax errors refer to REPL line number.Kaz Kylheku2015-09-051-0/+1
| | | | | | | | | | | | | | | | | | * eval.c (eval_init): Registrations of lisp-parse and read must account for new optional argument. * lib.c (func_n5o): New function. * lib.h (func_n5o): Declared. * parser.c (lisp_parse): New argument for passing in line number. This is punched into the parser object. (read_eval_stream): Call to lisp_parse defaults new argument. (repl): Pass repl line number to lisp_parse. * parser.h (lisp_parse): Declaration updated. * txr.c (txr_main): Call to lisp_parse defaults new argument.
* No need to point the compiler into the mpi directory.Kaz Kylheku2015-09-041-1/+1
| | | | | | * Makefile (CFLAGS): Remove -iquote $(top_srcdir)mpi * lib.h: include "mpi/mpi.h" instead of "mpi.h".
* Time structure.Kaz Kylheku2015-08-311-0/+2
| | | | | | | | | | | | | * eval.c (eval_init): Register time-struct-local and time-struct-utc intrinsic funtions. * lib.c (time_s, year_s, month_s, day_s, hour_s, min_s, sec_s): New global symbol variables. (broken_time_struct, time_init): New static functions. (time_struct_local, time_struct_utc): New functions. (init): Call time_init. * lib.h (time_struct_local, time_struct_utc): Declared.
* struct: 4-way set associative slot caches.Kaz Kylheku2015-08-301-3/+7
| | | | | | | | | | | * lib.h (SLOT_CACHE_SIZE): Adjust value from 32 to 8. (slot_cache_entry_t): New struct typedef. (slot_cache_line_t): Typedef updated: a cache line consists of cache line entry structs rather than cnums. * struct.c (cacheline_lookup, cacheline_insert): New static functions. (lookup_slot): Use cacheline_lookup and cacheline_insert.
* Introducing structs.Kaz Kylheku2015-09-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * args.c (args_cat_zap): New function. * args.h: (args_cat_zap): Declared. * eval.c (struct_lit_s): New symbol variable. (eval_init): Initialize struct_lit_s. * eval.h (struct_lit_s): Declared. * gc.c (finalize): If a symbol has a struct slot hash attached to it, we must free it when the symbol is reclaimed. * lib.c (make_sym): Initialize symbol's slot_cache pointer to null. (copy): Copy structure objects. (init): Call struct_init to initialize struct module. * lib.h (SLOT_CACHE_SIZE): New preprocessor symbol (slot_cache_line_t, slot_cache_t): New typedefs. (struct sym): New member, slot_cache. * lisplib.c (struct_set_entries, struct_instantiate): New static functions. (liplib_init): Register new functions in dl_table. parser.y (HASH_S): New terminal symbol. (struct): New grammar rule. (n_expr): Derive struct. (yybadtoken): Map HASH_S to #S string. parser.l (grammar): Recognize #S and return HASH_S token. share/txr/stdlib/place.tl (slot): New defplace. share/txr/stdlib/struct.tl: New file. struct.c: New file. struct.h: New file. * Makefile (OBJS): Adding struct.o.
* Renaming c_true to tnil.Kaz Kylheku2015-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | Macros called c_* should produce C counterparts of Lisp val objects, like c_num and c_str. * lib.h (c_true): Renamed to tnil. * eval.c (lexical_var_p, lexical_fun_p): c_true to tnil. * lib.c (less, chr_isalnum, chr_isalnum, chr_isalpha, chr_isascii, chr_iscntrl, chr_isdigit, chr_isgraph, chr_islower, chr_isprint, chr_ispunct, chr_isspace, chr_isblank, chr_isunisp, chr_isupper, chr_isxdigit, chr_toupper, keywordp): Likewise. * stream.c (catenated_stream_p): Likewise. * sysif.c (wifexited, wifsignaled, wcoredump, wifstopped, wifcontinued): Likewise.
* New function: shuffle.Kaz Kylheku2015-08-241-0/+1
| | | | | | | | * eval.c (eval_init): Register shuffle as intrinsic. * lib.c (shuffle): New function. * lib.h (shuffle): Declared.
* Large scale conversion to new way of handling arguments.Kaz Kylheku2015-08-231-62/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function arguments are now allocated on the stack using alloca, in conjunction with the struct alloc header structure. The generic_funcall and apply functions are refactored for this, as are most functions that take variadic arguments. * args.c (args_add_list, args_cons_list): Functions removed. (args_normalize, args_normalize_fill): New functions. (args_get_checked): Draw arguments from list when array runs out. (args_copy, args_copy_zap): New functions. * args.h (ARGS_MAX): Reduced to 32. (ARGS_MIN): New preprocessor symbol. (args_init): Call args_init_list. (args_add2, args_add3, args_add4): New inline functions. (args_more): Take into account list, which may hold additional arguments. (args_two_more): New inline function. (args_normalize, args_normalize_fill): Declared. (args_get_list): Normalize all arguments into one list and return it. (args_get_rest, args_at, args_atz): New inline functions. (args_get): Draw arguments from list when array runs out. (args_clear): New inline function. * arith.c (maskv): Convert to new args. * eval.c (APPLY_ARGS): Preprocessor symbol removed. (bind_args): Converted to accept struct args. (apply): Function reduced down to trivial adapter which converts a list of arguments to args, and calls the new generic_funcall. (applyv): New static function: struct args wrapper around apply_intrinsic. (iapply): Converted to struct args. (call): Static function removed. The call intrinsic function binding now goes directly to generic_funcall. (list_star_intrinsic, interp_fun): Converted to struct args. (op_catch): Adjustments for bind_args, which requires a struct args arglist. (me_op): Must use the new minl and maxl, since minv and maxv don't take lists any more. (mapcarv, mappendv, lazy_mapcarv, lazy_mappendv, mapdov, weavev, or_fun, and_fun, tf, nilf, do_retf, do_apf, do_ipf, callf, do_mapf, mapf): Converted. (mapcarl): New function, like the old mapcarv. (eval_init): call_f initialized from generic_funcall rather than call. apply registered to applyv rather than apply_intrinsic. Registrations for zip, hash_from_pairs, vec, alist-remove, alist-nremove, and throw similarly updated to new or renamed functions. * eval.h (interp_fun, mapcarv): Declarations updated. (mapcarl): Declard. * hash.c (hashv): Converted to struct args. (hashl): New function. (hash_construct): Use hashl, not hashv. (hash_from_pairs, hash_list, group_by): Converted. * hash.h (hashv, hash_construct, hash_from_pairs, hash_list, group_by): Declarations updated. (hashl): Declared. * lib.c (appendv, nconcv, lazy_appendv): Converted to struct args. (lazy_appendl): New function. (multi): Converted. (listv): New function. (nary_op, plusv, mulv, logandv, logiorv, gtv, ltv, gev, lev, numeqv, numneqv, maxv, minv): Converted. (maxl, minl): New functions, like old maxv and minv. (exptv, gcdv, lcmv, lessv, greaterv, lequalv, gequalv): Converted. (func_f0v, func_f1v, func_f2v, func_f3v, func_f4v): Converted. (func_n0v, func_n1v, func_n2v, func_n3v, func_n4v): Converted. (func_n0v, func_n1v, func_n2v, func_n3v, func_n4v): Converted. (func_n1ov, func_n2ov, func_n3ov): Converted. (generic_funcall): Converted to take struct args. (funcall, funcall1, funcall2, funcall4): Pass stack-allocated struct args as trailing arguments to variadic functions, and to generic_funcall. (do_curry_12_1_v): New struct-args-based static function, needed to implement curry_12_1_v now. (curry_12_1_v): Converted. (transposev): New function based on previous tranpose. (transpose): Now a wrapper for transposev. (do_chain, chainv, do_chand, chandv, do_juxt, juxtv, do_and, andv, do_or, orv, do_not, do_iff): Converted. (vectorv): New function. Implementation basis for vec intrinsic function. (alist_removev, alist_nremovev): New functions. (multi_sort): Switch from mapcarv to mapcarl. (unique): Converted. (uniq): Allocate struct args for calling unique. (obj_init): list_f function now based on new listv, rather than identity. * list.h (varg): New typedef. (struct func): All variadic function pointers converted to use struct args. (appendv, nconcv, lazy_appendv, multi, nary_op, plusv, minusv, mulv, gtv, ltv, gev, lev, numeqv, numneqv, maxv, minv, exptv, gcdv, lcmv, logadnv, logiorv, maskv, lessv, greaterv, lequalv, gequalv, func_f0v, func_f1v, func_f2v, func_f3v, func_f4v, func_n0v, func_n1v, func_n2v, func_n3v, func_n4v, func_n0v, func_n1v, func_n2v, func_n3v, func_n4v, func_n1ov, func_n2ov, func_n3ov, generic_funcall, chainv, chandv, juxtv, adnv, orv, unique): Declarations updated. (lazy_appendl, listv, maxl, minl, transposev, vectorv, alist_removev, alist_nremovev): Declared. * stream.c (make_catenated_stream_v): New function. (aformat): Renamed to formatv. The recognition of the nil and t streams (standard output and string) is done here now. (vformat): Follow rename of aformat to formatv. (formatv): Function removed. Nobody calls this anymore. (stream_init): make-catenated-stream re-registered to new make_catenated_stream_v function. * stream.h (formatv): Declaration updated. (make_catenated_v): Declared. * syslog.c (syslog_init): syslog registred to syslog_wrapv. (syslog_wrapv): New function based on syslog_wrap converted to struct args. (syslog_wrap): Now wrapper for syslog_wrapv. * syslog.h (syslog_wrapv): Declared. * unwind.h (uw_throwv): New function. (uw_throwfv, uw_errorfv): Converted to struct args. * unwind.h (uw_throwv): Declared. (uw_throwfv, uw_errorfv): Declarations updated.
* New function, clamp.Kaz Kylheku2015-08-131-0/+1
| | | | | | | | | | * eval.c (eval_init): Register clamp as intrinsic function. * lib.c (clamp): New function. * lib.h (clamp): Declared. * txr.1: Documented.
* New display-width function.Kaz Kylheku2015-08-131-0/+1
| | | | | | | | | | * eval.c (eval_init): Register display-width intrinsic. * lib.c (display_width): New function. * lib.h (display_width): Declared. * txr.1: Documented display-width.
* Remove never-used member of symbol structure.Kaz Kylheku2015-08-091-1/+0
| | | | | | | | * lib.h (struct sym): Remove value member. * lib.c (make_sym): Don't initialize removed member. * gc.c (mark_obj): Do not mark removed member.
* C++ static forward issue.Kaz Kylheku2015-08-071-0/+8
| | | | | | | | * lib.h (static_forward, static_def): New macros for dealing with C++ static forward declaration problem. * syslog.c (syslog_strm_ops): Use static forward macros.
* C++ upkeep: resolve multiple definitions of fun_k.Kaz Kylheku2015-08-071-1/+1
| | | | | | | | | | | | | | | * eval.c (fun_k): Global definition removed. (eval_init): Do not initialize fun_k here. * filter.c (fun_k): Definition removed. (filter_init): Do not initialize fun_k. * filter.h (fun_k): Declaration removed. * lib.c (fun_k): Defined in this file now. (obj_init): Initialize fun_k here. * lib.h (fun_k): Declare here.
* New exception type: system-error.Kaz Kylheku2015-08-051-0/+1
| | | | | | | | | * lib.c (system_error_s): New symbol variable. (obj_init): Initialize new variable. * lib.h (system_error_s): Declared. * unwind.c (uw_init): Register system-error exception type.
* Pass pretty flag to cobj print operation.Kaz Kylheku2015-08-011-2/+3
| | | | | | | | | | | | | | | | | | | | | * hash.c (hash_print_op): Take third argument, and call cobj_print_impl rather than cobj_print. * lib.c (cobj_print_op): Take third argument. The object class is * printed with obj_print_impl. (obj_print_impl): Static function becomes extern. Passes its pretty flag argument to cobj print virtual function. * lib.h (cobj_ops): print takes third argument. (cobj_print_op): Declaration updated. (obj_print_impl): Declared. * regex.c (regex_print): Takes third argument, and ignores it. * stream.c (stream_print_op, stdio_stream_print, cat_stream_print): Take third argument, and ignore it. * stream.h (stream_print_op): Declaration updated.
* Adding nthcdr as accessor.Kaz Kylheku2015-07-221-0/+1
| | | | | | | | | | | | * eval.c (eval_init): Register nthcdr function. * lib.c (nthcdr): New function. * lib.h (nthcdr): Declared. * share/txr/stdlib/place.tl (nthcdr): New defplace. * txr.1: Documented.
* Implementing second through tenth as places.Kaz Kylheku2015-07-221-0/+4
| | | | | | | | | | | | | | | | | | * eval.c (eval_init): Register second through tenth as intrinsic. * gencadr.txr: New cadr.c changes encoded. * lib.c (second, third, fourth, fifth, sixth): Functions reimplemented using ref, so they are much more efficient for vectors and strings. (seventh, eighth, ninth, tenth): New functions. * lib.h (seventh, eighth, ninth, tenth): Declared. * share/txr/stdlib/place.tl: place macros defined for second through tenth. * txr.1: Documented.
* * eval.c (eval_init): Register new split function.Kaz Kylheku2015-07-211-0/+1
| | | | | | | | | | | | * lib.c (split_func): New static function. (partition_split_common): New static function, based on on contents of partition function. (partition): Now a wrapper around partition_split_common. (split): New function. * lib.h (split): Documented. * txr.1: Documented split.
* Refactoring n-ary functions to use a single helper.Kaz Kylheku2015-07-241-0/+1
| | | | | | | * lib.c (nary_op): New function. (plusv, mulv, logandv, logiorv): Use nary_op. * lib.h (nary_op): Declared.
* * lib.h (mkloc): Rename misleading argument from fun to obj.Kaz Kylheku2015-06-071-1/+1
|
* New macro-based framework for assignment places.Kaz Kylheku2015-05-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The operators set, inc, dec, pop and others are now macros which generate code, rather than built-in special forms that use "C magic". Moreover, new such macros are easy to write, and several new ones are already available. Moreover, new kinds of assignable places are easy to create. * place.tl: New file. * lisplib.c, lisplib.h: New files. * Makefile (OBJS): New target, lisplib.o. (GEN_HDRS): New variable. (LISP_TO_C_STRING): New recipe macro, with rule. (clean): Remove generated headers named in $(GEN_HDRS). * eval.c (dec_s, push_s, pop_s, flip_s, del_s): Variables removed. (setq_s): New variable. (lookup_var, lokup_sym_lisp_1, lookup_var_l, lookup_fun, lookup_mac, lookup_symac, lookup_symac_lisp1): Trigger the delayed loading of libraries for undefined global symbols, and re-try the lookup. (op_modplace, dwim_loc, force_l): Static functions removed. (op_setq): New static function. (eval_init): Initialize setq_s; remove initializations of removed variables; remove registrations for op_modplace; add registration for sys:setq, sys:rplaca, sys:rplacd, sys:dwim-set and sys:dwim-del intrinsics. Call lisplib_init to initialize the dynamic library loading module. * lib.c (sys_rplaca, sys_rplacd): New functions, differing in return value from rplaca and rplacd. (ref, refset): Handle hash table. (dwim_set, dwim_del): New functions. * lib.h (sys_rplaca, sys_rplacd, dwim_set, dwim_del): Declared. * genvim.txr: Include place.tl in scan. * tests/010/seq.txr: The del operator test case no longer throws at run-time but at macro-expansion time, so the test case is simply removed. * tests/010/seq.expected: Updated output. * tests/011/macros-2.txr: Reset *gensym-counter* to zero, because the textual output of the test case includes gensyms, whose numberings fluctuate with the content of the new Lisp library material. * tests/011/macros-2.expected: Updated output.
* Adding getenv, setenv and unsetenv.Kaz Kylheku2015-04-181-0/+4
| | | | | | | | | | | | | | * lib.c (setenv, unsetenv): Changed static functions to external. Moved them out of the #if !HAVE_TIMEGM block. * lib.h (setenv, unsetenv): Declared. * sysif.c (getenv_wrap, setenv_wrap, unsetenv_wrap): New functions. (sysif_init): Registered getenv, setenv and unsetenv. * txr.1: Documented getenv, setenv and unsetenv. * tl.vim, txr.vim: Regenerated.
* Introducing persistent error state on streams.Kaz Kylheku2015-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib.c (cobj_ops): New function. * lib.h (cobj_ops): Declared. * stream.c (null_ops): Initializer updated. (struct stdio_handle): New member, err. (stdio_stream_mark): Mark the err member. (errno_to_string): New static function. (stdio_maybe_read_error, stdio_maybe_error): Set persistent error state. Use errno_to_string_function. (stdio_put_string, stdio_put_char, stdio_put_byte, stdio_seek, stdio_get_line): Set errno to zero, so that if the underlying operations do not set errno on err, we don't misinterpret some pervious errno value as pertaining to the failed stream operation. (stdio_get_error, stdio_get_error_str, stdio_clear_error): New static functions. (stdio_ops, tail_ops, pipe_ops): Update initializer with new functions. (string_in_get_error, string_in_get_error_str): New static functions. (string_in_ops): Update initializer with new functions. (byte_in_get_error, byte_in_get_error_str): New static functions. (byte_in_ops): Update initializer with new functions. (string_out_ops, strlist_out_ops): Update initializer with null pointers for new functions. (struct dir_handle): New struct type. (dir_destroy, dir_mark): New functions. (dir_get_line): Refactor for struct dir_handle context rather than DIR. Persist error state. (dir_close): Refactor for struct dir_handle. (dir_get_error, dir_get_error_str, dir_clear_error): New static functions. (dir_ops): Update initializer with new functions. (make_stdio_stream_common): Initialize new err member. (make_dir_stream): Refactor for struct dir_handle. (get_error, get_error_str, clear_error): New functions. (cat_get_error, cat_get_error_str, cat_clear_error): New static functions. (cat_stream_ops): Update initializer with new functions. (stream_init): Register get-error, get-error-str, clear-error intrinsics. * stream.h (struct strm_ops): New function pointer members, get_error, get_error_str and clear_error. (strm_ops_init): Macro extended with new arguments for new function pointers. (get_error, get_error_str, clear_error): Declared. * syslog.c (syslog_strm_ops): Update initializer with null pointers for new functions. * txr.1: Documented get-error, get-error-str and clear-error.
* * arith.c (trunc_rem): New function.Kaz Kylheku2015-02-071-0/+1
| | | | | | | | | | * eval.c (eval_init): Register trunc-rem intrinsic. * lib.h (trunc_rem): Declared. * txr.1: Documented trunc-rem. * tl.vim, txr.vim: Updated.
* Update copyright notices from 2014 to 2015.Kaz Kylheku2015-02-011-1/+1
| | | | | | | | | | | * 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.
* Use macro to initialize cobj_ops.Kaz Kylheku2015-01-291-0/+3
| | | | | | | | | | * 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.
* * arith.c (make_ubignum): New static function.Kaz Kylheku2015-01-291-0/+1
| | | | | | | | | | | | (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.
* * eval.c (eval_init): Register dupl and swap_12_21 asKaz Kylheku2015-01-251-0/+1
| | | | | | | | | | | 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.
* * arith.c (zerop): Handle character arguments.Kaz Kylheku2015-01-121-0/+2
| | | | | | | | | | | (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.
* Fix for LLVM wchar_t literals not being four byteKaz Kylheku2015-01-121-1/+4
| | | | | | | | | | | | | | | | | 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.
* * eval.c (eval_init): Registered intrinsic function unique.Kaz Kylheku2014-12-231-0/+1
| | | | | | | | | | | * 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.c (func_n1ov, func_n2ov, func_n3ov): New functions.Kaz Kylheku2014-12-231-0/+3
| | | | * lib.h (func_n1ov, func_n2ov, func_n3ov): Declared.
* * lib.c (func_n0o): Useless, unused function removed.Kaz Kylheku2014-12-231-1/+0
| | | | * lib.h (func_n0o): Declaration removed.
* * eval.c (eval_init): Register in function as intrinsic.Kaz Kylheku2014-12-051-0/+1
| | | | | | | | | | * lib.c (in): New function. * lib.h (in): Declared. * txr.1: Documented in. * txr.vim, tl.vim: Regenerated.
* * eval.c (eval_init): Register lequal and gequal.Kaz Kylheku2014-11-271-0/+4
| | | | | | | | | | * 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.
* * eval.c (eval_init): Register less and greater toKaz Kylheku2014-11-271-0/+2
| | | | | | | | | | 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.
* * eval.c (eval_init): Register sort-group.Kaz Kylheku2014-11-211-0/+1
| | | | | | | | * lib.c (sort_group): New function. * lib.h (sort_group): Declared. * txr.1: Documented.
* * arith.c (wrap_star, wrap): New functions.Kaz Kylheku2014-11-201-0/+2
| | | | | | | | * eval.c (eval_init): Registered wrap and wrap* intrinsics. * lib.h (wrap_star, wrap): Declared. * txr.1: wrap and wrap* documented.
* * arith.c (succ, ssucc, sssucc, pred, ppred, pppred): New functions.Kaz Kylheku2014-11-201-0/+6
| | | | | | | | * eval.c (eval_init): Register new functions as intrinsics. * lib.h (succ, ssucc, sssucc, pred, ppred, pppred): Declared. * txr.1: Documented.
* * lib.c (where): Argument order reversed, with compat support.Kaz Kylheku2014-11-201-1/+1
| | | | | | * lib.h (where): Declaration updated. * txr.1: Documented.
* * lib.c (max2, min2): Use the less comparison functionKaz Kylheku2014-11-151-2/+2
| | | | | | | | | 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.
* * eval.c (eval_init): Register chand intrinsic.Kaz Kylheku2014-11-061-0/+1
| | | | | | | | | * lib.c (do_chand): New static function. (chandv): New function. * lib.h (chandv): Declared. * txr.1: Documented chand.
* * lib.c (chk_grow_vec): New function.Kaz Kylheku2014-10-301-0/+2
| | | | | | | | | (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.
* * lib.c (type_check): Function moved to header file inline.Kaz Kylheku2014-10-261-1/+7
| | | | | | | (throw_mismatch): New function. * lib.h (throw_mismatch): Declared. (type_mismatch): Declaration turned into inline function.