summaryrefslogtreecommitdiffstats
path: root/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
* Build and pass test suite on Cygwin.Kaz Kylheku2011-12-091-0/+12
| | | | | | | | | | * configure (longlong, ulonglong, superlong, usuperlong): Initialize these variables so that if the detection tests fail, the script does not access unbound variables. Avoid adding junk like .bss.* into config.h. * mpi-patches/config-types: Fixed wrong use of nonexistent SIZEOF_LONG_T.
* (Applies to previous commit.)Kaz Kylheku2011-12-091-0/+7
| | | | | * mpi-patches/config-types: Added missing definitions of MP_DIGIT_SIZE in two cases.
* Bignum support, here we go!Kaz Kylheku2011-12-091-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bignums, based on Michael Fromberger's MPI library, are integrated into the input syntax, stream output, equality testing, the garbage collector, and hashing. The plus operation handles transitions between fixnums and bignums. Other operations are still fixnum only. * Makefile (CFLAGS): Add mpi directory to include file search. (OBJS): Include new arith.o module and all of MPI_OBJS. (MPI_OBJS, MPI_OBJS_BASE): New variables. * configure (mpi_version, have_quilt, have_patch): New variables. Script detects whether patch and quilt are available. Unpacks mpi library, applies patches. Detects 128 bit integer type. Records more information in config.h about the sizes of types. * dep.mk: Updated. * depend.txr: Make work with paths that have directory components. * eval.c (eval_init): Rename of nump to fixnump. * gc.c (finalize, mark_obj): Handle BGNUM case. * hash.c: (hash_c_str): Changed to return unsigned long instead of long. (equal_hash): Handle BGNUM case. (eql_hash): Handle bignums with equal-hash, but other objects as eq. * lib.c (num_s): Variable renamed to fixnum_s. (bignum_s): New symbol variable. (code2type): Follow rename of num_s. Handle BGNUM case. (typeof): Follow rename of num_s. (eql): Handle bignums using equal, and other types using eq. (equal): Handle BGNUM case. (chk_calloc): New function. (c_num): Wording change in error message: is not a fixnum. (nump): Renamed to fixnump. (bignump): New function. (plus): Function removed, reimplemented in arith.c. (int_str): Handle integers which are too large for wcstol using bignum conversion. Base 0 is no longer passed to wcstol but converted to 10 because the special semantics for 0 would be inconsistent for bignums. (obj_init): Follow rename of num_s. Initialize bignum_s.
* C++ maintenance.Kaz Kylheku2011-12-081-0/+8
| | | | | | * eval.c (and_s, or_s): Redundant variables removed. * match.h (do_s): extern storage class specifier added.
* * eval.c (op_defun): Transform a function body by insertingKaz Kylheku2011-12-071-0/+9
| | | | | | | | a named block around it, thereby imitating a Common Lisp feature. (op_for): Establish an anonymous block around the loop body, test form and increment forms. * txr.1: Documented named block in defun. Documented for and for *.
* * txr.vim: Updated with all operators and functions.Kaz Kylheku2011-12-071-0/+4
|
* * txr.1: flip operator documented. Bad syntax for pop fixed.Kaz Kylheku2011-12-071-0/+5
| | | | Blank section for list-vector function added.
* * eval.c (op_modplace): If the operator is push, then reverseKaz Kylheku2011-12-071-0/+8
| | | | | | | the arguments. We want (push item list) for compatibility with CL. (expand): Bugfix: some of the cases were constructing new forms using unexpanded pieces from the original form. Added separate case for push, which handles the reversed arguments.
* * debug.c (debug): Fix regression: repeat last command by hittingKaz Kylheku2011-12-071-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | Enter stopped working. This was broken by recent bugfixes in the string splitting functions, which introduced a semantics change. * eval.c (flip_s, vecref_s): New symbol variables. (op_modplace): New places (vecref ...) and (flip ...). Bugfix: dec operator was incrementing. (expand_place): Handle vecref and flip. Bugfix: pop has no third argument and so is now handled by the same case as flip. Bugfix: if a modify form has no third argument, then do not resynthesize it with a nil third argument. (eval_init): Initialize new symbol variables. Register new flip operator. Register new list_vectory function as intrinsic. * lib.c (rplacd): When modifying the cdr field of a lazy cons, then lapse the lazy function to nil! This is needed by user-defined lazy conses, and it makes sense to do it this way rather than put in some explicit interface. (list_vector): New function. * lib.h (list_vector): Declared.
* * eval.c (lookup_var, lookup_fun): Reversing assoc arguments.Kaz Kylheku2011-12-071-0/+24
| | | | | | | | | | | | | | | | | | | | | | | (eval_init): New intrinsics. * hash.c (struct_hash): assoc_fun parameters reversed. (gethash, gethash_f, gethash_n): Likewise. * lib.c (assoc, assq): Reversing parameters. (find_package, acons_new, acons_new_l, aconsq_new): Reversing arguments to assoc adn assq. * lib.h (assoc, assq): Declarations updated. * match.c (dest_set, dest_bind, h_var, h_coll, h_parallel, h_fun, subst_vars, do_txeval, v_next, v_parallel, v_gather, v_collect, v_flatten, v_cat, v_output, v_filter, f_fun, match_funcall): Reversing arguments to assoc. * unwind.c (uw_get_func, uw_exception_subtype_p, uw_register_subtype): Reversing arguments to assoc. * txr.1: Blank sections created for new functions.
* * txr.1: Blank sections created for character functions.Kaz Kylheku2011-12-071-0/+4
|
* * eval.c (eval_init): New functions registered as intrinsics.Kaz Kylheku2011-12-071-0/+8
| | | | | | * lib.c (chr_toupper, chr_tolower): New functions. * lib.h (chr_toupper, chr_tolower): New functions declared.
* * parser.l: In the CHRLIT state, return a nonblank character as anKaz Kylheku2011-12-071-0/+5
| | | | IDENT token. This allows for character literals like #\$.
* * eval.c (eval_init): New character functions registered.Kaz Kylheku2011-12-071-0/+15
| | | | | | | | | | | | | * lib.c (c_num): Generalized to convert characters to numbers also. This allows functions like gt and lt to work with characters. (chr_isalnum, chr_isalpha, chr_isascii, chr_iscntrl, chr_isdigit, chr_isgraph, chr_islower, chr_isprint, chr_ispunct, chr_isspace, chr_isupper, chr_isxdigit): New functions added. * lib.h: (chr_isalnum, chr_isalpha, chr_isascii, chr_iscntrl, * chr_isdigit, chr_isgraph, chr_islower, chr_isprint, chr_ispunct, * chr_isspace, chr_isupper, chr_isxdigit): New functions declared. (c_true): New macro.
* * eval.c (progn_s): New symbol variable.Kaz Kylheku2011-12-071-0/+8
| | | | | | | (op_progn): New static function. (eval_init): Initialize new variable, register progn operator. * txr.1: progn documented.
* Version 046txr-046Kaz Kylheku2011-12-061-0/+12
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * stream.c (find_char): New function.Kaz Kylheku2011-12-061-0/+10
| | | | | | | | | (string_in_get_line): Following up TODO. Fixed broken function. Now get_line on a string stream properly returns characters up to and not including the next newlne character, and also consumes the newline character. Other cases are handled properly, also: the stream being at EOF already, or at the last line not being newline-terminated.
* * eval.c (op_unwind_protect): Fixed uninitialized variableKaz Kylheku2011-12-061-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | warning. (eval_init): New functions registered: typeof and vector functions, as well as length_list. * lib.c (length): Function renamed to length_list, because it is list specific. (length_vec, size_vec, vector_list): New functions. (length): New function, generic over lists, vectors and strings. * lib.h (length_list, length_vec, size_vec, vector_list): Declared. * match.c (h_var, h_fun, robust_length, v_deffilter, v_fun): Use length_list instead of length. * parser.l: Introduced # token. * parser.y (vector): New nonterminal. (expr): vector is a kind of expr. (chrlist): Bugfix: single-character syntax was not working; for instance #\x to denote the charcter x. (lit_char_helper): Use length_list instead of length. * stream.c (string_in_get_line): Bugfix: this was using the wrong length function: length was being applied to a string. The genericity of length makes that correct now, but changing to length_str anyway. * txr.1: Blank sections created for functions. Vector syntax documented.
* 2011-12-06 Kaz Kylheku <kaz@kylheku.com>Kaz Kylheku2011-12-061-0/+5
| | | | | * configure: Forgot to treat octal number in the processing of conftest.syms. Removed useless eval.
* Version 045txr-045Kaz Kylheku2011-12-051-1/+13
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * eval.c (op_cond): Fixed behavior for singleton clauses.Kaz Kylheku2011-12-051-0/+11
| | | | | | | | | | (eval_init): Use existing function objects car_f, cdr_f, eq_f, eql_f and equal_f. Added identity to function table. * lib.h (eql_f): Missing declaration added. * txr.1: Documented cond, and, if, or, defun, inc, dec, set, push and pop.
* * parser.y (force_regular_quotes): Function removed.Kaz Kylheku2011-12-041-0/+9
| | | | | | | | (list): Prior commit reversed. * txr.1: Prior commit reversed. * RELNOTES: No semantics clarification in quasiquote; bugfixes only.
* * eval.c (op_qquote_error, op_unquote_error): New static functions.Kaz Kylheku2011-12-041-0/+14
| | | | | | | | | | | | | (expand_qquote): Bugfix: missing case added to handle directly quoted quasiquote. (eval_init): Error-catching pseudo-operators registered in op_table. * parser.y (force_regular_quotes): New function. (list): Quotes within unquotes and splices are regular. * txr.1: Clarified new rules. Removed description of ,'form and ,*'form special syntax.
* Expose lazy lists in TXR Lisp.Kaz Kylheku2011-12-031-0/+17
| | | | | | | | | | | | | | | * eval.c (eval_init): New intrinsic functions. * lib.c (rplaca, rplacd, lcons_fun): New functions. (make_lazycons): Renamed to make_lazy_cons, relocated and turned into external function. (lazy_stream_func, lazy_stream_cons): Follow rename of make_lazycons. * lib.h (rplaca, rplacd, make_lazy_cons, lcons_fun): Declared. * txr.1: Stub sections created.
* * eval.c (uw_protect_s, return_s, return_from_s): New symbolKaz Kylheku2011-12-031-0/+15
| | | | | | | | | | | | | | variables. (op_unwind_protect, op_block, op_return, op_return_from): New static functions. (expand): Removed case for call, if, and, and or. These operators evaluate all their arguments, so the code walker can treat them as a function calls. Added case for block and return-from. (eval_init): New symbols interned. New operator functions registered in op_table. * txr.1: Blank sections added.
* * lib.c (split_str, split_str_set): Bugfix: access beyond the end ofKaz Kylheku2011-12-031-0/+5
| | | | the input string.
* * eval.c (eval_init): String and character functionsKaz Kylheku2011-12-031-0/+7
| | | | | | exposed as intrinsics. * txr.1: Blank sections created.
* * txr.1: Added stub sections for new functions.Kaz Kylheku2011-12-021-0/+4
|
* * eval.c: Symbol related intrinsic functions and variables madeKaz Kylheku2011-12-021-0/+7
| | | | | | available: * lib.h (sym_name): Dangling declaration removed.
* * parser.y (list): unquote and splice actions look inside theKaz Kylheku2011-12-021-0/+11
| | | | | | | | | | argument form. If an unquote or splice are applied to a quoted form, its quote becomes a regular quote. This behavior is necessary to make ,',form work in nested quotes, otherwise the ' is a quasiquote which captures the comma in ,form, reducing ,',form to ,form. * txr.1: Documented this special behavior.
* * eval.c (expand_qquote): Bugfix: removed bogus recognitionKaz Kylheku2011-12-021-0/+7
| | | | | | and processing of regular quote form. This broke nested backquote processing, and quasiquote forms containing non-quasi-quotes like like '(a 'b ,c).
* Version 044txr-044Kaz Kylheku2011-12-011-1/+13
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * txr.1: Started Lisp documentation. Updated description ofKaz Kylheku2011-12-011-0/+5
| | | | symbol syntax.
* * lib.c (int_str): Return nil rather than 0 if no digits are extractedKaz Kylheku2011-12-011-0/+5
| | | | at all.
* * match.c (h_skip, h_coll, v_skip, v_collect): Evaluate the arguments.Kaz Kylheku2011-12-011-0/+6
| | | | | (do_txeval): Optimization: short-circuit out if the expression is nil, without establishing the exception handler.
* * match.c (v_skip): Bugfix: Nov 12 commit caused regression:Kaz Kylheku2011-12-011-0/+7
| | | | | | skip min/max arguments not working! * RELNOTES: Updated.
* Dropping the silly cons return value from txeval.Kaz Kylheku2011-12-011-0/+18
| | | | | | | | | | | | | | | | | Two interfaces are provided to the function. One throws on unbound variable, the other which evaluates them to the symbol noval_s (used in exception handling). * match.c (do_txeval): New static function. (txeval): Functionality moved to do_txeval. (txeval_allow_ub): New static function. (vars_to_bindings, h_fun, v_freeform, v_next, v_merge, v_bind, v_set, v_cat, v_output, v_deffilter, v_fun): No need to use cdr to get the value from txeval. (v_throw): Use txeval_ub_allowed, since unbound variables are allowed in throw. (v_try): Detect unbound arguments by checking for noval_s rather than nil. No need to use cdr.
* * match.c (eval_form): Function renamed to txeval so its isKaz Kylheku2011-12-011-0/+7
| | | | | | not confused with the Lisp evaluation functions. (vars_to_bindings, h_fun, v_freeform, v_next, v_merge, v_bind, v_set, v_cat, v_output, v_throw, v_deffilter, v_fun): Updated.
* * lib.h (or2): Restore macro version of or2, because we needKaz Kylheku2011-11-301-0/+21
| | | | | | | | | | | | | | | | | | | | the sequencing! Making it an inline function broke the tests. But we can't have multiple evaluation either, so it's going to use a temporary lexical variable. (uses_or2): Macro which declares the lexical variable needed by or2. * debug.c (debug): add uses_or2. * eval.c (eval_intrinsic, op_modplace): Likewise. * lib.c (lazy_str, lazy_str_force_upto, lazy_str_get_trailing_list): Likewise. * match.c (h_parallel, v_freeform, v_parallel, v_output): Likewise. * parser.y (unquotes_occur): Likewise. * stream.c (format): Likewise.
* Removing useless hash table.Kaz Kylheku2011-11-301-0/+14
| | | | | | | | | | | | * parser.h (ln_to_forms_hash): Declaration removed. * parser.l (ln_to_forms_hash): Variable removed. (parse_init): Initialization and protection of ln_to_forms_hash removed. * parser.y (rl): Update of ln_to_forms_hash removed. * txr.1:
* * configure (extra_debugging): New variable. EXTRA_DEBUGGINGKaz Kylheku2011-11-301-0/+14
| | | | | | | | | | | | | conditionally generated in config.h. * gc.c (break_obj): New static variable. (mark_obj): Debugging feature: if the object is the one stored in break_obj and not yet reached, then call breakpt. (deheap): New debugging function for viewing regions of the heaps. * lib.c (breakpt): New function. * lib.h (breakpt): Declared.
* * hash.c (hash_process_weak): Fix regression caused by a mistakeKaz Kylheku2011-11-301-0/+9
| | | | | | | | in the the 2010-01-26 commit, prior to release 033. When processing a table with weak values, this function was mistakenly testing the keys rather than values for for reachability. I noticed this when a test case that should run in constant memory showed unwarranted accumulation of memory.
* * eval.c (op_modplace): Bugfix: conflation of new value andKaz Kylheku2011-11-301-0/+9
| | | | | | | | increment value. Separate new value and increment value, and check number of arguments. * lib.h (or2): Turned into inline function due to multiple argument evaluation.
* * txr.vim: New operators added.Kaz Kylheku2011-11-301-0/+4
|
* * eval.c (bindings_helper): Fix uninitialized variable.Kaz Kylheku2011-11-291-0/+4
|
* * eval.c (dohash_s): New symbol variable.Kaz Kylheku2011-11-291-0/+8
| | | | | | | (op_dohash): New static function (expand): New case for dohash_s. Bugfix for do_s: expand was used rather than expand_forms. (eval_init): dohash_s initialized and entered into op_table.
* * eval.c (eval_init): hashp and maphash functions registered.Kaz Kylheku2011-11-291-0/+8
| | | | | | * hash.c (maphash): New function. * hash.h (maphash): Declared.
* * eval.c (expand_vars): Bugfix: was not handling varsKaz Kylheku2011-11-291-0/+5
| | | | of the form var, only (var initform).
* Support assignment to (car ...) and (cdr ...).Kaz Kylheku2011-11-291-0/+16
| | | | | | | | | | | | | | * eval.c (car_s, cdr_s): New symbol variables. (op_modplace): Cases for car and cdr added. (expand_place): Likewise. Calls abort should the cases fall through rather than returning 42. (expand): Bugfix: for and for* case not propagating source location info. Bugfix: expansion for do added. (eval_init): car_s and cdr_s initialized and used in place of previous intern calls. * parser.y (elem): Removed wrong logic for expanding the do form. It was expanding only the first argument.
* * eval.c (let_star_s, for_s, for_star_s): New symbols.Kaz Kylheku2011-11-281-0/+14
| | | | | | | | | | | | | (env_replace_vbind, bindings_helper): New static functions. (op_let): Refactored to allow for let* form. Code for setting up bindings moved into bindings helper, shared by for loop. (op_for, expand_vars): New static functions. (expand): Bugfix: let case was neglecting to walk the var initialization forms. This is done via expand_vars now. let_star_s added to this case to handle let* and let at the same time. New case added for for and for*. (eval_init): let_star_s, for_s, and for_star_s initialized, and entered into op_table.