summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Version 50txr-50Kaz Kylheku2011-12-235-4/+72
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* Missing log entry re-created.Kaz Kylheku2011-12-231-0/+7
|
* * lib.c (memql): New function.Kaz Kylheku2011-12-234-5/+163
| | | | | | | | | | | (some_satisfy): Return the first non-nil result, rather than t. (all_satisfy): Return the value of the last item, if all items are processed. * lib.h (memql): Declared. * txr.1: Documented memq, memql, memqual, tree-find, some, all, none, eq, eql and equal.
* * txr.1: Documented copy-list, reverse, nreverse, ldiff and flatten.Kaz Kylheku2011-12-222-0/+107
|
* * txr.1: Documented reduce-left and reduce-right.Kaz Kylheku2011-12-222-0/+54
|
* Bug #35010Kaz Kylheku2011-12-222-9/+26
| | | | | | | | | | * match.c (extract_bindings): Make sure there are no duplicate variables among the extracted bindings. This is needed because of the other changes. (do_output_line, do_output): In handling the rep/repeat directives, append the original bindings to the extracted set bindings for the variables which just occur in the clause, so that Lisp code can see all of the variables.
* * stream.c (vformat): If width is specified for ~s or ~a, andKaz Kylheku2011-12-222-1/+15
| | | | | | | the object is not a string or number, then print it to a string and treat it as a string, adjusting it within the field. Also, do not simply abort on an unknown format directive but throw a proper exception.
* * stream.c (vformat): Left-adjusted field is now specifiedKaz Kylheku2011-12-222-11/+15
| | | | | using < rather than '-'. The +, space and leading 0 are specified on the precision, not the width.
* * rand.c (random): Fix for 64 bit fixnums: stick two random numbersKaz Kylheku2011-12-222-0/+10
| | | | | together. Otherwise for fixnum moduli, we get only a 32 bit number no matter what the modulus is.
* * stream.c (vformat): Combine ~a and ~s cases, so numbers andKaz Kylheku2011-12-222-30/+12
| | | | | strings are printed the same way under ~s and ~a. The only difference is printing other kinds of objects.
* Bug #35026Kaz Kylheku2011-12-222-14/+45
| | | | | | | | | | | * stream.c (format_num): New argument: sign character. Rewrote to handle precision, width, zero padding and leading sign similarly to printf. (vformat): New syntax accepted: a space or + before the width specifies that a positive sign is to be explicitly written as a space or + character. Pass one more argument to vormat_num calls. Bugfix: go back to vf_init state after processing ~~.
* Bug #35136 and cleanup.Kaz Kylheku2011-12-222-32/+41
| | | | | | | | | | | * arith.c (plus, minus, mul, gt, ge, lt, le, exptmod, gcd): Remove trailing abort; we already marked uw_throwf as noreturn. This hack should not be needed in functions where the last statement is a throw. (trunc, expt): Repeated error case handled in one place. Temp variable used to avoid two calls to mp_clear. Call to abort removed. (mod): Repeated error handed in one place. Plugged memory leak by moving throw past mp_clear calls. Call to abort removed. (isqrt): Repeated error case handed in one place.
* * txr.vim: Fixed to char literal syntax.Kaz Kylheku2011-12-212-0/+5
|
* * mpi-patches/bit-search-optimizations (s_highest_bit):Kaz Kylheku2011-12-211-13/+13
| | | | | | It will take days to completely wipe the egg off my face. I forgot to fix this code for unsigned integers before pasting it into MPI.
* * arith.c (normalize): Linkage changed to extern.Kaz Kylheku2011-12-215-2/+21
| | | | | | | | * arith.h (normalize): Declared. * rand.c (random): Bugfix: normalize the bignum before returning it. * txr.1: Doc stubs for PRNG functionality.
* * rand.c: Added comment about source of algorithm.Kaz Kylheku2011-12-212-0/+8
|
* * rand.c (random): Bugfix: not building up sufficiently large bignums.Kaz Kylheku2011-12-212-3/+17
| | | | Work properly when mp_digit is smaller than 32 bits.
* * Makefile (OBJS): new object file, rand.o.Kaz Kylheku2011-12-216-1/+256
| | | | | | | | | | | | * eval.c: Includes rand.h header. (eval_init): New variable and functions from rand module registered. * lib.c: Includes rand.h header. (init): Call rand_init. * rand.c: New file. * rand.h: New file.
* Bug #35139Kaz Kylheku2011-12-212-3/+12
| | | | | | | Better fix. * parser.y (YYEOF): If YYEOF is not defined, define it as zero. (yybadtoken): Undo previous changes: do not test for zero.
* Bug #35139Kaz Kylheku2011-12-212-3/+10
| | | | | * parser.y (yybadtoken): The current token (yychar) is 0 on byacc rather than YYEOF or YYEMPTY, so we have to handle that.
* * Makefile (distclean): use rm -rf on mpi directory.Kaz Kylheku2011-12-212-1/+6
|
* Test case for bug #35137Kaz Kylheku2011-12-203-0/+30
| | | | | | * tests/007/except-2.expected: New file. * tests/007/except-2.txr: New file.
* * eval.c (eval_init): New function registered.Kaz Kylheku2011-12-205-0/+44
| | | | | | | | * lib.c (cat_vec): New function. * lib.h (cat_vec): Declared. * txr.1: Documentation stub.
* Bug #35137Kaz Kylheku2011-12-203-11/+24
| | | | | | | | | | | | | | * unwind.c (uw_unwind_to_exit_point): When jumping to a catch frame, do not mark it invisible. * unwind.h (uw_catch): Flip the matches to nil so that this catch frame can no longer be identified as an unwind point by uw_throw, and thus will not be re-entered for the purposes of handling an exception. It remains visible for the purposes of running the clean up code. (uw_unwind): Prior to executing cleanup forms, flip the visibility to 0. This means that the frame will no longer be re-entered for any reason.
* Streamlining exception handling macros a little bit.Kaz Kylheku2011-12-204-13/+39
| | | | | | | | | | | | | | | | | | | | | | * eval.c (op_unwind_protect): Use uw_simple_catch_begin, and remove the uw_catch (exsym, exvals) clause. Put explicit braces around the unwind code even though it is only one statement. * match.c (do_txeval): Got rid of empty uw_unwind clause. This is not needed any longer. (v_try): Got rid of explicit uw_do_unwind calls. * unwind.h (uw_simple_catch_begin): New macro. (uw_do_unwind): Macro removed. (uw_catch): Added goto uw_unwind_label at the front. This way if the previous clause falls through, control goes to the unwind logic. (uw_unwind): Got rid of initial break. Previous clause should fall through to unwind logic, whether it is the main clause, or one of the catches. (uw_catch_end): Default case aborts, because we don't expect this.
* Critical regression. Hash lookup was crashing on some platformsKaz Kylheku2011-12-203-24/+40
| | | | | | | | | | | | | | due to negative hashing values being reduced modulo table size to a negative array index. * hash.c (equal_hash, eql_hash): Ensure that value returned is in the range [0,NUM_MAX]. (hash_obj): Unused function removed. (cobj_hash_op): Use hashing similar to eql hash for other kinds of references. (hash_eql, hash_equal): Removed bogus % NUM_MAX reduction. * hash.h (hash_obj): Declaration removed.
* * eval.c (eval_init): New functions registered as intrinsics.Kaz Kylheku2011-12-205-0/+68
| | | | | | | | * lib.c (copy_vec, sub_vec): New functions. * lib.h (copy_vec, sub_vec): Declared. * txr.1: Stub sections created.
* Version 049txr-049Kaz Kylheku2011-12-195-4/+64
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * eval.c (subst_vars, op_quasi_list, expand_quasi): New staticKaz Kylheku2011-12-194-4/+110
| | | | | | | | | | functions. (expand): New case for quasiliterals. (eval_init): Register quasi literal as special operator. * match.c (format_field): Linkage changed to external. * match.h (format_field): Declared. Declarations rearranged.
* * eval.c (bindings_helper): Fix format arguments.Kaz Kylheku2011-12-186-16/+77
| | | | | | | | | | | | | | | | | (eval_init): Registered new functions: symbol-function, func-get-form, func-get-env, functionp, interp-fun-p. * lib.c (nappend2, getplist_f, improper_plist_to_alist): tail variable renamed to avoid clash in macro. (func_get_form, func_get_env, interp_fun_p): New functions. * lib.h (func_get_form, func_get_env, interp_fun_p): Declared. (list_collect): Fix macro not to throw error, but handle the case. * match.c (vars_to_bindings, extract_bindings): tail variable renamed to avoid clash in macro. * txr.1: Documentation stubs.
* 2011-12-16 Kaz Kylheku <kaz@kylheku.com>Kaz Kylheku2011-12-162-11/+37
| | | | | | | | * hash.c (equal_hash): Eliminating displacement from character hashes. Simplifying some code. (eql_hash): Handle fixnums, characters and literals specially, rather than hashing all value types the same way. The shift applicable for object pointers causes adjacent integers to clash.
* * eval.c (expand_vars): Bugfix: use expand_forms rather thanKaz Kylheku2011-12-162-1/+6
| | | | expand on a list of forms.
* * txr.vim: iskeyword updated.Kaz Kylheku2011-12-162-2/+5
|
* * lib.c (appendv): bugfix: wrong way test.Kaz Kylheku2011-12-152-2/+7
| | | | (vector_list): Wrong zero used, resulting in vector(nil) being called.
* * eval.c (eval_init): not added as synonym for null.Kaz Kylheku2011-12-157-40/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | * lib.c (copy_list): Use list_collect_append rather than list_collect_terminate. (append2, appendv): Simplified using new list_collect_append. (nappend2): Simplified using new list_collect_nconc. * lib.h (list_collect): Added check for accidental usage of list_collect after list_append, since PTAIL has different semantics. (list_collect_nconc, list_collect_append): Semantics fixed so that append collecting works more like the Common Lisp append function, allowing trailing atoms or a lone atom. The meaning of PTAIL is changed, however. Now PTAIL actually tracks the head of the most recently appended segment. Each append operation has to first traverse the previously added piece to get to the end. (list_collect_terminate): Macro removed. * match.c (v_gather): Removed useless use of list_collect_terminate. * parser.y: Some headers added that are needed by list_collect. * txr.1: Documented append, list, atom, null, not, consp, make-lazy-cons, lcons-fun, listp, proper-listp, length-list, mapcar, mappend, and apply.
* @# comments are becoming obsolescent. @# commentsKaz Kylheku2011-12-144-14/+47
| | | | | | | | | | | can now be used. Within nested forms, Lisp-compatible ; comments are suported. * parser.l: Support @# and ; comments. * txr.1: Documentation updated. * txr.vim: Updated.
* * lib.c (car, cdr): Set the lazy cons function to nilKaz Kylheku2011-12-143-1/+211
| | | | | | | | after calling it. (rplacd): Do not set the lazy cons function to nil in. * txr.1: Documented a bunch of functions.
* * eval.c (eval_init): Removed registration for vec_get_fil.Kaz Kylheku2011-12-146-54/+68
| | | | | | | | | | | | | | | | | | | | | | | | Renamed vec_set_fill to vec-set-length. * hash.c (equal_hash): vec_fill to vec_length name change. (hash_grow, make_hash): No need to call vec_set_length. * lib.c (equal, vecref, vec_push, length_vec, list_vector, obj_print, obj_pprint): vec_fill to vec_length name change. (vector): Argument now represents actual length, not just allocated size. (vec_get_fill): Function removed; did exactly the same thing as length_vec. (vec_set_fill): Function renamed to vec_set_length. (vector_list): Allocate a 0 length vector initially. * lib.h (enum vecindex): member changes name from vec_fill to vec_length. (vector): Parameter name changed. (vec_set_fill): Redeclared. (vec_get_fill): Declaration removed. * txr.1: Doc stubs updated.
* * lib.c (car, cdr): Semantics fix for lazy conses.Kaz Kylheku2011-12-142-4/+11
| | | | | | | | Ignore the return value of the lazy cons function: do not return nil if the function returns nil. This useless behavior was a source of inconvenience in lazy cons programming, requiring the lazy function to return non-nil in addition to installing the car and cdr fields.
* * arith.c (abso): broken for fixnums.Kaz Kylheku2011-12-142-1/+5
|
* * txr.vim: Highlight hash prefix and quote.Kaz Kylheku2011-12-142-3/+12
|
* * eval.c (op_dohash): Esbatlish anonymous block.Kaz Kylheku2011-12-143-4/+167
| | | | * txr.1: Finished documenting special operators.
* * genman.txr: Fix empty NAME section.Kaz Kylheku2011-12-142-4/+11
|
* * arith.c (minus): Allow difference between characters.Kaz Kylheku2011-12-142-0/+5
|
* * arith.c (plus, minus, gt, lt, ge, le): Handle character operands.Kaz Kylheku2011-12-146-0/+88
| | | | | | | | | | * eval.c (eval_init): New functions interned. * lib.c (num_chr, chr_num): New functions. * lib.h (num_chr, chr_num): Declared. * txr.1: Documentation stubs.
* Version 048txr-048Kaz Kylheku2011-12-135-4/+38
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * arith.c (exptmod, gcd): New functions.Kaz Kylheku2011-12-135-0/+71
| | | | | | | | * eval.c (eval_init): New functions registered as intrisics. * lib.h (exptmod, gcd): Declared. * txr.1: Documentation stubs added.
* * arith.c (evenp, oddp): New functions.Kaz Kylheku2011-12-135-1/+45
| | | | | | | | * eval.c (eval_init): New functions registered as intrinsics. * lib.h (evenp, oddp): Declared. * txr.1: Documentation stub updated.
* * arith.c (highest_bit): Linkage changed to static.Kaz Kylheku2011-12-138-3/+269
| | | | | | | | | | | | | | | | | (abso, isqrt): New functions. (isqrt_fixnum): New static function. * eval.c (eval_init): Registered abs, sqrt and numberp instrinsics. * lib.c (numberp): New function. * lib.h (numberp, abso, isqrt): Declared. * mpi-patches/series: New patch added. * mpi-patches/faster-square-root: New patch added. * txr.1: Documentation stubs for new functions.
* * arith.c (expt): Fix broken bignum x fixnum combination.Kaz Kylheku2011-12-132-1/+5
|