| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
Ever since jmp.S was added, the txr executable has been
building with a bit in the program header indicating that the
stack is to be executable.
* jmp.S: Define the .note.GNU-stack section to
tell the linker we don't need an executable stack.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The purpose is to eliminate any biases in
the PRNG arising out of the regularity of that pattern, so
that the behavior of successive values is good from the
beginning.
This doesn't solve the problem that a short warm-up period
leads to a poor distribution of initial values relative to the
seed space. In other words, that similar seeds lead to
initially similar sequences.
* rand.c (rand_tab): New static array.
(make_random_state): Set uninitialized parts of state from the
corresponding elements in rand_tab, rather than to the
0xAAAAAAAA values.
(rand_compat_fixup): In 139 compatibility mode, clobber
rand_tab with 0xAA bytes.
* tests/013/maze.expected: Updated.
* txr.1: Added some PRNG implementation notes, and
also compatibility notes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This one affects all platforms. The extra sign check and
negation cancels out the one done in mp_get_uintptr, causing a
positive value for a negative input value.
* mpi/mpi.c (mp_get_intptr): Just coerce the uint_ptr_t
result to int_ptr_t. That has the right semantics under
that the bits are preserved (under two's complement, in every
compiler I've ever used). The unsigned value from
mp_get_uintptr already looks like the image of a two's
complement value.
|
|
|
|
|
|
|
|
|
| |
This applies only to some platforms, none of which are current
targets on which TXR is tested and released.
* mpi/mpi.c (mp_get_uinptr): Do not clobber output
accumulator in the loop body: the bits must be OR-ed
into it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (copy): Pass new second argument to make_random_state.
* rand.c (random_warmup): New macro.
(random_warmup_s): New symbol variable.
(make_random_state): New warmup argument. Code restructured to
avoid copy flag. Fill code and initialization of r->cur made
common.
(rand_compat_fixup): Pass second argument to
make_random_state.
(rand_init): Pass second argument to make_random_state.
Initialize random_warmup_s with interned symbol. Register
*random-warmup* special variable. Fix registration of
make-random-state to two-argument function type.
* rand.h (make_random_state): Declaration updated.
* txr.1: Document *random-warmup* variable and warup
argument of make-random-state.
|
|
|
|
|
| |
* rand.c (make_random_state): Don't use getpid
if we aren't on something that looks like Unix.
|
|
|
|
|
|
| |
* rand.c (make_random_state): Issue #error if SIZEOF_PTR
exceeds 8, rather than including bogus code that
neglects to use the remaining upper 32 bits.
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Remove registration of
make-random-state, random-state-get-vec, random-state-p,
random-fixnup, random, and rand.
* rand.c (rand_init): Move registrations removed from
eval_init here.
|
|
|
|
|
|
|
|
|
|
| |
* eval.h (call_s): Declared.
* match.c (h_call, v_call): New static function.
(dir_tables_init): Register v_call in v_directive_table
under call symbol. Likewise h_call in h_directive_table.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this change we allow the grammar, as such, to express empty
clauses in the parallel constructs like @(some), @(cases),
@(gather) and so forth. However, we raise an error when these
occur. This results in a cleaner diagnostic behavior.
In the future, empty clauses may be allowed; the semantics has
to be worked out. An empty clause should neither succeed nor
fail; the behavior should be as if it is not there.
The general strategy in this patch is to eliminate the use
of the clauses terminal symbol (completely) and use
clauses_opt everywhere, and then diagnose when that
produces a nil. Some elems are similarly changed to elems_opt
in the horizontal versions of directives.
* parser.y (clauses): Nonterminal symbol completely removed.
(spec): Empty production rule removed, by using clauses_opt
instead of clauses.
(all_clause, some_clause, none_clause,
maybe_clause, cases_clause, choose_clause, gather_clause):
Instead of diagnosing empty clauses via a dedicated
grammar rule, diagnose by looking for nil subtree emerging
from from a clauses phrase.
(gather_parts): Use clauses_opt. Yield nil instead of
a cons if this clauses_opt is nil.
(additional_gather_parts): Simplify grammar and actions
by recursing back to gather_parts. If gather_parts produces
nil, diagnose the empty and/or subclause situation.
(collect_clause): Use clauses_opt and diagnose empty.
Simplify error production, which doesn't have to look
at the lookahead token yychar any more to implement
the empty diagnostic.
(clause_parts): Use clauses_opt instad of clauses. Yield
nil instead of a cons if clause_opt yields nil.
(additional_parts): Grammar and actions simplified by
recursing back to clause_parts. If the recursive
clause_parts produces nil, generate empty and/or
subclause diagnostic.
(elem): Use elems_opt for the various horizontal clauses
and implement empty checks for them. Explicit empty
productions are eliminated.
(clause_parts_h): Changed in way analogous to clause_parts.
(additional_parts_h): Changed analogously to
additional_parts.
(try_clause): Use clauses_opt and catch empties.
Eliminate the second error production.
(catch_clauses_opt): Diagnose empty catch and finally, unless
in compatibility mode with 139 or less. The grammar already
uses clauses_opt here; empty catches and finally had been
allowed. Fixed messages in error productions for catch
and finally to refer to catch and finally rather than try.
|
|
|
|
|
|
|
| |
* arith.c (arith_init): Registered fixnum-min and fixnum-max
variables.
* txr.1: Documented.
|
|
|
|
|
|
| |
* checkman.txr: Check .metn using logic shared with .codn.
* txr.1: Numerous errors fixed.
|
|
|
|
|
|
|
|
| |
* checkman.txr: Check .meta similarly to .code.
* txr.1: Change .meta macro to take only one argument,
so that text with spaces must be quoted.
Errors found and fixed.
|
|
|
|
|
|
|
|
| |
* checkman.txr: Constraint on first character of second
argument coded as a require constraint, enforced
with assert.
* txr.1: Newly discovered errors fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the manual, the .code and .codn macros are no longer
variadic. They take one an two arguments, respectively.
Multiple arguments have to be quoted now.
This makes it easier to detect errors in usage,
using support in checkman.txr.
Numerous errors were found, in fact.
* checkman.txr (check-code): New pattern function
for doing some checks on .code, codn, cod2 and cod3
macro usage.
* txr.1: code and codn macro are no longer variadic.
All variadic uses fixes with quotes. Numerous
errors discovered and corrected.
|
|
|
|
|
|
| |
* txr.1: Fix incorrect function and variable description
headings with spurious commas and inappropriate plurals.
Fix missing .mets in syntax blocks.
|
|
|
|
|
|
|
| |
* Makefile (txr-manpage.pdf): Invoke checkman.txr
on the man page source.
* checkman.txr: New file.
|
|
|
|
|
|
| |
* Makefile (txr-manpage.pdf): Add -ww option
to pdfroff to report all errors, such as uses
of undefined macros.
|
|
|
|
|
| |
* match.c (v_assert, h_assert): Use ~a rather than ~s
for c->curfile in assert message.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* txr.1: Hunted down and fixed incorrect .code,
.codn, .meta and .metn invocations. Added
missing .desc macros after .coNP Variables ...
|
|
|
|
|
|
|
|
| |
* eval.c (mapcarv, mappendv, mapdov): When done, we can
recycle the conses used for the temporary copy of the
list-of-lists, whose car-s are used for iterating over the
lists in paralle. This is safe because the temporary
list's conses aren't shared with any other function.
|
|
|
|
|
|
|
| |
* ftw.c (ftw_wrap): Handle case when dirpath is a list,
by recursion.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/path-test.tl (path-private-to-me-p): Use
mlet to initialize the g variable lazily, so that
getgrgid is only called when g is used. getgrid is a fairly
heavy-weight function, and it's only used to resolve
the case when a file is writable to the group owner
(is the user the only member of that group?)
|
|
|
|
|
|
|
| |
* eval.c (sys_load): Use ~a format specifier rather than ~s
for the load path (if already known to be a string).
* match.c (v_load): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* glob.c (glob_wrap): Perform argument conversions
that might throw before allocating UTF-8 string.
* parser.y (text): In the action for SPACE, the lexeme
is not needed so free($1) right away. If regex_compile
were to throw an exception, that lexeme will leak.
* socket.c (getaddrinfo_wrap): Harden against leakage of
node_u8 and service_u8 strings with an unwind block.
For instance, the hints structure could contain
bad values which cause addrinfo_in to throw.
* stream.c (make_string_byte_input_stream): Perform
possibly throwing argument conversions before allocating
resources.
* sysif.c (mkdir_wrap, mknod_wrap, chmod_wrap, symlink_wrap,
link_wrap, setenv_wrap, crypt_wrap): Likewise.
* syslog.c (openlog_wrap, syslog_wrapv): Likewise.
|
|
|
|
|
|
|
|
| |
* lib.c (out_str_pretty): Rename to out_str_readable.
This function is called from obj_print_impl precisely when the
pretty flag is false: pretty means output textual things
as the text they denote, rather than machine-readable Lisp.
(out_lazy_str, obj_print_impl): Calls updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch we change which characters objects
are printed using hex escapes, and which characters
are printed as hex when printing string literals.
* lib.c (obj_print_impl): Add DEL (U+7F) to the
list of character objects which are printed as hex.
In a string literal, it's already printed as \x7F.
Use upper case hex rather than lower case.
(out_str_char): Copy the rules used by obj_print_impl
for deciding what string constituents to print as hex
and how to print it. So for instance, U+80 to U+A0 will
now print in hex as well as the U+D800 to U+DFFF range,
rather than just U+DC00 to U+DCFF, and the BOM
code U+FFFE, U+FFFF and anything higher.
|
|
|
|
|
|
|
|
| |
The current behavior is that there is no lex rule for this, so such a
byte gets echoed.
parser.l (grammar): Add fallback rule to match one byte
in SREGEX state and turn it into 0xDCxx character.
|
|
|
|
|
| |
* parser.c (regex_parse): Don't return nil if there
were errors; throw a syntax-error exception.
|
|
|
|
|
| |
* utf8.c (utf8_encode): Don't return zero in the
out-of-range case, but throw.
|
|
|
|
|
|
| |
* parser.l (num_esc): Check for converted value being
out of the range of wchar_t or beyond 0x10FFFF, whichever
is less.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: new test for fnmatch, introducing HAVE_FNMATCH
configure variable into config/config.h.
* sysif.c (fnmatch_wrap): New function.
(sysif_init): Register intrinsic variables fnm-pathname, fnm-noescape,
fnm-period, fnm-leading-dir, fnm-casefold and fnm-extmatch.
Register intrinsic function fnmatch.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (free_completions): Use size_t
for iterating over completions vector.
(complete_line): Likewise.
(edit_insert, edit_insert_str): Cast size_t value
to int before comparing with l->dlen.
|
|
|
|
|
|
|
|
|
| |
When compiling as C++, __USE_GNU is defined even though
we use -ansi and don't specify -D_GNU_SOURCE anywhere.
Glibc headers don't seem to respond to the C++ ANSI options.
ftw.c: Workaround for compiler warning: only define
__USE_GNU if it is not defined already.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (ead_until_match): Use rcyc_pop instead of pop
to move the conses to the recycle list. We know these
are not shared with anything. Adding additional logic
to completely recycle the stack.
* socket.c (dgram_get_char): Use rcyc_pop to
get the character from the push-back list.
* stream.c (stdio_get_char): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (recycled_conses): New static variable.
(rcyc_pop, rcyc_cons, rcyc_list, rcyc_empty): New functions.
(cons): Take a recycled cons, if available.
* lib.h (rcyc_pop, rcyc_cons, rcyc_list,
rcyc_empty): Declared.
* gc.c (gc): Call rcyc_empty to make recycle_list
unreachable.
|
|
|
|
|
| |
* stream.c (get_string): The optional stream argument
must be treated accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (read_until_match): New argument, include_match.
Three times repeated termination code refactored into block
reached by forward goto.
(regex_init): Registration of read-until-match updated.
* regex.h (read_until_match): Declaration updated.
* stream.c (struct record_adapter_base): New member,
include_match.
(record_adapter_get_line): Pass match to read_until_match
as new argument.
(record_adapater): New argument, include_match.
(stream_init): Update registration of record-adapter.
* stream.h (record_adapter): Declaration updated.
* txr.1: Updated.
|
|
|
|
|
| |
* regex.c (read_until_match): Completely rewrite broken,
unsalvageable, garbage logic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixing read_until_match will require this feature.
* socket.c (dgram_get_char): Treat unget_c as a
cons-based stack; pop a character from it if
available.
(dgram_unget_char): Push the character onto unget_c
rather than storing the characer into unget_c.
* stream.c (stdio_get_char, stdio_unget_char): Closely
analogous changes to the ones in dgram_get_char
and dgram_unget_char, respectively.
* txr.1: Documentation improved and updated.
|
|
|
|
|
| |
* stream.c (string_in_unget_char): Missing
argument in uw_throwf call.
|
|
|
|
|
|
| |
* stream.c (string_in_unget_char): Store the updated
position into the stream, rather than the original
value, which does nothing.
|
|
|
|
|
|
|
| |
* parser.l (grammar): The newline character is incorrectly
handled by the same rule under the SREGEX and REGEX states.
In the SREGEX state, just return it as a REGCHAR, not
forgetting to increment the line number.
|
|
|
|
| |
* parser.l: Remove trailing whitespace.
|
|
|
|
|
| |
* parser.y (if_clause, elif_clauses_opt): Add missing
expand calls.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numerous places in match.c are using assoc(sym, bindings)
logic to access a variable, which doesn't see the Lisp
globals, as we would like. For example, if foo is
defined using (defvar foo), @(set foo "A") doesn't work.
This is subject to the compatibility option.
* match.c (tx_lookup_var): New static function.
(dest_set, h_var, h_coll, h_parallel, h_fun, v_next,
v_parallel, v_gather, v_collect, v_flatten, v_cat,
v_output, v_filter, v_fun, match_filter): Use tx_lookup_var
instead of assoc for all lookups that see the full variable
scope. Only variable lists known to be locally consed up
are scanned with just assoc.
* txr.1: Documented new rules and added compatibility notes.
|
|
|
|
|
|
|
| |
* parser.y (make_expr): This function is part of a hack for
converting some hard-coded syntax like @(if ...) or @(and ...)
in an @(output) block to a to a Lisp expression. Alas,
the crucial step of expanding the Lisp form was neglected.
|
|
|
|
|
|
|
| |
* unwind.c (revive_cont): When scanning the stack of the
revived continuation to fix up pointers, we can save the
Valgrind validity bits of each word, mark it defined, and then
restore the validity bits.
|
|
|
|
|
|
| |
* gencadr.txr: Insert notice about generation.
* cadr.c, cadr.h, share/txr/stdlib/cadr.tl: Regenerated.
|