summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
* * sysif.c (abort_wrap): New static function.Kaz Kylheku2015-02-061-2/+25
| | | | | | | | | | (sysif_init): Registered abort intrinsic. * txr.1: Documented abort. Changed Unix Programming heading to System Programming, since exit, abort and errno are not Unix-specific, but C-specific. * tl.vim, txr.vim: Updated.
* * unwind.c (unhandled_hook_s): New static variable.Kaz Kylheku2015-02-061-0/+41
| | | | | | | | | | | | | | | | | | | (uw_throw): In the unhandled case, check if *unhandled-hook* variable has a function, and use it instead of the default logic. If it's not a function, abort with an error message. Clear it so that if the hook function re-enters this code, it will not be used. Always exit now on unhandled exceptions; do not abort. (uw_late_init): New function. * unwind.h (uw_late_init): Declared. * lib.c (init): Call uw_late_init. * txr.1: Documented *unhandled-hook*. * genvim.txr: Scan the unwind.c file, since it has a reg_var now. * tl.vim, txr.vim: Updated.
* Symbol macros shadowed by functions under dwim.Kaz Kylheku2015-02-031-20/+44
| | | | | | | | | | | * eval.c (lookup_symac_lisp1, expand_lisp1, expand_forms_lisp1): New static functions. (expand): Handle dwim's arguments via expand_forms_lisp1, rather than as a generic compound form. * txr.1: Revised text in several places to clarify this expansion rule.
* Version 103.txr-103Kaz Kylheku2015-02-011-2/+2
|
* * arith.c (make_ubignum): New static function.Kaz Kylheku2015-01-291-0/+29
| | | | | | | | | | | | (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.
* * txr.1: Minor change under make-random-state.Kaz Kylheku2015-01-291-1/+1
|
* * txr.1: fixed use of nonexistent str-int in @(require) example;Kaz Kylheku2015-01-291-5/+3
| | | | fixed bad formatting under logtrunc and partition.
* * arith.c (width): New function.Kaz Kylheku2015-01-271-0/+28
| | | | | | | | * arith.h (width): Declared. * eval.c (eval_init): Width registered as intrisinc. * txr.1: Documented width.
* * eval.c (call_f): new global variable.Kaz Kylheku2015-01-251-0/+45
| | | | | | | | | (do_mapf, mapf): new static functions. (eval_init): protect call_f from gc, and initialize it. re-register call function using call_f. register mapf intrinsic. * txr.1: Documented mapf.
* * eval.c (eval_init): Register dupl and swap_12_21 asKaz Kylheku2015-01-251-0/+31
| | | | | | | | | | | 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.
* * eval.c (callf): New static function.Kaz Kylheku2015-01-241-0/+32
| | | | | | (eval_init): callf registered. * txr.1: Documented callf.
* * txr.1: Grammar.Kaz Kylheku2015-01-241-1/+1
|
* Basic implementation of constantp. Does notKaz Kylheku2015-01-211-0/+37
| | | | | | | | | | | recognize forms like (+ 2 2) as constant. * eval.c (constantp_noex, constantp): New functions. (eval_init): Registered constantp as intrinsic. * tl.vim, txr.vim: Updated. * txr.1: Documented constantp.
* * stream.c (get_string): New argument, close_after_p.Kaz Kylheku2015-01-211-1/+13
| | | | | | | | | | | Close the stream unless close_after_p is specified and is nil, or when it is missing, an there is no compatibility or it's newer than version 102. * stream.h (get_string): Updated declartion. * txr.1: Documented default closing behavior of get-string and the new optional argument for overriding it.
* * txr.1: Minor fix in split-str-set documentation.Kaz Kylheku2015-01-211-1/+1
|
* Allow macros to tell what symbols have lexical functionKaz Kylheku2015-01-211-0/+63
| | | | | | | | | | | or variable bindings. * eval.c (lexical_var_p, lexical_fun_p): New local functions. (eval_init): Registered as intrinsics. * txr.1: Documented lexical-var-p and lexical-fun-p. * tl.vim, txr.vim: Updated.
* Version 102.txr-102Kaz Kylheku2015-01-131-2/+2
|
* * arith.c (zerop): Handle character arguments.Kaz Kylheku2015-01-121-1/+26
| | | | | | | | | | | (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.
* * glob.c: New file.Kaz Kylheku2015-01-111-0/+83
| | | | | | | | | | | | | | | | | | | | (glob_wrap, glob_init): New functions. (errfunc_thunk): New static function. * glob.h: New file. * txr.c (main): call glob_init if HAVE_GLOB is defined. * configure (have_glob): New variable. (gen_config_make): Add have_glob to config/config.make. Detect glob function and set have_glob, and add HAVE_GLOB to config/config.h. * Makefile (OBJS): Include glob.h if have_glob is "y". * genvim.txr: Scan glob.c for functions and variables also. * txr.1: Documented glob and glob-related variables.
* * lib.c (make_like): Bugfix. (make-like nil "abc")Kaz Kylheku2015-01-111-0/+12
| | | | | | | | | | 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.
* * eval.c (merge_wrap): Make generic over sequences.Kaz Kylheku2015-01-111-10/+11
| | | | * txr.1: Update documentation for merge function.
* * txr.1: Formatting fixes.Kaz Kylheku2015-01-031-2/+2
|
* Version 101.txr-101Kaz Kylheku2015-01-011-3/+3
|
* * txr.1: Fix error. (set [seq index-list] new) corresponds toKaz Kylheku2014-12-311-3/+8
| | | | replace not to refset.
* * lib.c (simple_lazy_stream_func): Bugfix: close the streamKaz Kylheku2014-12-251-5/+4
| | | | | | | | | | 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.
* * stream.c (stream_init): Register make_catenated_stream inKaz Kylheku2014-12-251-2/+9
| | | | | | | | a different form as cat-streams. * txr.1: Document cat-streams. * tl.vim, txr.vim: Regenerated.
* * txr.1: Small fix under get-lines.Kaz Kylheku2014-12-251-1/+1
|
* * eval.c (ap_s, ret_s, aret_s): New symbol variables.Kaz Kylheku2014-12-231-0/+42
| | | | | | | | | | | | (me_ret): Static function renamed to me_ret_aret. Handles ret and aret macro expansion. (eval_init): Initialize ap_s, ret_s and aret_s. Re-register ret macro using ret_s and bind to me_ret_aret. Register aret macro. * txr.1: Documented aret. * tl.vim, txr.vim: Regenerated.
* * eval.c (eval_init): Registered intrinsic function unique.Kaz Kylheku2014-12-231-0/+69
| | | | | | | | | | | * 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 (copy): Support copying random state objectsKaz Kylheku2014-12-181-11/+17
| | | | | | vi make_random_state. * txr.1: Updated.
* * rand.c (rand32): Bugfix: if the seed object is a randomKaz Kylheku2014-12-171-1/+10
| | | | | | | | | state, we do not want to make the 8 calls to rand32 to mix up the state; we need are making a straight copy. * txr.1: Document the possibility that the seed object is a random state. Document the platform-independence of the integer seed.
* * arith.c (tofloat, toint): Handle characters.Kaz Kylheku2014-12-051-0/+5
| | | | | | Fix error message in toint wrongly identifying itself as tofloat. * txr.1: Document handling of characters.
* * eval.c (eval_init): Register in function as intrinsic.Kaz Kylheku2014-12-051-0/+53
| | | | | | | | | | * 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/+32
| | | | | | | | | | * 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-4/+27
| | | | | | | | | | 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/+32
| | | | | | | | * 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/+59
| | | | | | | | * 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/+32
| | | | | | | | * 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/+5
| | | | | | * lib.h (where): Declaration updated. * txr.1: Documented.
* * lib.c (sel): Accept a function in place of the index list.Kaz Kylheku2014-11-201-1/+14
| | | | * txr.1: Documented.
* * txr.1: Random fixes.Kaz Kylheku2014-11-171-3/+3
|
* * lib.c (split_str): If the separator string is empty,Kaz Kylheku2014-11-171-0/+31
| | | | | | | | | | 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.
* * lib.c (max2, min2): Use the less comparison functionKaz Kylheku2014-11-151-4/+7
| | | | | | | | | 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 (opip_s, oand_s, chain_s, chand_s): New global variables.Kaz Kylheku2014-11-101-0/+90
| | | | | | | | | | | | (macro_form_p): Forward declaration added. (me_opip): New static function. (eval_init): Intern new symbols, register opip and oand macros to me_opip function. Use chain_s and chand_s in registration for chain and chand. * txr.1: Document opip and oand * tl.vim, txr.vim: Regenerated.
* * eval.c (eval_init): Register chand intrinsic.Kaz Kylheku2014-11-061-1/+18
| | | | | | | | | * lib.c (do_chand): New static function. (chandv): New function. * lib.h (chandv): Declared. * txr.1: Documented chand.
* Allow then-func to be omitted in iff. Cleanup.Kaz Kylheku2014-11-061-16/+37
| | | | | | | | | * 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.
* * lib.c (iff): Bugfix: forgotten handling of defaultKaz Kylheku2014-11-051-9/+1
| | | | | | | | 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.
* New macros tb and tc.Kaz Kylheku2014-10-311-0/+72
| | | | | | | * eval.c (me_tb, me_tc): New static functions. (eval_init): Registered tb and tc macros. * txr.1: Documented tb and tc.
* Implementing finalization hooks.Kaz Kylheku2014-10-301-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | * gc.c (struct fin_reg): New struct type. (final_list, final_tail, mark_makefresh): New static variables. (mark_obj): Under generational GC, if make_makefresh is in effect, set the generation to -1 on all marked objects. (sweep_one): In an EXTRA_DEBUGGING build, call breakpt if the object being swept is the one in break_obj. Under generational GC, place reachable objects that are in generation -1 the freshobj nursery and assign them to generation 0, rather than sticking them into the mature generation 1. (sweep): Under generational gc, reset the freshobj_idx variable here, so that sweep_one has an empty nursery in which to place the generation -1 objects. (prepare_finals, call_finals): New static functions. (gc): Call prepare_finals before sweep, and call call_finals just before re-enabling GC and returning. Do not reset freshobj_idx to zero; this was done in sweep, which may have added entries into it. (gc_finalize): New function. (gc_late_init): Register gc_finalize as intrinsic function finalize. * txr.1: Documented finalize. * HACKING: Documented finalization, described the additional meaning of the -1 generation, and added a section on debugging with break_obj and breakpt.
* Version 100.txr-100Kaz Kylheku2014-10-221-2/+2
|