summaryrefslogtreecommitdiffstats
path: root/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
* Improve error message related to splice misuse.Kaz Kylheku2015-05-091-0/+7
| | | | | * eval.c (expand_qquote): Corrected awkward error message text which was saying that a splice "cannot occur as an atom".
* Adding pset operator.Kaz Kylheku2015-05-091-0/+8
| | | | | | * place.tl (pset): New macro. * lisplib.c (set_place_dlt_entries): Add pset.
* * place.tl (set): Take multiple place/value pairs. Allow zeroKaz Kylheku2015-05-091-0/+5
| | | | arguments.
* Crack down on redefinitions of built-ins.Kaz Kylheku2015-05-081-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | * eval.c (builtin, eval_initing): New global variable. (op_defun, op_defmacro): During initialization, record functions and macros in builtin hash. (builtin_reject_test): New static function. (expand_macrolet): Perform builtin reject test for fbind, lbind, and macrolet. (regfun, reg_mac): Add symbol to builtin hash. (eval_init): GC-protect new hash table variable and initialize it. Set eval_initing to true over eval initialization. The flip function is renamed fo flipargs. (eval_compat_fixup): New function, for dealing with the operator/function conflict over flip. * eval.h (eval_compat_fixup): Declared. * lib.c (compat_fixup): Call eval_compat_fixup. * tests/011/macros-2.txr: This test was defining a macro called while which is now illegal. Renamed to whilst. * tests/011/macros-2.expected: Regenerated. * txr.1: Function flip renamed to flipargs and documented in Compatibility section.
* * Makefile (LISP_TO_C_STRING): Strip comments, but not comment lines,Kaz Kylheku2015-05-071-0/+19
| | | | | | | | | | | | | | | | | | so line numbers don't change. * eval.c (eval_init): Fix registrations of lisp-parse and read. * lisplib.c (place_instantiate): Give name to parsed string stream using new lisp_parse argument. * parser.c (lisp_parse): Takes new argument to override name. * parser.h (lisp_parse): Declaration updated. * txr.c (txr_main): Call lisp_parse with four args, defaulting the new one. * txr.1: Documented new argument.
* New macro-based framework for assignment places.Kaz Kylheku2015-05-061-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The operators set, inc, dec, pop and others are now macros which generate code, rather than built-in special forms that use "C magic". Moreover, new such macros are easy to write, and several new ones are already available. Moreover, new kinds of assignable places are easy to create. * place.tl: New file. * lisplib.c, lisplib.h: New files. * Makefile (OBJS): New target, lisplib.o. (GEN_HDRS): New variable. (LISP_TO_C_STRING): New recipe macro, with rule. (clean): Remove generated headers named in $(GEN_HDRS). * eval.c (dec_s, push_s, pop_s, flip_s, del_s): Variables removed. (setq_s): New variable. (lookup_var, lokup_sym_lisp_1, lookup_var_l, lookup_fun, lookup_mac, lookup_symac, lookup_symac_lisp1): Trigger the delayed loading of libraries for undefined global symbols, and re-try the lookup. (op_modplace, dwim_loc, force_l): Static functions removed. (op_setq): New static function. (eval_init): Initialize setq_s; remove initializations of removed variables; remove registrations for op_modplace; add registration for sys:setq, sys:rplaca, sys:rplacd, sys:dwim-set and sys:dwim-del intrinsics. Call lisplib_init to initialize the dynamic library loading module. * lib.c (sys_rplaca, sys_rplacd): New functions, differing in return value from rplaca and rplacd. (ref, refset): Handle hash table. (dwim_set, dwim_del): New functions. * lib.h (sys_rplaca, sys_rplacd, dwim_set, dwim_del): Declared. * genvim.txr: Include place.tl in scan. * tests/010/seq.txr: The del operator test case no longer throws at run-time but at macro-expansion time, so the test case is simply removed. * tests/010/seq.expected: Updated output. * tests/011/macros-2.txr: Reset *gensym-counter* to zero, because the textual output of the test case includes gensyms, whose numberings fluctuate with the content of the new Lisp library material. * tests/011/macros-2.expected: Updated output.
* * gc.c (make_obj, gc): Move resetting of prev_malloc_bytesKaz Kylheku2015-05-061-0/+5
| | | | out of make_obj into gc.
* Do some cleanup in progn-like form sequences.Kaz Kylheku2015-05-051-0/+8
| | | | | | * eval.c (expand_progn): New function. (do_expand): Use expand_progn for constructs which have an implicit progn body.
* Deal with bad quote syntax.Kaz Kylheku2015-05-031-0/+9
| | | | | | | * eval.c (op_quote): Throw error on bad syntax. * lib.c (obj_print, obj_pprint): Do not hide bad quote syntax using ' notation; print it using ordinary notation.
* Move initialization calls to more suitable place.Kaz Kylheku2015-05-011-0/+10
| | | | | | | | * lib.c (init): Initialize parser, syslog and glob modules here. * txr.c (main): Remove initialization of parser, syslog and glob modules from here.
* * signal.h (sig_save_disable): Bugfix: macro enablingKaz Kylheku2015-05-011-0/+5
| | | | rather than disabling async signals.
* Fix corruption triggered by extended gc disabling.Kaz Kylheku2015-05-011-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue is that when gc is disabled, the gc function does nothing. But various code depends on calls to gc() doing something, like making space available in various static arrays. When gc is disabled for long periods, there are issues, like array overruns. * gc.c (gc): Must no longer be called at all if gc_enabled is false, and asserts that it is true. Callers must check the gc_enabled flag and implement appropriate cases. (make_obj): Only call gc when gc_enabled is true. If there is no space in the freshobj array after trying gc, or gc couldn't be tried because it is disabled, then schedule a full gc. (gc_set): If the checkobj array is full, only call gc if gc is enabled, otherwise schedule a full_gc. (gc_mutated): Do not assume that the mutobj array has room for another object; only set the object's generation to -1 and put it into the array if there is room. Similarly to gc_set, do a gc if there is no room, but if gc is not enabled, then schedule a full gc. (gc_wrap): Only call gc if gc_enabled is true, and return t in that case rathe than nil. * txr.1: Document return value of sys:gc function.
* Fix source location for dangling unquotes and splices.Kaz Kylheku2015-04-301-0/+12
| | | | | | | | | | * parser.y (grammar): Propagate the parser line number to the unquote or splice form, if it has not received location info from its operand (because its operand is an atom). In the quasi_item case, we also use rlcp_tree to make sure the info is propagated through the list being consed up. (rlcp_tree): Bugfix: propagate the source location info to every cons in the list itself, not just into their cars.
* Improved syntax checking: defun, flet, labels, lambda.Kaz Kylheku2015-04-291-0/+16
| | | | | | | | | | | | | | * eval.c (check_lambda_list): New static function. (op_defun): Argument list checking moved into check_lambda_list, which is called for defun out of do_expand. Name checks moved into do_expand. Thus, defun is checked earlier, at expansion time. (me_flet_labels): Check the lambda list of each lexical function with check_lambda_list. (do_expand): Check the syntax of the lambda form, and the validity of its argument list. Check the name of a defun or defmacro for validity. Check the validity of the defun argument list.
* Bugfix: cannot print (lambda . 42) structure.Kaz Kylheku2015-04-291-0/+7
| | | | | * lib.c (obj_print, obj_pprint): Fix mistake in the test for properly formed lambda syntax whcih is printed specially.
* Adding poll function.Kaz Kylheku2015-04-281-0/+16
| | | | | | | | | | | | | | * configure: Check for the poll function and set HAVE_POLL accordingly in config.h. * stream.h (fd_k): External declaration added. * sysif.c (poll_wrap): New function. (sysif_init): Registered poll-in, poll-out, poll-err, poll-pri, poll-rdhup, poll-nval, poll-rdband, poll-wrband variables and poll function. * txr.1: Documented poll.
* Version 107.txr-107Kaz Kylheku2015-04-261-0/+12
|
* Allow (force ...) to be an assignable place.Kaz Kylheku2015-04-251-0/+16
| | | | | | | | | | | | | | This allows mlet variables to be assignable. * eval.c (force_s): New global variable. (op_modplace): Handle force form. (me_mlet): Use force_s symbol. (force_l): New static function. (eval_init): Initialize force_s variable. Use it in registration of force function. * txr.1: Remove text in mlet definition that variables are not assignable. Replace with note about an unspecified behavior.
* Introducing mlet macro.Kaz Kylheku2015-04-251-0/+9
| | | | | | | * eval.c (me_mlet): New static function. (eval_init): Registered mlet macro. * txr.1: Documented mlet.
* * lib.c (symbol_package): If the argument is nil, returnKaz Kylheku2015-04-251-0/+6
| | | | | the user package directly, not the value of the *user-package* variable.
* Remove silly package lookup from keywordp.Kaz Kylheku2015-04-251-0/+12
| | | | | | | | | | This tiny change yields a 165% (2.65X) speedup in the tst/tests/011/mandel.txr test case. * lib.c (keywordp): Use keyword_package_var instead of the keyword_package macro which looks up the global environment. * parser.y (sym_helper): Likewise.
* Regression: runaway allocation of heaps.Kaz Kylheku2015-04-241-0/+12
| | | | | | | | | | * gc.c (make_obj): Fix regression introduced on 2014-10-18, released in TXR 100. Because make_obj discontinues placing objects into the freshobj_array when the full_gc flag has been set, it is incorrect to allocate another heap when the free list is exhausted and the freshobj_array has room remaining. It has room remaining because it is disused.
* * gc.c (make_obj, gc): The check for insufficient space in freshobjKaz Kylheku2015-04-241-0/+5
| | | | array after a gc is moved into the gc function.
* * gc.c (gc): Minor off-by-one: compare gc_counter to FULL_GC_INTERVALKaz Kylheku2015-04-241-0/+5
| | | | rather than FULL_GC_INTERVAL - 1, since it is pre-incremented.
* Switch to in-tree mpi directory.Kaz Kylheku2015-04-221-0/+18
| | | | | | | | | | | | | | | | * Makefile (CFLAGS, MPI_OBJS): Refer to mpi directory without version number. (repatch): Target removed. (distclean): Don't try to remove old unpacked tarball mpi directory. * configure (mpi_version, have_quilt, have_patch): Variables removed. (gen_config_make): Do not generate mpi_version make variable. Do not test for quilt or patch. No longer extract MPI tarball or try to apply patches. * mpi-1.8.6.tar.gz: File removed. * mpi-patches: Directory and all files under it removed.
* delay/force overhaul.Kaz Kylheku2015-04-221-0/+15
| | | | | | | | | | | | | * eval.c (promise_forced_s, promise_inprogress_s): New symbol variables. (me_delay): Change representation of promises so that the original delay form is stashed there for better reporting in the force function. Also, propagate the debug info from the second argument of the form to the entire form; otherwise it will inherit it from elsewhere. (force): Rewritten to follow new three-state representation to detect the recursive case and diagnose it. (eval_init): Register new symbol variables.
* ChangeLog fixup: "Version 106" missing.Kaz Kylheku2015-04-211-0/+2
|
* Version 106.txr-106Kaz Kylheku2015-04-211-0/+8
|
* Bugfix: throwing error when trying to print valid regexps.Kaz Kylheku2015-04-191-0/+8
| | | | | | * regex.c (print_rec): Only dianose "bad object in regex syntax" for some atom other than nil, which denotes an empty (sub)expression, like what results from #// or #/a|/ and such.
* Do not allow unrecognized escapes in regex.Kaz Kylheku2015-04-191-0/+14
| | | | | | | | | | | | * parser.l (REGOP): New regex alias for matching all regex special characters. (grammar): Several rules for regex special characters merged together. New rule introduced to match a special character after a backslash, making it literal. The old rule which makes literal any character after a backslash now throws an error, unless version 105 comaptibility is selected. * txr.1: Documented this behavior change.
* Improvement in error reporting.Kaz Kylheku2015-04-191-0/+14
| | | | | | | | | | | | This fix prevents certain situations when an inappropriate form is reported, in the default unhandled exception handler, as pertaining to an error. * eval.c (do_eval): Save and restore the last_form_evaled, in an exception-unsafe way. If we successfully evaluate a form or subform, we can restore the previous one. (expand): Save and restore last_form_expanded similarly. We don't need the unwind block and counter.
* Adding lcons macro.Kaz Kylheku2015-04-181-0/+11
| | | | | | | | | * eval.c (me_lcons): New function. (eval_init): Registered lcons macro. * txr.1: Documented lcons. * tl.vim, txr.vim: Regenerated.
* Adding getenv, setenv and unsetenv.Kaz Kylheku2015-04-181-0/+16
| | | | | | | | | | | | | | * lib.c (setenv, unsetenv): Changed static functions to external. Moved them out of the #if !HAVE_TIMEGM block. * lib.h (setenv, unsetenv): Declared. * sysif.c (getenv_wrap, setenv_wrap, unsetenv_wrap): New functions. (sysif_init): Registered getenv, setenv and unsetenv. * txr.1: Documented getenv, setenv and unsetenv. * tl.vim, txr.vim: Regenerated.
* Fix quasistring regression introduced in TXR 81.Kaz Kylheku2015-04-181-0/+10
| | | | | | | | * parser.y (expand_meta): This function must recognize quasistrings, inside (sys:quasi ...) forms, (sys:var ...) forms do not denote TXR Lisp variables. These must not be expanded. Doing so is not only wrong, but the way it was done broke brace variables by stripping their arguments.
* Adding exit* function which calls _exit.Kaz Kylheku2015-04-161-0/+11
| | | | | | | | | * sysif.c (exit_star_wrap): New static function. (sysif_init): Registered exit* intrinsic. * txr.1: Documented exit*. * tl.vim, txr.vim: Regenerated.
* Add exec and pipe functions.Kaz Kylheku2015-04-161-0/+13
| | | | | | | | | | | * configure: Check for pipe. * sysif.c (exec_wrap, pipe_wrap): New static functions. (sysif_init): Register exec and pipe intrinsics. * txr.1: Documented exec and pipe. * tl.vim, txr.vim: Regenerated.
* Adding chmod.Kaz Kylheku2015-04-161-0/+13
| | | | | | | | | | | * configure: Detect chmod. * sysif.c (chmod_wrap): New function. (sysif_init): Register chmod intrinsic. * txr.1: Documented. * tl.vim, txr.vim: Regenerated.
* Adding dotimes macro.Kaz Kylheku2015-04-161-0/+9
| | | | | | | * eval.c (me_dotimes): New function. (eval_init): Registering dotimes macro. * txr.1: Documented dotimes.
* Fix escaping issues in open-process on Windows.Kaz Kylheku2015-04-151-0/+17
| | | | | | | | | | | | | | | This can now execute programs with spaces in their path names. Arguments can contain embedded double quotes, and other characters that are special to cmd.exe, like &, |, (, ), ^ and others. * stream.c (string_extend_count, win_escape_cmd): New static functions. (win_escape_arg): Fix and extend escaping scheme to cover not only the argument processing scheme implemented by programs which use Microsoft's C library, but also to smuggle the command line through cmd.exe. (win_make_cmdline): Use win_escape_cmd to wrap the command. Escape the quotes which are placed around arguments, so cmd.exe doesn't interpret them, which will cause it to suppress its processing of the caret escapes.
* Allow quasiquotes in braces and quasiliterals, and quotes in braces.Kaz Kylheku2015-04-151-0/+11
| | | | | | | | | * parser.l: Consolidate rules for recognizing quote, unquote, and quasiquote. An effect of this is that quasiquotes can now occur in braces and in string quasiliterals. * parser.y (quasi_item): Support quotes and quasiquotes as quasi items: that is to say, i.e. objects denoted by @ in a quasiliteral.
* Diagnose trailing junk in numeric literals.Kaz Kylheku2015-04-141-0/+9
| | | | | | | * parser.l: Combining the handling of hex, octal and binary numeric literals into a single rule. Implementing an additional rule which diagnoses such tokens that have trailing junk. Thus, something like #x1F2AZ is now invalid syntax.
* Implementing while* and until* loops.Kaz Kylheku2015-04-111-0/+13
| | | | | | | | | | | * eval.c (while_star_s, until_star_s): New symbol variables. (me_while_star, me_until_star): New static functions. (eval_init): Initialize new variables. Register while* and until* macros. * txr.1: Documented while* and until*. * txr.vim, tl.vim: Regenerated.
* * sysif.c: Use HAVE_FORK_STUFF to wrap fork, waitpid and dup/dup2.Kaz Kylheku2015-04-111-0/+4
|
* Exposing dup and dup2.Kaz Kylheku2015-04-111-0/+12
| | | | | | | | | | * sysif.c (dup_wrap): New static function. (sysif_init): Register dup_wrap as dupfd. The name dup conflicts with an existing function. * txr.1: Documented dupfd. * txr.vim, tl.vim: Regenerated.
* Functions open-fileno and fileno.Kaz Kylheku2015-04-101-0/+18
| | | | | | | | | | | | | | | | * stream.c (fd_k): New keyword variable. (stdio_get_prop): Handle the :fd property by returning the file descriptor. (open_fileno): New function. (stream_init): Initialize fd_k, and register fileno and open-fileno. * stream.h (open_fileno): Declared. * txr.1: Documented open-fileno and fileno. * utf8.c (w_fdopen): New function. * utf8.h (w_fdopen): Declared.
* * gc.c (sweep): Fix comment referring to nonexistent identifier.Kaz Kylheku2015-04-101-0/+4
|
* * eval.c (eval_init): There is an until_s global variable, soKaz Kylheku2015-04-101-0/+5
| | | | no need to intern the symbol when registering me_until.
* Fork and wait support.Kaz Kylheku2015-04-091-0/+16
| | | | | | | | | | | | | | * sysif.c (work_wrap, wait_wrap, wifexited, wexitstatus, wifsignaled, wtermsig, wcoredump, wifstopped, wstopsig, wifcontinued): New static functions. (sysif_init): Register new intrinsics: functions fork, wait, w-ifexited, w-exitstatus, w-ifsignaled, w-termsig, w-coredump, w-ifstopped, w-stopsig, w-ifcontinued; and variables w-nohang, w-untraced, w-continued. * txr.1: Documented. * tl.vim, txr.vim: Regenerated.
* * eval.c (iflet_s, when_s): New global variables.Kaz Kylheku2015-04-061-0/+12
| | | | | | | | | | | (me_iflet_whenlet): New static function. (eval_init): Initialize when_s, iflet_s. Use when_s for registering me_when. Register me_iflet_whenlet. * txr.1: Documented iflet and whenlet. * tl.vim, txr.vim: Regenerated.
* New whilet macro.Kaz Kylheku2015-04-051-0/+13
| | | | | | | | | | | * eval.c (while_s): New symbol variable. (me_whilet): New static function. (eval_init): Initialize while_s. Use while_s in registration of while macro. Register new whilet macro. * txr.1: whilet is documented. * tl.vim, txr.vim: Regenerated.