summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Version 85.txr-85Kaz Kylheku2014-03-085-4/+30
|
* * genvim.txr: Handle variable definition without embedded intern.Kaz Kylheku2014-03-081-0/+3
|
* * txr.1: Added missing documentation for @(forget)/@(local).Kaz Kylheku2014-03-082-0/+77
|
* * rand.c (rand_init): Oops! Spectacular silliness hereKaz Kylheku2014-03-082-3/+10
| | | | | | | broke the symbol module: two intern calls in consecutive lines, one for the name without "earmuffs", one with, leading to the situation that the C code looks for a dynamic variable that does not exist.
* * match.c (LOG_MATCH, LOG_MISMATCH): Wouldn't you know it;Kaz Kylheku2014-03-072-2/+11
| | | | | | | | the format strings in these macros contained a workaround for the broken * variable field width syntax, specifying ~*~a where the extra ~ in the middle just feeds a character that the broken state machine expects. These workarounds broke when I fixed the formatting, making -v mode useless.
* Version 84.txr-84Kaz Kylheku2014-03-076-17/+83
|
* * lib.c (upop): New function.Kaz Kylheku2014-03-074-8/+31
| | | | | | | | | | | | | | * lib.h (upop): Declared. * txr.c (txr_main): Two bugfixes. One is that the argument - was being pushed back twice resulting in *args* being ("-" "-"). This is because the option processing loop checked for "-" and pushed it back into args, and then some logic after the loop pushed arg back into args again. But, these pushes were wrong because they push back a different cons cell; we would like to be able to do (ldiff *full-args* *args*). This is solved by upop, which provides one element of undo. After upop, we can restore the prior list from the undo save location.
* * lib.c (assert_s): New global variable.Kaz Kylheku2014-03-066-11/+148
| | | | | | | | | | | | | | | (obj_init): Intern assert symbol, store in assert_s. * lib.h (assert_s): Declared. * match.c (typed_error, v_assert, h_assert): New static functions. (dir_tables_init): Register v_assert and h_assert. Register assert_s as non-data-matching directive. * unwind.c (uw_init): Register assert as a subtype of error. * txr.1: Describe assert.
* * match.c: (v_next): Set the "curfile" in the context to "env" whenKaz Kylheku2014-03-062-1/+9
| | | | | | scanning environment. (open_data_source): Regression: was not setting c->curfile when opening anything.
* * eval.c (apply_intrinsic, lazy_mapcar): Changed linkage to external.Kaz Kylheku2014-03-067-75/+161
| | | | | | | | | | | | | * eval.h (apply_intrinsic, lazy_mapcar): Declarations added. * stream.c (open_files, open_file_star): New functions. (stream_init): Registered new functions as intrinsics. * txr.1: Documented open-files and open-files*. Added to make-catenated-stream documentation. * genvim.txr: Replace bunch of code with open-files. * txr.vim: Regenerated.
* * match.c (match_files): Fix it again. The data (nil)Kaz Kylheku2014-03-062-1/+6
| | | | can occur from an interactive/real-time stream.
* g++ regressions.Kaz Kylheku2014-03-064-4/+16
| | | | | | | | | | * eval.c (env_k): Duplicate global variable definition removed. * lib.c (vector, vec_set_length): Fixed signed/unsigned comparison warnings. * stream.h (stdin_s, stdout_s, stddebug_s, stderr_s, stdnull_s): Declarations were definitions due to missing extern.
* * txr.c (txr_main): Don't push back arg into arg_list if arg is nil.Kaz Kylheku2014-03-052-2/+8
|
* Fixing regression caused by the 2014-02-19 change ("Fixed long-runningKaz Kylheku2014-03-052-2/+24
| | | | | | | | | | | | | | | issue ..."). * match.c (open_data_source): if c->data is t, but c->files is nil, set c->data to nil: we cannot possibly open anything later. (match_files): We need to call open_data_source one more time just before processing a line with horizontal material. The previous call(s) to open_data_source might not have opened anything. Before accesing car(c.data) the correct test is consp(c.data), not c.data. In the else clause, we now specificially check for nilp(c.data) which is the correct indicator of no more data. If c.data is any other atom at that point, we have an internal error, for which an assertion is added now.
* * stream.c (vformat): Fix broken parsing of parameteric width andKaz Kylheku2014-03-053-47/+84
| | | | | | | | | | | | precision (i.e. given by *). The simplest way to do this is to add a state vf_star which is similar to vf_digits, and reuses much of the logic via a goto. Fixing forgotten --fmt (push back char) when moving from vf_precision to vf_spec state due to unhandled character. Also, allowing a leading zero before a precision given as * so that computed precisions can be combined with zero padding. * txr.1: Documented leading zero better so it is clear it combines with *. Restructured documentation.
* * stream.c (put_line): Default string argument to empty string.Kaz Kylheku2014-03-053-4/+13
| | | | | | | (stream_init): Change how put_line is registered to take advantage of new optional parameter. * txr.1: Updated.
* * arith.c (logten): New function.Kaz Kylheku2014-03-045-1/+22
| | | | | | | | * eval.c (eval_init): logten registered as intrinsic. * lib.h (logten): Declared. * txr.1: Documented.
* * parser.l: Allowing ^ to be a quote character, and adjusting definitionKaz Kylheku2014-03-0312-225/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of identifiers to rule this out from being the first character of a symbol which has no prefix. Recognize the ^ character as a token in the NESTED state. * lib.c (obj_print, obj_pprint): Render sys:qquote as ^. * parser.y (choose_quote): Function removed. (n_expr): Recognize '^' as quasiquote. Removed all the "smart quote" hacks that try to make quote behave as quote or quasiquote, or try to cancel out unquotes and quotes. * tests/009/json.txr: Fixed to ^ quasiquote. * tests/010/reghash.txr: Likewise. * tests/011/macros-2.txr: Likewise. * tests/011/mandel.txr: Likewise. * tests/011/special-1.txr: Likewise. * txr.1: Updated docs. * genvim.txr: Revamped definitions for txr_ident and txl_ident so that unqualified identifiers cannot start with # or ^, but ones with @ or : in front can start with these characters. * txr.vim: Regenerated.
* Fix bad .TP syntax.Kaz Kylheku2014-03-031-3/+7
|
* * Makefile (lex.yy.c): Remove lex.yy.c before trying to regenerate it.Kaz Kylheku2014-03-022-1/+10
| | | | | | (y.tab.c, y.tab.h): Remove y.tab.c before running yacc. Write-protect y.tab.c, not $@, which could expand to the y.tab.h target if that is what triggered the rule.
* * txr.1: Incorporating more corrections from Roman Mishin.Kaz Kylheku2014-03-022-39/+35
|
* * eval.c (make_env_intrinsic): New static function.Kaz Kylheku2014-03-023-0/+65
| | | | | | (eval_init): Register new intrinsics make-env, env-fbind and env-vbind. * txr.1: Documented.
* Version 83txr-83Kaz Kylheku2014-03-026-8/+57
| | | | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version, set date. * configure (txr_ver): Bumped. * RELNOTES: Updated * dep.mk: Updated.
* * eval.c (expand): Bugfix. When processing a defvar, should markKaz Kylheku2014-03-022-0/+9
| | | | | | the variable as special at expansion time. Without this, binding forms in other parts of the tree won't be expanded properly to bring about the special semantics.
* * parser.y (unquotes_occur): Fix use of unquote_s rather than sys_unquote_sKaz Kylheku2014-03-023-2/+13
| | | | | | | | | which breaks backquote, caught by tests/010/reghash.txr. I thought fixed this already! But I must have made the change to y.tab.c rather than parser.y. * Makefile (lex.yy.c, y.tab.c): Make these files readonly to prevent unintended edits.
* * genvim.txr: Skip lines that contain system_package.Kaz Kylheku2014-03-023-135/+147
| | | | * txr.vim: Regenerated.
* Bugfix: catenated stream objects not hooked into garbage collector,Kaz Kylheku2014-03-022-1/+15
| | | | | | | causing premature collection of the catenated stream list. * stream.c (cat_mark): new function. (cat_stream_ops): use cat_mark for gc mark function.
* New quasiquote idea: let's have two quasiquote macros sharing oneKaz Kylheku2014-03-016-66/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expander. One macro based on sys:qquote, sys:unquote and sys:splice, and the other based on qquote, unquote and splice in the user package. The read syntax puts out the sys: one. * eval.c (expand_qquote): Takes three additional arguments: the qquote, unquote and splice symbols to recognize. The invalid splice diagnostic is adjusted based on which backquote we are expanding. (me_qquote): Look at the symbol in the first position of the form and then expand either the internal quasiquote macro or the public one, passing the right symbols into expand_qquote. (eval_init): Register error-throwing stub functions for the sys_qquote_s, sys_unquote_s and sys_splice_s symbols. Register a macro for sys_qquote_s. * lib.c (sys_qquote_s, sys_unquote_s, sys_splice_s): New symbol variables. (obj_init): Initialize new variables. Change qquote_s, unquote_s and splice_s to user package. (obj_print, obj_pprint): Convert only sys_qquote_s, sys_unquote_s and sys_splice_s to the read syntax. The quote_s, unquote_s and splice_s symbols are not treated specially. * lib.h (sys_qquote_s, sys_unquote_s, sys_splice_s): Declared. * parser.y (n_expr): Use sys_qquote_s, sys_unquote_s and sys_splice_s rather than qquote_s, unquote_s and splice_s. (unquotes_occur): Likewise. * txr.1: Documented.
* * configure: changed numerous "if ! conftest" tests to "if conftest",Kaz Kylheku2014-03-012-66/+72
| | | | swapping around the consequent and alternative clauses.
* * configure (conftest, conftest_o): New functionsKaz Kylheku2014-03-012-71/+69
| | | | | | Use functions throughout tests instead of repeated code for removing target, invoking make with redirection and testing for existence of target.
* * tests/011/special-1.txr: Add some coverage for evaluationKaz Kylheku2014-03-012-1/+9
| | | | | | of a re-bound special under the Lisp-1 evaluation of the [ ] notation. This test case would have failed three commits back.
* * eval.c (expand_qquote): Another bugfix: not recognizing a trailingKaz Kylheku2014-03-012-1/+10
| | | | | | atom that comes out of recursive call, wrapped in (quote ...), resulting in '(,a . b) expanding to (append 'a . quote b) rather than (append (list 'a) (quote b)); i.e. (append (list 'a) 'b).
* * eval.c (lookup_sym_lisp1): Bugfix: wasn't following the dynamicKaz Kylheku2014-03-012-25/+31
| | | | | environment at all, and still had vestiges of support for the the old cptr based global variables.
* * Makefile: Use target-specific assignmentKaz Kylheku2014-02-282-0/+8
| | | | | to suppress TXR_DBG_OPTS for tests under tests/011. The --gen-gc makes mandel.txr run too slow.
* * eval.c (self_evaluating_p, maybe_quote): New functions.Kaz Kylheku2014-02-282-1/+27
| | | | | (expand): Use maybe-quote form macro-time, to not quote result unnecessarily.
* * tests/011/mandel.expected: New file.Kaz Kylheku2014-02-283-0/+129
| | | | * tests/011/mandel.txr: New file.
* Turn *gensym-counter* into proper special variable.Kaz Kylheku2014-02-284-6/+26
| | | | | | | | | | | | | | | | | * eval.c (eval_init): Save *gensym-counter* symbol in gensym_counter_s symbol variable right after interning, and use zero as the inital value rather than the gensym_counter variable which is removed now. * lib.c (gensym_counter_s): New symbol variable. (gensym_counter): Variable removed. (gensym): Slight refactoring to avoid a double variable lookup. Also, for generational GC correctness, use the set macro to update it, since the variable could live inside heap object and the counter could overflow to bignums which are heap objects. (obj_init): Remove initialization of gensym_counter. * lib.h (gensym_counter_s): Declared. (gensym_counter): Declaration removed, replaced by macro.
* Change in the design of how special variables work, to fix the brokenKaz Kylheku2014-02-2818-386/+386
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | re-binding. C code now has to go through the dynamic environment lookup to access things like *random-state*, or *stdout*. As part of this, I'm moving some intrinsic variable and function initializations out of eval.c and into their respective modules. Macros are are used to make global variables look like ordinary C variables. This is very similar to the errno trick in POSIX threads implementations. * eval.c (looup_var, lookup_var_l): Restructured to eliminate silly goto, the cobjp handling is gone. (reg_fun, reg_var): Internal function becomes external. reg_var registers a simple cons cell binding now, without any C pointer tricks to real C global variables. (c_var_mark): Static function removed. (c_var_ops): Static struct removed. (eval_init): Numerous initializations for streams, syslog, rand, signals and others moved to their respective modules. The new symbol variables user_package_s, keyword_package_s and system_package_s are interned here, and the variables are created in a special way. * eval.h (reg_var, reg_fun): Declared. * gc.c (prot1): Added assert that the loc pointer isn't null. This happened, and blew up during garbage collection. * lib.c (system_package, keyword_package, user_package): Variables removed these become macros. (system_package_var, keyword_package_var, user_package_var): New global variables. (system_package_s, keyword_package_s, user_package_s): New symbol globals. (get_user_package, get_system_package, get_keyword_package): New functions. (obj_init): Protect new variables. Initialization order of modules tweaked: the modules sig_init, stream_init, and rand_init are moved after eval_init because they register variables. * lib.h (keyword_package, system_pckage, user_package): Variables turned into macros. (system_package_var, keyword_package_var, user_package_var): Declared. (system_package_s, keyword_package_s, user_package_s): Declared. (get_user_package, get_system_package, get_keyword_package): Declared. * rand.c (struct random_state): Renamed to struct rand_state to avoid clash with new random_state macro. (random_state): Global variable removed. (random_state_s): New symbol global. (make_state, rand32, make_random_state, random_fixnum, random): Follow rename of struct random_state.
* * eval.c (op_defvar): Remove the same-named symbol macro when aKaz Kylheku2014-02-282-0/+24
| | | | | | | | | | | | variable is defined. (op_defsymacro): Remove the same-named variable when a symbol macro is defined. (op_defun): Throw excpetion if an attempt is made to define a special operator as a function. Remove the same-named macro when a function is defined. (op_defmacro): Throw excpetion if an attempt is made to define a special operator as a macro. REmove the same-named function when a macro is defined.
* * eval.c (expand_qquote): Fix broken '(,x . ,y) case, whichKaz Kylheku2014-02-282-2/+13
| | | | | | | | is generating (append (list x) . y) instead of (append (list x) y). Also, added a nil case which is now necessary to prevent '(,x) from generating (append (list x) nil), though this is effectively an optimization, which is pointless, since the expander isn't optimizing overall.
* * tests/010/output-clauses.expected: New file.Kaz Kylheku2014-02-283-0/+84
| | | | * tests/010/output-clauses.txr: New file.
* About time for some new regression tests.Kaz Kylheku2014-02-287-0/+90
| | | | | | | | | | | | | | * tests/011/macros-1.expected: New file. * tests/011/macros-1.txr: New file. * tests/011/macros-2.expected: New file. * tests/011/macros-2.txr: New file. * tests/011/special-1.expected: New file. * tests/011/special-1.txr: New file.
* Bugfixing semantics of symbol macro hiding by variable bindings.Kaz Kylheku2014-02-282-6/+31
| | | | | | | | | | | | | * eval.c (expand_vars): Expand vars needs to know whether it's handling a sequential (let*-like) or parallel (let-like) binding. The init form of a variable sees the previous macro environment, but that variable must, for the remaining variables, shadow any previous symbol macro. (expand): In expand we must inform expand_vars whether we have a sequential or parallel binding construct. Moreover, there was a huge bug here: the new_menv (with the shadows) was passed to expand_vars, so that all the variables were hiding same-named symbol macros from all their initforms.
* * eval.c (delay_s): Global variable removed.Kaz Kylheku2014-02-273-3/+13
| | | | | | | | (eval_init): Initialiation of delay_s removed. Symbol now interned in reg_mac call for registering me_delay . * genvim.txr: Updated to recognize a reg_mac call with intern.
* * txr.1: Improved documentation for the dwim operator.Kaz Kylheku2014-02-272-12/+32
|
* differently, not different.Kaz Kylheku2014-02-271-1/+1
|
* Fix naked backslashes to \e. I could have sworn I did this recently.Kaz Kylheku2014-02-271-18/+18
|
* Typos.Kaz Kylheku2014-02-271-2/+2
|
* Version 82.txr-82Kaz Kylheku2014-02-276-114/+174
|
* * txr.1: Typos, grammar and formatting fixes mailed inKaz Kylheku2014-02-272-11/+16
| | | | by Roman Mishin.