summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Throwing away old dependency system.Kaz Kylheku2014-12-104-129/+47
| | | | | | | | | | | | | | | | | | | | | | * Makefile (DEPGEN): New macro variable. (OPT_OBJS, DBG_OBJS): Define with := assignment. (OBJS): New variable. (dbg/%.o, opt/*.o): Use -MMD and -MT options of gcc to generate dependencies. Also use DEPGEN macro to rewrite each dependency makefile's rule into a DEP_ variable assignment. (DEP_INSTANTIATE): New macro variable. (include dep.mk): Removed, replaced by eval hack that includes all the .d files and instantiates the rule from the DEP_ variable in each one. (opt/lex.yy.o, dbg/lex.yy.o): We need to hard code the dependency of these on y.tab.h, to force that header to generate. (DEP_opt/lex.yy.o, DEP_dbg/lex.yy.o): New variables, related to above. (depend): Target removed. * dep.mk: File removed. * depend.txr: File removed.
* * Makefile (ABBREV): Rewrite to take advantage of DEP_Kaz Kylheku2014-12-104-52/+112
| | | | | | | | | | | | | variables to remove the dependencies from the output. (ABBREV2): No longer needed, removed. (dbg/%.o, opt/%.o, %.o): Just use ABBREV instead of ABBREV2; it does the right thing. Dependency of objects on config.make removed. * dep.mk: Regenerated. Now provides variable assignments in addition to rules, and each object is made dependent on config.make. * depend.txr: Adjusted to generate dep.mk in new format.
* * Makefile (install-tests): Do not use option -c ofKaz Kylheku2014-12-092-2/+9
| | | | | | cpio (use old ASCII format). This was unintentional. On extract, use -m option to preserve timestamps, like we do in INSTALL.
* Test output goes to tst/ now.Kaz Kylheku2014-12-093-41/+69
| | | | | | | | | | | | | | | | | | | | | | | | | * Makefile (TESTS_OUT): We don't need to refer to top_srcdir. Add the tst/ prefix to .out paths. Find must be used with -H because tests is a symlink for out-of-tree build directories. (tests/*): All target-specific assignments are moved to tst/tests/* paths, and top_srcdir is no longer used in the right hand side values. (%.out): Becomes (tst/%.out). (%.ok): need to compute .expected name from .out differently to account for tst/ prefix. (tests.clean): Just remove the tst directory. (install-tests): Remove the tst directory first so test commands are forced to run (though it is a dry run). We no longer need to switch to top_srcdir to find the .txr files, nor do we have to filter out .out files from the tests tree. We no longer have to switch to top_srcdir in the recursive make. Also, show the installation of tests using ABBREV3. * configure: When configuring in a separate directory, symlink the tests directory back to the source tree. Since there are now three things being symlinked, rewrote that as a loop. The recommendation to build in a separate directory is just a note, not a warning.
* * Makefile (($TESTS_OUT)): Do not depend on $(PROG).Kaz Kylheku2014-12-092-3/+9
| | | | | | | This adds superfluous commands to run.sh under make install-tests, and is also inappropriate if a different txr binary is being tested. (install-tests): Do not override top_srcdir in the recursive make call; instead use -C to change to $(top_srcdir).
* * Makefile (all): Mark as phony target.Kaz Kylheku2014-12-092-0/+5
|
* Condensed make output.Kaz Kylheku2014-12-092-48/+83
| | | | | | | | | | | | | | | | * Makefile (VERBOSE): New variable. (V, ABBREV, ABBREV1, ABBREV3): New macro variables. (dbg/%.o, opt/%.o): Use V, ABBREV1 for concensed output. ($(PROG), $(PROG)-dbg, lex.yy.c, y.tab.c, %.out, %.ok, INSTALL): Likewise, but use ABBREV. (tests, GREP_CHECK, config.make, conftest.yacc, conftest.clean): Use $(V) instead of @. (tests.clean): Remove @; do not hide remove commands. (INSTALL): Use $(V) instead of @ and use ABBREV3 to provide condensed output. (install): Use $(V) on $(PREINSTALL) so we don't see : in the output. (install-tests): Put $(V) on all steps.
* Debug builds optional with --debug-also config option.Kaz Kylheku2014-12-073-2/+26
| | | | | | | | | * Makefile (PROG): Variable removed, now set in config.make. (all): Target now depends on $(BUILD_TARGETS) variable, set in config.make. * configure (debug_also) New variable. (gen_config_make): Generate PROG and BUILD_TARGETS variables.
* * arith.c (tofloat, toint): Handle characters.Kaz Kylheku2014-12-053-1/+36
| | | | | | 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-057-212/+351
| | | | | | | | | | * lib.c (in): New function. * lib.h (in): Declared. * txr.1: Documented in. * txr.vim, tl.vim: Regenerated.
* * lib.c (set_diff): Bugfix: use member rather than find,Kaz Kylheku2014-12-052-1/+6
| | | | so that a nil set element is handled properly.
* * Makefile (INSTALL): Bugfix: touch -r $(2) does not workKaz Kylheku2014-12-052-2/+9
| | | | | | right when $(2) is a wildcard like path/to/*.txr. It touches files in the source tree to the timestamp of the argument after -r. Putting in a shell loop to handle this.
* * Makefile (TESTS_TMP): New variable.Kaz Kylheku2014-12-052-8/+18
| | | | | | | | | | (TESTS_OUT): Depends on $(PROG). (TESTS_OK): Does not dependon $(PROG). (tests): Does not depend on tests.clean. (retest): Target removed. (%.out : %.txr): Generate to temporary file, then move to .out. (tests.clean): Remove $(TESTS_TMP).
* * Makefile (SRCS): Compute from top_srcdir, so we don't get a warningKaz Kylheku2014-12-052-2/+10
| | | | from git, and "make enforce" works from out of three builds.
* * configure: Bugfix: the "share" directory has to beKaz Kylheku2014-12-052-0/+8
| | | | | symbolically linked. Without this, tests which require txr to have access to its library do not work.
* TXR now builds optimized and debug at the same time.Kaz Kylheku2014-12-044-38/+107
| | | | | | | | | | | | | | | | | | | | | | | | Optimized object files are under opt/ and debug object files are under dbg/. The debug txr executable is called txr-dbg. * Makefile (CFLAGS): $(OPT_FLAGS) is omitted from CFLAGS, so we can expand it where appropriate. (ADD_CONF, EACH_CONF): New variables, used as macros. (DBG_OBJS, OPT_OBJS): New variables. (dbg/%.o, opt/%.o): New rules. (all): New target. ($(PROG)-dbg): New target. (clean): Remove the object directories with rm -rf. Remove $(PROG)-dbg. (depend): Pass $(OPT_OBJS) and $(DBG_OBJS) to depend.txr Also: various target-specific assignments for object files had to be split for rel and dbg. * depend.txr: Updated to handle dbg/ or rel/ prefix on object file paths. * dep.mk: Regenerated.
* * Makefile (clean): add tests.clean as prerequisite.Kaz Kylheku2014-12-042-4/+16
| | | | | (tests): Add tests.clean as prerequiste, remove rm command. (retest, tests.clean): New rules.
* * Makefile (tests/009/json.out): Use eager assignmentKaz Kylheku2014-12-042-1/+6
| | | | intead of lazy assignment to set TXR_ARGS.
* * Makefile (TXR): New variable. We use this to run txrKaz Kylheku2014-12-042-27/+60
| | | | | | | | | | | | | | | | | | | | | | | rather than ./$(PROG). This way we can override the variable from the command line if necessary. (TESTS): Variable removed. (TESTS_OUT, TESTS_OK): New variables, replace TESTS. (tests): Prerequisites is now $(TESTS_OK), which are actual timestamp files. Also depends on $(PROG). (tests/%/%): Target specific assignments are now for .out targets rather than .ok targets. (%.out): New pattern target, made from half of previous %.ok rule. (%.ok): Smaller rule, only performs diff between .out and .expected, and touches the .ok stamp. (%.expected): Bugfix: this rule now just copies .out to .expected, and its prerequisite is %.out rather than %.txr. Previously it tried to run txr, but it wouldn't use the correct options, which depended on the target-specific assignments for various .ok files. (install-tests): Bugfix: in the "make -s -n" call use the new TXR variable to specify the program's path. This fixes the issue that ./ was prepended to the txr commands, resulting in nonworking run.sh. (txr-manpage.html): Use TXR to invoke txr rather than PROG.
* * Makefile: Adding empty .SUFFIXES: to disable built-in suffixes.Kaz Kylheku2014-12-042-0/+12
| | | | | Also set MAKEFLAGS to disable all built-in rules. The only one rule we used is .c to .o, so we provide it ourselves.
* * eval.c (eval_init): Register lequal and gequal.Kaz Kylheku2014-11-277-222/+317
| | | | | | | | | | * 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-275-6/+70
| | | | | | | | | | 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-215-1/+53
| | | | | | | | * lib.c (sort_group): New function. * lib.h (sort_group): Declared. * txr.1: Documented.
* * lib.c (partition_star_func): Bugfix: doing rplaca(env, seq)Kaz Kylheku2014-11-212-8/+14
| | | | | | too early, before the loop which adjusts its value. Restructuring this slightly to avoid duplicated code, by moving the !first check later.
* * lib.c (partition_by_func): Rename one local variable for clarity.Kaz Kylheku2014-11-212-9/+14
| | | | | Remove unessential variable last, and move the next variable into loop scope.
* * arith.c (wrap_star, wrap): New functions.Kaz Kylheku2014-11-205-0/+86
| | | | | | | | * 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-205-0/+84
| | | | | | | | * 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-204-3/+21
| | | | | | * lib.h (where): Declaration updated. * txr.1: Documented.
* * lib.c (sel): Accept a function in place of the index list.Kaz Kylheku2014-11-203-2/+23
| | | | * 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-174-2/+67
| | | | | | | | | | 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-154-10/+23
| | | | | | | | | 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-105-186/+332
| | | | | | | | | | | | (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.
* * lib.c (sub, ref, refset, replace, update, search_list):Kaz Kylheku2014-11-062-6/+13
| | | | | | Fix cut and paste problem: type_mismatch argument expression referring to the C function cons rather than the intended object seq.
* * eval.c (eval_init): Register chand intrinsic.Kaz Kylheku2014-11-065-1/+54
| | | | | | | | | * 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-064-18/+51
| | | | | | | | | * 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-053-9/+11
| | | | | | | | 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-313-0/+111
| | | | | | | * eval.c (me_tb, me_tc): New static functions. (eval_init): Registered tb and tc macros. * txr.1: Documented tb and tc.
* * lib.c (chk_grow_vec): New function.Kaz Kylheku2014-10-304-13/+46
| | | | | | | | | (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.
* Implementing finalization hooks.Kaz Kylheku2014-10-304-51/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * gc.h (break_obj): Missing extern added on declaration.Kaz Kylheku2014-10-302-1/+6
| | | | This broke C++ compilation with -DEXTRA_DEBUGGING turned on.
* Vim syntax coloring for standalone TXR Lisp (*.tl) files.Kaz Kylheku2014-10-294-54/+336
| | | | | | | | | * genvim.txr (generate): New pattern function, contains generation logic so we can do it twice. * txr.vim: Regenerated. * tl.vim: New file.
* * lib.c (type_check): Function moved to header file inline.Kaz Kylheku2014-10-263-5/+17
| | | | | | | (throw_mismatch): New function. * lib.h (throw_mismatch): Declared. (type_mismatch): Declaration turned into inline function.
* * hash.c (hash_begin): Use coerce macro instead of raw C cast.Kaz Kylheku2014-10-253-4/+10
| | | | | | Use cobj_handle so hash argument is validated. * parser.l (YY_INPUT): Use convert macro instead of raw C cast.
* GNU Flex's libfl library provides nothing. Let us not refer to it. ItKaz Kylheku2014-10-244-7/+23
| | | | | | | | | | | | only causes build issues on some systems where it is not provided in the standard location, or is not cross-compiled properly. * Makefile (LEXLIB): Reference to variable removed. * configure (lexlib): Variable removed. (LEXLIB): config.make variable not generated. * parser.l (yywrap): Provide this trivial function as inline.
* * Makefile: Removing trailing spaces.Kaz Kylheku2014-10-2423-194/+210
| | | | | | | | | | (GREP_CHECK): New macro. (enforce): Rewritten using GREP_CHECK, with new checks. * arith.c, combi.c, debug.c, eval.c, filter.c, gc.c, hash.c, lib.c, * lib.h, match.c, parser.l, parser.y, rand.c, regex.c, signal.c, * signal.h, stream.c, syslog.c, txr.c, unwind.c, utf8.c: Remove trailing spaces.
* * eval.c (eval_init): Fix incorrect, registration ofKaz Kylheku2014-10-222-1/+6
| | | | repeat; it must have one optional argument.
* Version 100.txr-100Kaz Kylheku2014-10-225-4/+79
|
* Ensure that a hash reorganization doesn't take placeKaz Kylheku2014-10-225-7/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | during a traversal, which could cause items to be visited twice or skipped. * gc.c (full_gc): Changed from static to exter (full_gc): Changed to internal linkage. * gc.h (full_gc): Declared. * hash.c (struct hash): New member, usecount. (struct hash_iter): New member, next. (reachable_iters): New static variable. (hash_mark): Reset the usecount of every reachable hash table. (hash_iter_mark): Add every reachable iterator to reachable_iters list. (make_hash, make_similar_hash, copy_hash): Initialize usecount. (gethash_c): Do not call hash_grow if usecount is nonzero. (hash_begin): Initialize next field of hash_iter to null. Increment use count on hash table. (hash_next): When traversal ends, release use count, and null out the hash table reference. (do_weak_tables): New static function. (do_iters): New static function. (hash_process_weak): Weak hash processing logic moved to do_weak_tables. Also calls do_iters. * txr.1: Describe hash table traversal, and the assurances and caveats about inserting and deleting items.
* * eval.c (interp_fun): If the function doesn't haveKaz Kylheku2014-10-212-5/+19
| | | | | specials, then don't bother saving and restoring dynamic env around the argument binding and evaluation.