| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* eval.c (expand_qquote): Corrected awkward error message text
which was saying that a splice "cannot occur as an atom".
|
|
|
|
|
|
| |
* place.tl (pset): New macro.
* lisplib.c (set_place_dlt_entries): Add pset.
|
|
|
|
| |
arguments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
out of make_obj into gc.
|
|
|
|
|
|
| |
* eval.c (expand_progn): New function.
(do_expand): Use expand_progn for constructs
which have an implicit progn body.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
* lib.c (init): Initialize parser, syslog and glob modules
here.
* txr.c (main): Remove initialization of parser, syslog and glob
modules from here.
|
|
|
|
| |
rather than disabling async signals.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* lib.c (obj_print, obj_pprint): Fix mistake in the test for
properly formed lambda syntax whcih is printed specially.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
* eval.c (me_mlet): New static function.
(eval_init): Registered mlet macro.
* txr.1: Documented mlet.
|
|
|
|
|
| |
the user package directly, not the value of the *user-package*
variable.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
array after a gc is moved into the gc function.
|
|
|
|
| |
rather than FULL_GC_INTERVAL - 1, since it is pre-incremented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_lcons): New function.
(eval_init): Registered lcons macro.
* txr.1: Documented lcons.
* tl.vim, txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* sysif.c (exit_star_wrap): New static function.
(sysif_init): Registered exit* intrinsic.
* txr.1: Documented exit*.
* tl.vim, txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Detect chmod.
* sysif.c (chmod_wrap): New function.
(sysif_init): Register chmod intrinsic.
* txr.1: Documented.
* tl.vim, txr.vim: Regenerated.
|
|
|
|
|
|
|
| |
* eval.c (me_dotimes): New function.
(eval_init): Registering dotimes macro.
* txr.1: Documented dotimes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 (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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
| |
no need to intern the symbol when registering me_until.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|