summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* TXR Lisp regression in C global variables.Kaz Kylheku2012-01-112-6/+47
| | | | | | | | | | | * eval.c (struct c_var): New struct type. (lookup_var, lookup_var_l): cptr type bindings now point to a struct c_var, which has to be handled properly here. (c_var_mark): New static function. (c_var_ops): New static struct. (reg_var): Register variables using struct c_var to provide a pointer to the location and a cached cons that can be returned as a binding.
* * eval.c (each_s, each_star_s, collect_each_s, collect_each_star_s):Kaz Kylheku2012-01-114-2/+131
| | | | | | | | | | | New symbol variables. (op_each): New static function. (expand): Handle the four new operators. (eval_init): Intern new symbols, register new operators. * txr.1: Documented each, each*, collect-each and collect-each*. * txr.vim: Updated.
* * eval.c (eval_init): list_str registered.Kaz Kylheku2012-01-116-1/+27
| | | | | | | | | | * lib.c (list_str): New function. * lib.h (list_str): Declared. * txr.1: Doc stub section created. * txr.vim: Updated.
* * eval.c (generate): Bugfix: do not call gen_fun beforeKaz Kylheku2012-01-102-1/+6
| | | | testing while_pred.
* * eval.c (tostring, tostringp): New static functions.Kaz Kylheku2012-01-104-2/+28
| | | | | | | | (eval_init): New functions registered. * txr.1: Stub sections created. * txr.vim: Updated.
* Spat of new features having to do with lazy processing.Kaz Kylheku2012-01-106-16/+451
| | | | | | | | | | | | | | | | | | | | | | | | * eval.c (prog1_s, gen_s, generate_s, delay_s, promise_s): New symbol variables. (eval_prog1, op_prog1, expand_gen, expand_delay): New static functions. (expand): Handle gen and delay. (lazy_mapcar_func, lazy_mapcar, lazy_mapcarv_func, lazy_mapcarv, lazy_mappendv): New static functions. (rangev_func, rangev, generate_func, generate, repeat_infinite_func, repeat_times_func, repeatv, force): New static functions. (eval_init): New operators and functions interned. lazy-flatten renamed to flatten*. * lib.c (null_f): New global variable. (ltail, lazy_appendv): New functions. (lazy_appendv_func): New static function. (obj_init): null_f protected and initialized. * lib.h (null_f, ltail, lazy_appendv): Declared. * txr.1: Documented. * txr.vim: Updated.
* Non-broken way to achieve intent of previous commit.Kaz Kylheku2012-01-094-11/+34
| | | | | | | | | | | | | | * eval.c (subst_vars): Do not evaluate modifiers as an argument list locally. Pass form-evaluating function to format_field. * match.c (format_field): Modified to accept new argument, a one-argument function for reducing a form to a value. Error checking for invalid modifiers made stricter. (subst_vars): Do not evaluate modifiers as an argument list. Pass form-evaluating function to format_field. * match.h (format_field): Declaration updated.
* * eval.c (subst_vars): Evaluate theKaz Kylheku2012-01-093-1/+13
| | | | | | | modifiers, so expressions can be used. * match.c (subst_vars): Likewise, but using txeval.
* Break up glued keywords.Kaz Kylheku2012-01-071-1/+1
|
* * eval.c (eval_init): Missing documented memql function registered.Kaz Kylheku2012-01-072-9/+22
| | | | * txr.vim: Updated with numerous missing symbols.
* Version 52txr-52Kaz Kylheku2012-01-073-10/+59
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated. Wrong December dates fixed.
* * match.c (fuzz_s): New symbol variable.Kaz Kylheku2012-01-063-1/+96
| | | | | | | | (v_fuzz): New static function. (syms_init): fuzz_s initialized. (dir_tables_init): v_fuzz entered into v_directive_table. * txr.1: Documented @(fuzz).
* * match.c (v_gather): Implemented until/last clause.Kaz Kylheku2012-01-064-2/+74
| | | | | | | * parser.y (gather_parts, additional_gather_parts): New nonterminals. (gather_clause): Syntax refactored for until/last clause. * txr.1: Updated.
* * eval.c (eval_init): Fix regression introduced inKaz Kylheku2012-01-022-1/+7
| | | | | 2011-12-29 commit. We can't use mod_s, because the module which sets up that variable is not yet initialized.
* Make C globals in TXR Lisp properly assignable, so that for instanceKaz Kylheku2012-01-013-14/+53
| | | | | | | | | | | | | | | assigning *stdout*, it really overwrites the underlying C variable. * eval.c (lookup_var): Handle new kind of toplevel binding. If the hash value is a cptr, it points to a val storage location. (lookup_val_l): New function. (op_modplace): Get location of variable using lookup_val_l rather than assuming there is a cons-based binding. (reg_var): Argument changed to val * pointer. Register the variable as a cptr referencing the location. (eval_init): reg_var calls pass address of each global. * eval.h (lookup_var_l): Declared.
* * eval.c (eval_init): New gensym function registered.Kaz Kylheku2012-01-014-0/+26
| | | | | | | | * lib.c (gensym_counter): New variable. (gensymv): New function. (obj_init): Initialize gensym_counter. * lib.h (gensym_counter, gensymv): Declared.
* * match.c (counter_k): New keyword symbol variable.Kaz Kylheku2011-12-306-18/+76
| | | | | | | | | | | | | | | | | | | | (do_output_line): Process new :counter argument of rep. (do_output): Ditto, for repeat. (syms_init): Intern new keyword symbol. * match.h (counter_k): Declared. * parser.l (REPEAT, REP): Lexical syntax changed to allow arguments. * parser.y (repeat_rep_helper): Takes extra argument, representing the repeat/rep args. This is inserted into the second position of the output list. (repeat_clause, rep_elem): Extract repeat/rep arguments and pass to repeat_rep_helper. (yybadtoken): Do not put quotes around the word "number". * txr.1: Updated.
* New functionality: mod and modlast directives in repeat and rep.Kaz Kylheku2011-12-298-30/+202
| | | | | | | | | | | | | | | | | | | | | | * eval.c (eval_init): Use new symbol variable mod_s instead of calling intern. * match.c (mod_s, modlast_s): Symbol variables defined. (do_output_line): mod and modlast directives implemented under rep. (do_output): likewise under repeat. (syms_init): Initialize new symbol variables. * match.h (mod_s, modlast_s): Declared. * parser.l (MOD, MODLAST): Parse new token types. * parser.y (MOD, MODLAST): New tokens. (repeat_parts_opt, rep_parts_opt): New syntax. (repeat_rep_helper): Handle mod and modlast syntax. * txr.1: Updated. * txr.vim: Updated.
* * parser.y (repeat_rep_helper): Bugfix. Circular listsKaz Kylheku2011-12-292-1/+8
| | | | | | were being created here when clauses of the same kind appear multiple times. The problem is that append2 no longer copies the second list, which the code was relying on it to do.
* * txr.1: Missing Description headings added.Kaz Kylheku2011-12-292-0/+5
|
* * txr.1: Useless sentence under reduce-left and reduce-right removed.Kaz Kylheku2011-12-292-3/+4
|
* Spelling.Kaz Kylheku2011-12-291-2/+2
|
* * txr.1: Clarifying semantics of exceptions being thrown inKaz Kylheku2011-12-281-8/+13
| | | | catch clauses and in finally clauses.
* * genman.txr: Updated for recent man page changes.Kaz Kylheku2011-12-282-1/+5
|
* Version 51txr-51Kaz Kylheku2011-12-285-3/+42
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * txr.1: Capitalize TXR where it makes sense.Kaz Kylheku2011-12-282-76/+68
| | | | Introductory text rewritten.
* Missing entry for previous commit.Kaz Kylheku2011-12-281-0/+6
|
* * match.c (LOG_MATCH): Use < in format directive instead of -.Kaz Kylheku2011-12-282-2/+3
| | | | * rand.c (random): Add back missing declaration.
* * parser.y (quasi_item): Switch from var to o_var. This fixesKaz Kylheku2011-12-282-1/+7
| | | | | cases like `@a@(foo)@b` where foo was being translated to (foo) rather than (sys:expr foo).
* * mpi-patches/shrink-mpi-int (mpi_int): Fixed terrible bug in thisKaz Kylheku2011-12-272-8/+12
| | | | | patch, resulting in an insufficient bit field width for representing the allocation size of the MPI integer on 32 bit platforms.
* * rand.c (make_state): Use ANSI C syntax for prototyped function of noKaz Kylheku2011-12-272-2/+8
| | | | | | arguments. This snuck through due to working with a C++ compiler. (random): Fixed unused variable warning that happens on 32-bit-pointer platforms.
* More formatting changes.Kaz Kylheku2011-12-251-267/+192
|
* * txr.1: Formatting fixes.Kaz Kylheku2011-12-252-31/+99
|
* * dep.mk: Overdue update.Kaz Kylheku2011-12-252-4/+9
|
* * match.c (v_next): Change flatten to lazy_flatten in theKaz Kylheku2011-12-252-1/+7
| | | | | correct place. In the previous commit I did it in the code that handles the obsolescent :var syntax.
* * eval.c (eval_init): New function interned.Kaz Kylheku2011-12-256-3/+80
| | | | | | | | | | | | | * lib.c:x (lazy_flatten_scan, lazy_flatten_func): New static functions. (lazy_flatten): New function. * lib.h (lazy_flatten): Declared. * match.c (v_next): Use lazy_flatten instead of flatten for processing a :list source. This means that @(next :list ...) can be used to process infinite lazy lists. * txr.1: Documented lazy-flatten.
* * rand.c (rand32): Moved.Kaz Kylheku2011-12-232-21/+32
| | | | | | (make_random_state): After initializing, retrieve eight random numbers to clear pathological initial behavior leading to duplicate values.
* * arith.c (highest_bit): Changing to external linkage.Kaz Kylheku2011-12-234-20/+60
| | | | | | | | * arith.h (highest_bit): Declared. * rand.c (random): Rewrote using different algorithm which ensures even distribution, and avoids doing a bignum mod operation.
* 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.