| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Use new symbol variable mod_s instead
of calling intern.
* match.c (mod_s, modlast_s): Symbol variables defined.
(do_output_line): mod and modlast directives implemented under rep.
(do_output): likewise under repeat.
(syms_init): Initialize new symbol variables.
* match.h (mod_s, modlast_s): Declared.
* parser.l (MOD, MODLAST): Parse new token types.
* parser.y (MOD, MODLAST): New tokens.
(repeat_parts_opt, rep_parts_opt): New syntax.
(repeat_rep_helper): Handle mod and modlast syntax.
* txr.1: Updated.
* txr.vim: Updated.
|
|
|
|
|
|
| |
were being created here when clauses of the same kind appear multiple
times. The problem is that append2 no longer copies the second list,
which the code was relying on it to do.
|
| |
|
| |
|
| |
|
|
|
|
| |
catch clauses and in finally clauses.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated.
|
|
|
|
| |
Introductory text rewritten.
|
| |
|
|
|
|
| |
* rand.c (random): Add back missing declaration.
|
|
|
|
|
| |
cases like `@a@(foo)@b` where foo was being translated
to (foo) rather than (sys:expr foo).
|
|
|
|
|
| |
patch, resulting in an insufficient bit field width for representing
the allocation size of the MPI integer on 32 bit platforms.
|
|
|
|
|
|
| |
arguments. This snuck through due to working with a C++ compiler.
(random): Fixed unused variable warning that happens on 32-bit-pointer
platforms.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
correct place. In the previous commit I did it in the code that handles
the obsolescent :var syntax.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c:x (lazy_flatten_scan, lazy_flatten_func): New static functions.
(lazy_flatten): New function.
* lib.h (lazy_flatten): Declared.
* match.c (v_next): Use lazy_flatten instead of flatten for
processing a :list source. This means that @(next :list ...)
can be used to process infinite lazy lists.
* txr.1: Documented lazy-flatten.
|
|
|
|
|
|
| |
(make_random_state): After initializing, retrieve eight
random numbers to clear pathological initial behavior
leading to duplicate values.
|
|
|
|
|
|
|
|
| |
* arith.h (highest_bit): Declared.
* rand.c (random): Rewrote using different algorithm which
ensures even distribution, and avoids doing a bignum mod
operation.
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
(some_satisfy): Return the first non-nil result, rather than t.
(all_satisfy): Return the value of the last item, if all items
are processed.
* lib.h (memql): Declared.
* txr.1: Documented memq, memql, memqual, tree-find, some,
all, none, eq, eql and equal.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* match.c (extract_bindings): Make sure there are no duplicate
variables among the extracted bindings. This is needed because
of the other changes.
(do_output_line, do_output): In handling the rep/repeat directives,
append the original bindings to the extracted set bindings for the
variables which just occur in the clause, so that Lisp code can see all
of the variables.
|
|
|
|
|
|
|
| |
the object is not a string or number, then print it to a string
and treat it as a string, adjusting it within the field.
Also, do not simply abort on an unknown format directive
but throw a proper exception.
|
|
|
|
|
| |
using < rather than '-'. The +, space and leading 0 are
specified on the precision, not the width.
|
|
|
|
|
| |
together. Otherwise for fixnum moduli, we get only a 32 bit number no
matter what the modulus is.
|
|
|
|
|
| |
strings are printed the same way under ~s and ~a. The only difference
is printing other kinds of objects.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (format_num): New argument: sign character.
Rewrote to handle precision, width, zero padding and
leading sign similarly to printf.
(vformat): New syntax accepted: a space or + before
the width specifies that a positive sign is to be
explicitly written as a space or + character.
Pass one more argument to vormat_num calls.
Bugfix: go back to vf_init state after processing ~~.
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (plus, minus, mul, gt, ge, lt, le, exptmod, gcd): Remove
trailing abort; we already marked uw_throwf as noreturn. This hack
should not be needed in functions where the last statement is a throw.
(trunc, expt): Repeated error case handled in one place. Temp variable
used to avoid two calls to mp_clear. Call to abort removed.
(mod): Repeated error handed in one place. Plugged memory leak
by moving throw past mp_clear calls. Call to abort removed.
(isqrt): Repeated error case handed in one place.
|
| |
|
|
|
|
|
|
| |
It will take days to completely wipe the egg off my face.
I forgot to fix this code for unsigned integers before
pasting it into MPI.
|
|
|
|
|
|
|
|
| |
* arith.h (normalize): Declared.
* rand.c (random): Bugfix: normalize the bignum before returning it.
* txr.1: Doc stubs for PRNG functionality.
|
| |
|
|
|
|
| |
Work properly when mp_digit is smaller than 32 bits.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c: Includes rand.h header.
(eval_init): New variable and functions from rand module registered.
* lib.c: Includes rand.h header.
(init): Call rand_init.
* rand.c: New file.
* rand.h: New file.
|
|
|
|
|
|
|
| |
Better fix.
* parser.y (YYEOF): If YYEOF is not defined, define it as zero.
(yybadtoken): Undo previous changes: do not test for zero.
|
|
|
|
|
| |
* parser.y (yybadtoken): The current token (yychar) is 0 on byacc
rather than YYEOF or YYEMPTY, so we have to handle that.
|
| |
|
|
|
|
|
|
| |
* tests/007/except-2.expected: New file.
* tests/007/except-2.txr: New file.
|
|
|
|
|
|
|
|
| |
* lib.c (cat_vec): New function.
* lib.h (cat_vec): Declared.
* txr.1: Documentation stub.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (uw_unwind_to_exit_point): When jumping to a catch frame,
do not mark it invisible.
* unwind.h (uw_catch): Flip the matches to nil so that this catch
frame can no longer be identified as an unwind point by uw_throw,
and thus will not be re-entered for the purposes of handling
an exception. It remains visible for the purposes of running the
clean up code.
(uw_unwind): Prior to executing cleanup forms, flip the visibility
to 0. This means that the frame will no longer be re-entered
for any reason.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (op_unwind_protect): Use uw_simple_catch_begin,
and remove the uw_catch (exsym, exvals) clause. Put
explicit braces around the unwind code even though it
is only one statement.
* match.c (do_txeval): Got rid of empty uw_unwind clause.
This is not needed any longer.
(v_try): Got rid of explicit uw_do_unwind calls.
* unwind.h (uw_simple_catch_begin): New macro.
(uw_do_unwind): Macro removed.
(uw_catch): Added goto uw_unwind_label at the front.
This way if the previous clause falls through,
control goes to the unwind logic.
(uw_unwind): Got rid of initial break. Previous
clause should fall through to unwind logic,
whether it is the main clause, or one of the catches.
(uw_catch_end): Default case aborts, because
we don't expect this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
due to negative hashing values being reduced modulo table size
to a negative array index.
* hash.c (equal_hash, eql_hash): Ensure
that value returned is in the range [0,NUM_MAX].
(hash_obj): Unused function removed.
(cobj_hash_op): Use hashing similar to eql hash for
other kinds of references.
(hash_eql, hash_equal): Removed bogus % NUM_MAX reduction.
* hash.h (hash_obj): Declaration removed.
|
|
|
|
|
|
|
|
| |
* lib.c (copy_vec, sub_vec): New functions.
* lib.h (copy_vec, sub_vec): Declared.
* txr.1: Stub sections created.
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated.
|
|
|
|
|
|
|
|
|
|
| |
functions.
(expand): New case for quasiliterals.
(eval_init): Register quasi literal as special operator.
* match.c (format_field): Linkage changed to external.
* match.h (format_field): Declared. Declarations rearranged.
|