summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* * lib.c (make_like): Fix regression introduced in 102.Kaz Kylheku2015-01-272-1/+7
| | | | | A one element list being converted to a string treated as an empty list, leading to empty string.
* * arith.c (width): New function.Kaz Kylheku2015-01-275-0/+80
| | | | | | | | * 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-253-2/+74
| | | | | | | | | (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-255-0/+56
| | | | | | | | | | | 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-243-0/+47
| | | | | | (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-215-284/+370
| | | | | | | | | | | 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-214-4/+33
| | | | | | | | | | | 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-212-1/+5
|
* Allow macros to tell what symbols have lexical functionKaz Kylheku2015-01-215-192/+305
| | | | | | | | | | | 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-137-230/+285
|
* * arith.c (zerop): Handle character arguments.Kaz Kylheku2015-01-125-1/+76
| | | | | | | | | | | (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.
* Fix for LLVM wchar_t literals not being four byteKaz Kylheku2015-01-124-46/+60
| | | | | | | | | | | | | | | | | aligned, affecting OS X port. * configure: Detect a SIZEOF_WCHAR_T when detecting integer type that will hold a pointer. In the lit_align test, if we are on Apple Mac OSX, use a lit_align of 2, so the logic kicks in for padding literals and handling misalignment. * lib.h (litptr): Add a case for LIT_ALIGN < 4 and SIZEOF_WCHAR_T == 4. In this case we do the arithmetic on the pointer using short *, and then convert to wchar_t. * HACKING: New section 2.4.3 about new wchar_t hack.
* * signal.h (sig_save_enable, sig_save_disable):Kaz Kylheku2015-01-122-8/+15
| | | | | | | | Use do;while(0) trick instead of local typedef to cause terminating semicolon to be required. (sig_restore_enable, sig_restore_disable): Remove superfluous do { } while (0). Closing a brace is good enough.
* * glob.c: New file.Kaz Kylheku2015-01-118-1/+272
| | | | | | | | | | | | | | | | | | | | (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.
* * Makefile (retest): New phony target for convenience.Kaz Kylheku2015-01-112-0/+7
|
* * lib.c (make_like): Bugfix. (make-like nil "abc")Kaz Kylheku2015-01-113-0/+27
| | | | | | | | | | 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-113-15/+35
| | | | * txr.1: Update documentation for merge function.
* * match.c (h_trailer): Bugfix: not returning new variableKaz Kylheku2015-01-052-2/+7
| | | | bindings captured in trailer section. Ouch!
* * txr.1: Formatting fixes.Kaz Kylheku2015-01-031-2/+2
|
* Version 101.txr-101Kaz Kylheku2015-01-014-5/+96
|
* * Makefile (rebuild, clean, repatch): Fail these targets ifKaz Kylheku2015-01-012-4/+30
| | | | | | the program is not configured. (distclean): Providing alternative implementation when the program is not configured.
* * lib.c (replace_str, replace_vec): Bugfix. The replacement itemKaz Kylheku2014-12-312-87/+98
| | | | | | sequence may be an infinite list in the case that the from argument specifies a list of indices. We must avoid trying to calculate its length before we have detected this case.
* * txr.1: Fix error. (set [seq index-list] new) corresponds toKaz Kylheku2014-12-312-3/+13
| | | | replace not to refset.
* * lib.c (simple_lazy_stream_func): Bugfix: close the streamKaz Kylheku2014-12-254-10/+28
| | | | | | | | | | 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-255-297/+313
| | | | | | | | 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-235-311/+372
| | | | | | | | | | | | (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-237-18/+109
| | | | | | | | | | | * 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 (func_n1ov, func_n2ov, func_n3ov): New functions.Kaz Kylheku2014-12-233-0/+30
| | | | * lib.h (func_n1ov, func_n2ov, func_n3ov): Declared.
* * lib.c (func_n0o): Useless, unused function removed.Kaz Kylheku2014-12-233-8/+6
| | | | * lib.h (func_n0o): Declaration removed.
* Syntax highlighting issue: keywords in braced variable syntaxKaz Kylheku2014-12-184-2/+16
| | | | | | | | | | not being recognized. * genvim.txr (txr_braced_ident): New match kind, specifically for a keyword. (txr_bracevar): Bracevar region contains txr_braced_indent. * txr.vim, tl.vim: Regenerated.
* * lib.c (copy): Support copying random state objectsKaz Kylheku2014-12-183-12/+28
| | | | | | vi make_random_state. * txr.1: Updated.
* * rand.c (rand32): Bugfix: if the seed object is a randomKaz Kylheku2014-12-173-6/+27
| | | | | | | | | 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.
* * rand.c (struct rand_state): Change cur member to unsigned.Kaz Kylheku2014-12-172-1/+6
| | | | This generates better code for rand32.
* * rand.c (rstate): New inline function.Kaz Kylheku2014-12-162-8/+17
| | | | | (rand32): Use inline function instead of macro. I compared gcc -O2 output on Intel: no difference.
* Factor out some compiling commands into macros.Kaz Kylheku2014-12-132-16/+33
| | | | | | | * Makefile (COMPILE_C, COMPILE_C_WITH_DEPS, LINK_PROG): New macro strings. (dbg/%.o, opt/*.o, %.o, $(PROG), $(PROG)-dbg, conftest, conftest2): These targets now use these commands.
* Build bugfix: if a config.h header exists in $(top_srcdir),Kaz Kylheku2014-12-123-88/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | then that header is used when building in a separate directory, instead of the config.h generated in that directory. To fix this, we move config.h into a config/ subdirectory. The $(top_srcdir)/config is not in the include search path when buiding in a separate build directory. While we are at it, let's move all the configure materials generated by the configure script into config/. * Makefile: include config/config.make at the top. Removing the rule which asserts the existence of configuration based on the presence of config.make. (CFLAGS): Add $(conf_dir) to include search path with -iquote. (notconfigured): New conditionally-defined target for producing the error message when the build system is not configured. (NL, DEP): New variables. ($(OBJS)): Make dependent on config/config.make and config/config.h with help of DEP macro. (opt/lex.yy.o, dbg/lex.yy.o): Express dependency using DEP. (y.tab.h): Split off as a dependent on y.tab.c rather than a co-target in the rule. The rule has a body to handle the situation when y.tab.h is missing for some reason, but y.tab.c already exists (and so won't be re-made, and so y.tab.h won't be remade). * configure: Require GNU Make 3.81 rather than 3.80. (conf_dir): New variable. (config_h, config_make, config_log): New variables. These are used in place of config.h, config.make and config.log. Add conf_dir to config.make variable.
* * configure: typo in message.Kaz Kylheku2014-12-111-1/+1
|
* * configure (have_git): New variable and configure test for git.Kaz Kylheku2014-12-113-0/+29
| | | | | * Makefile (SRCS): Only set if git is available. (enforce): Fail if we don't have git.
* 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.