| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (PROG): Removing ./ prefix from variable name; adding it
to invocations of $(PROG) in some rules.
(txr.o): Pass several strings as macros on the command line:
TXR_REL_PATH, EXE_SUFF and PROG_NAME.
* configure (bindir, datadir, mandir): These variables become
just relative paths from the prefix.
* txr.c (sysroot): Use the TXR_REL_PATH, EXE_SUFF and PROG_NAME
preprocessor symbols defined on the command line to avoid
hard-coding strings like "bin/txr" and "bin/txr.exe" which
actually should reflect the value of the bindir variable.
|
|
|
|
|
|
| |
Add missing parentheses in expression.
(sysroot_init): On Windows, filter progpath to change
backslashes to forward slashes.
|
|
|
|
| |
in old flexes too.
|
|
|
|
|
|
|
|
|
| |
the path based on the "sysroot" where it is actually installed.
* txr.c (progname_8u, progpath): New static variables.
(get_self_path, sysroot_helper, sysroot, sysroot_init): New
static functions. Sysroot creates a stdlib variable.
(main): Initialize progname_u8 value, and call sysroot_init.
|
|
|
|
|
|
| |
start argument.
* txr.1: Documented.
|
|
|
|
|
| |
bindings, and need the -B option. One test case does not
need the -l option which now implies -B.
|
|
|
|
|
|
| |
Also, put in missing check for -f being erroneously clumped.
* txr.1: Documented.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
be explicitly requested by the -B option.
* match.c (opt_nobindings): Variable removed.
(opt_print_bindings): New variable.
(extract): Print bindings or "false" if opt_print_bindings is true.
* stream.c (output_produced): Variable removed.
(stdio_put_string, stdio_put_char, stdio_put_byte): Remove
update of output_produced.
* stream.h (output_produced): Declaration removed.
* txr.1: Documentation updated.
* txr.c (txr_main): Option 'b' does nothing. 'B', 'l', 'a',
and '--lisp-bindings' set opt_print_bindings to 1.
* txr.h (opt_nobindings): Declaration removed.
(opt_print_bindings): Declared.
* unwind.c (uw_throw): When exiting due to a query error or
file error, print false when opt_print_bindings is true.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
namely that empty strings and vectors are not nil.
The nullify function is introduced. It is also exposed to
users, as is the existing make_like function.
* eval.c (mapcarv, mappendv, lazy_mapcar, lazy_mapcarv):
Use nullify to handle non-list inputs correctly.
(eval_init): Registering make_like and nullify as intrinsics.
* lib.c (copy_list, to_seq, list_collect_nconc, list_collect_append,
reverse, lazy_appendv_func, lazy_appendv, ldiff, memq, memql,
memqual, remq, remql, remqual, remove_if, keep_if, rem_lazy_rec,
remq_lazy, remql_lazy, remqual_lazy, remove_if_lazy, keep_if_lazy,
countqual, countql, countq, count_if, some_satisfy, all_satisfy,
none_satisfy, do_chain, chainv, do_and, andv, do_or, orv,
cat_vec, assoc, assql, mapcar, mapcon, mappend, sort, multi_sort,
find, find_if, posqual, posql, posq, pos, pos_if, set_diff,
search): Use nullify for correctness. Some functions fixed
so return sequence matches type of input sequence.
(nullify): New function.
* lib.h (nullify): Declared.
* txr.1: Documented nullify and ake-like.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (search_list): New static function.
(search): New function.
* lib.h (search): New function declared.
* txr.1: Documented.
* txr.vim: Regenerated.
|
| |
|
|
|
|
|
|
| |
catch backslashes occurring within a regex, not followed by a
character. This can happen in dynamically parsed regexes
such as "abc\\".
|
|
|
|
|
| |
numbers if they are defined. In a newer flex, they are prefixed
by YY_.
|
|
|
|
|
|
|
|
|
|
|
|
| |
from lang_flags. Adding a test for determining
which flag reveals BSD functions. This is due to the
braindamaged way feature selection macros work on
FreeBSD. There is no way to say "give me only the
functions from a certain version of the Unix spec,
plus traditional BSD functions", so we have to resort to
using the internal symbol __BSD_VISIBLE. Also, changing
the detection test for daemon function to the
pointer-based approach.
|
|
|
|
| |
This is subsumed by -D_XOPEN_SOURCE=500.
|
| |
|
|
|
|
|
|
|
|
|
| |
* configure: Use pointer-based test for timegm, because
-Werror=implicit-function-declaration does not work in the
gcc 4.2 used on FreeBSD 9.
* parser.l: Check for Flex 2.5.9 and earlier which don't
have yylex_destroy. Thanks to Marcus Breiing.
|
|
|
|
|
|
|
|
|
| |
/usr/bin/xpg4/sh shell. Solaris' /bin/sh does not like test
-e. Adding break to the new shell existence testing loop so we
use the first shell in the list. Solaris wants _XOPEN_SOURCE=500
to reveal certain functions. Fix breakage in the make utility
detection, and also use the $make variable everywhere instead
of make.
|
|
|
|
|
|
|
| |
We boostrap using #!/bin/sh, but try to detect a better shell
and re-execute the script with that shell. Furthermore, we now
set up the SHELL variable in config.make, so that make uses that
shell for executing build recipes.
|
|
|
|
|
|
| |
(op_dwim, dwim_locs): Removing silly logic of separately calling
eval_lisp1 on the functor, and eval_lisp1_args on its arguments, since
lisp1 evaluation treats all position the same way.
|
|
|
|
|
|
|
|
|
|
|
|
| |
it to be the cell, rather than the new value.
* eval.c (transform_op): Fix use of rplacd that uses return value.
(force): Likewise.
* lib.c (rplaca, rplacd): Return cons.
(rem_lazy_rec, obj_init): Fix use of rplacd that uses return value.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* eval.c (call): New static function.
(eval_args, op_call): Static functions removed.
(eval_init): call_s registered as operator rather than function.
* txr.1: Updated.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
some places. In particular, the test case
echo : | ./txr -c '@a:@a' -
breaks because of neglected LIT in do_match_line.
* arith.c (tofloat, toint): Handle LIT type in switch.
* lib.c (ref, refset, replace, update): Handle LSTR type.
* match.c (do_match_line, do_output_line): Handle LSTR and LIT
objects in switch.
|
|
|
|
| |
optional argument defaulting logic.
|
|
|
|
| |
headers.
|
|
|
|
| |
colon symbol.
|
|
|
|
| |
equivalence comparison for end test, rather than eql.
|
|
|
|
|
| |
Two objects which are equal floating-point values must be considered
eql even if they are distinct objects (not eq).
|
| |
|
| |
|
|
|
|
|
| |
to 8 * HEAP_SIZE from 2 * HEAP_SIZE to reduce frequency
of garbage collections.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GC. The issue being solved here is the accuracy of the gc_set function.
The existing impelmentation is too conservative. It has no generation
information about the memory location being stored, and so it assumes
the worst: that it is a location in the middle of a gen 1 object.
This is sub-optimal, creating unacceptable pressure against the
checkobj array and, worse, as a consequence causing unreachable gen 0
objects to be tenured into gen 1.
To solve this problem, we replace "val *" pointers with a structure
of type "loc" which keeps track of the object too, which lets us
discover the generation.
I tried another approach: using just a pointer with a bitfield
indicating the generation. This turned out to have a serious issue:
such a bitfield goes stale when the object is moved to a different
generation. The object holding the memory location is in gen 1, but the
annotated pointer still indicates gen 0. The gc_set function then
makes the wrong decision, and premature reclamation takes place.
* combi.c (perm_init_common, comb_gen_fun_common,
rcomb_gen_fun_common, rcomb_list_gen_fun): Update to new interfaces
for managing mutation.
* debug.c (debug): Update to new interfaces for managing mutation.
Avoid loc variable name.
* eval.c (env_fbind, env_fbind): Update to new interfaces
for managing mutation.
(lookup_var_l, dwim_loc): Return loc type and update to new interfaces.
(apply_frob_args, op_modplace, op_dohash, transform_op, mapcarv,
mappendv, repeat_infinite_func, repeat_times_func): Update to new
interfaces for managing mutation.
* eval.h (lookup_var_l): Declaration updated.
* filter.c (trie_add, trie_compress, trie_compress_intrinsic,
* build_filter, built_filter_from_list, filter_init): Update to new
* interfaces.
* gc.c (gc_set): Rewritten to use loc type which provides the exact
generation. We do not need the in_malloc_range hack any more, since
we have the backpointer to the object.
(gc_push): Take loc rather than raw pointer.
* gc.h (gc_set, gc_push): Declarations updated.
* hash.c (struct hash): The acons* functions use loc instead
of val * now.
(hash_equal_op, copy_hash, gethash_c, inhash, gethash_n, pushhash,
Change to how locations are passed around, for the sake of generational
GC. The issue being solved here is the accuracy of the gc_set function.
The existing impelmentation is too conservative. It has no generation
information about the memory location being stored, and so it assumes
the worst: that it is a location in the middle of a gen 1 object.
This is sub-optimal, creating unacceptable pressure against the
checkobj array and, worse, as a consequence causing unreachable gen 0
objects to be tenured into gen 1.
To solve this problem, we replace "val *" pointers with a structure
of type "loc" which keeps track of the object too, which lets us
discover the generation.
I tried another approach: using just a pointer with a bitfield
indicating the generation. This turned out to have a serious issue:
such a bitfield goes stale when the object is moved to a different
generation. The object holding the memory location is in gen 1, but the
annotated pointer still indicates gen 0. The gc_set function then
makes the wrong decision, and premature reclamation takes place.
* combi.c (perm_init_common, comb_gen_fun_common,
rcomb_gen_fun_common, rcomb_list_gen_fun): Update to new interfaces
for managing mutation.
* debug.c (debug): Update to new interfaces for managing mutation.
Avoid loc variable name.
* eval.c (env_fbind, env_fbind): Update to new interfaces
for managing mutation.
(lookup_var_l, dwim_loc): Return loc type and update to new interfaces.
(apply_frob_args, op_modplace, op_dohash, transform_op, mapcarv,
mappendv, repeat_infinite_func, repeat_times_func): Update to new
interfaces for managing mutation.
* eval.h (lookup_var_l): Declaration updated.
* filter.c (trie_add, trie_compress, trie_compress_intrinsic,
* build_filter, built_filter_from_list, filter_init): Update to new
* interfaces.
* gc.c (gc_set): Rewritten to use loc type which provides the exact
generation. We do not need the in_malloc_range hack any more, since
we have the backpointer to the object.
(gc_push): Take loc rather than raw pointer.
* gc.h (gc_set, gc_push): Declarations updated.
* hash.c (struct hash): The acons* functions use loc instead
of val * now.
(hash_equal_op, copy_hash, gethash_c, inhash, gethash_n, pushhash,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (make_obj): If we have room in the freshobj array,
but are out of objects, then call more. Without this,
we don't take proper advantage of this nursing area.
(gc): Set the full_gc flag after doing gc, in preparation
for next time. If we know full GC is coming, we can
adjust some behaviors. Increase the threshold for calling the more()
function to be the same as in the non-generational case:
less than 3/4 of the size of a heap scavenged.
(gc_set): Now does nothing if it is known that
a full gc is coming. Also, in the checkobj array overflow
case when we invoke gc, there is no point in adding obj
to the array, since it must have been promoted to the mature
generation.
(gc_mutated): Don't bother storing the object in the
array if a full GC is coming.
|
|
|
|
|
| |
struct tm from "GMT" to "UTC", so that the time_string_utc
function will use UTC for the %Z format.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
checkobj array (via the mut macro that expands to gc_mutated).
The garbage collector assumes that checkobj has only generation 0
objects, which all exist in the freshobj array, which is subject
to a sweep. So gen 1 objects in checkobj are never cleaned up
properly: they do not have their REACHABLE flag reset, or
their generation restored to 1. To fix this, a new array for these
objects is introduced separate from checkobj.
* gc.c (MUTOBJ_VEC_SIZE): New preprocessor symbol.
(mutobj, mutobj_idx): New static array and integer.
(mark_obj): Check for REACHABLE flag before checking the full_gc
flag and generation, since those cost additional memory accesses.
(mark): Mark the objects in the new mutobj array.
(sweep): Sweep the objects in the mutobj array.
(gc): Reset mutobx_idx to zero after gc.
(gc_set): Rearrange logic. In the case that the checkobj array
is full and a gc is done to make room, there is no point in
adding to the array: the gc pass moves all babies to generation 1,
so the object that was passed into the function is no longer a baby.
(gc_mutated): Rewrite in terms of mutobj rather than checkobj,
fixing the bug.
* HACKING: Improved documentation of GC. Describe mut macro
and mutobj array.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* combi.c (perm_init_common, comb_gen_fun_common,
rcomb_gen_fun_common): Use set macro instead of plain assignment.
* hash.c (hash_grow, copy_hash, hash_update_1): Use set macro
instead of plain assignment.
* lib.c (nreverse, lazy_appendv_func, lazy_appendv,
vec_push, refset): Use set macro instead of plain assignment.
(make_package): Assign all fields of the newly created PKG
object before calling a function which can trigger GC.
* parser.y (rlset): Use set macro.
|
|
|
|
|
|
|
|
|
|
| |
in in 2014-03-12, when prof was introduced.
The attempt to fix a bug made things worse.
* lib.c (adjust_bounds): New static function.
(chk_malloc, chk_calloc, chk_realloc): Replace existing logic with
call to adjust_bounds.
(chk_malloc_gc_more): Bugfix: add missing call to adjust_bounds.
|
| |
|
|
|
|
| |
* txr.vim: Regenerate.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(eval_init): Register me_quasilist as quasilist macro expander.
* lib.c (quasilist_s): New global variable.
(obj_init): quasilist_s initialized.
* lib.h (quasilist_s): Declared.
* match.c (do_txreval): Handle quasilist syntax.
* parser.l (QWLIT): New exclusive state.
Extend lexical grammar to transition to QWLIT state upon
the #` or #*` sequence which kicks off a word literal,
and in that state, piecewise lexically analyze the QLL,
mostly by borrowing rules from quasiliterals.
* parser.y (QWORDS, QWSPLICE): New tokens.
(n_exprs): Integrate splicing form of QLL syntax.
(n_expr): Integrate non-splicing form of QLL syntax.
(litchars): Propagate line number info.
(quasilit): Fix "string literal" wording in error message.
* txr.1: Introduced WLL abbreviation for word list literals,
cleaned up the text a little, and documented QLL's.
|
|
|
|
|
| |
to macro-expand the embedded forms in a quasiliteral except
when they are the very first item.
|
|
|
|
| |
types WORDS and WSPLICE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (WLIT): New exclusive start state.
Extend lexical grammar to transition to WLIT state upon
the #" or #*" sequence which kicks off a word literal,
and in that state, piecewise lexically analyze the literal,
mostly by borrowing rules from other literals.
* parser.y (WORDS, WSPLICE): New tokens.
(n_exprs): Integrate splicing form of word list literal syntax.
(n_expr): Integrate non-splicit for of word list literal syntax.
(litchars): Propagate line number info.
(wordslit): New grammar rule.
* txr.1: Updated.
|
| |
|
|
|
|
|
|
|
|
| |
* lib.c (last): New function.
* lib.h (last): Declared.
* txr.1: Documented last.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (copy): Bugfix: handle lazy strings. Also, handle hash
tables via copy_hash.
(length): Bugifx: handle lazy strings. Also, handle hash tables
via hash_count.
(empty): New function.
* lib.h (empty): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
(me_unless, me_while, m_until): New static functions.
(eval_init): Register macros unless, while and until.
* txr.1: Document unless, while and until.
|