| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
* hash.c (hash_revget): Default to equal, except in
compatibility mode.
(hash_keys_of): Also default to equal. This function is too
new to bother with compatibility switching.
* txr.1: Documented, with compat notes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes the inadequacy that all variables occurring
in a pattern under @(all ...) or @(coll ...) are blindly
collated into lists, ignoring the fact that they may be
previously bound variables that must back-reference and not be
colleced into lists (just like in the TXR Pattern language!)
* share/txr/stdlib/match.tl (compile-loop-match): Calculate
the subset of variables in the pattern that have been freshly
bound. Only generate the collection gensyms for those
variables and only collect and nreverse those variables.
* tests/011/patmatch.tl: Some test cases that backreference
into an @(all).
* txr.1: Documented.
|
|
|
|
| |
* txr.1: 2020 -> 2021.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/match.tl (compile-loop-match): Implement
coll semantics. coll fails if it collects nothing, which
uses common logic with all*. We just have to move the
flipping of the loop-iterated-var into the match, and not
do it unconditionally for every iteration.
(compile-match): Hook in the coll operator.
* tests/011/patmatch.tl: Test case copied from doc example.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
Relax the restrictions in these operators so they work with
sequences rather than specifically lists.
* share/txr/stdlib/match.tl (compile-loop-match): Make the
necessary adjustments so that abstract iteration is used.
* txr.1: Documented.
|
|
|
|
|
|
| |
* txr.1: Document recently introduced check against crossing
over into infinite iteration on the terminator of an improper
list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Multiple occurrences of variables unify using equal.
* share/txr/stdlib/match.tl (var-list): New struct type.
Used for tracking what variables have been defined.
(compile-struct-match, compile-vec-match, compile-atom-match,
compile-op-match, compile-cons-structure,
compile-require-match, compile-let-match, compile-loop-match,
compile-parallel-match, compile-not-match): Take var-match
argument and pass it down.
(compile-parallel-match): Take var-match argument and pass
copies of it down to the compile jobs of the branches, since
they do not unify.
(compile-var-match, comiple-let-match, compile-op-match):
Handle variables carefully: check for variable already
being defined and generate a backreference instead of
a new binding match.
(compile-match): Take optional var-list argument,
instantiating the object if it is missing, pass down to all
recursive compile unctions.
* txr.1: Documented.
|
|
|
|
| |
txr.1: Again under the @(not) operator, .cond instead of .code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/match.tl (compile-require-match): The bug
here is that the condition is placed before the
match.test-expr, which is incorrect. The conditions can only
be evaluated if match.test-expr has succeeded, because
otherwise the variables are not validated to have the
correctly matching value. Also, in the documentation,
the synax insinuates there can be more than one expression. So
let's just make it work: require takes multiple expressions
and combines them with an implicit and.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
|
|
|
|
| |
* hash.c (hash_keys_of): New function.
(hash_init): Register hash-keys-of intrinsic
* hash.h (hash_keys_of): Declared.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: Under @(not) operator, .cond instead of .code.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Bumped from incorrect 245 to 247.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Regenerated.
|
|
|
|
|
| |
* txr.1: GC-driven finalization will not iterate on new
finalizer registrations.
|
|
|
|
|
| |
* txr.1: Fix the bungled dolist macro definition, as well as
the incorrect example illustrating its usage.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/match.tl (compile-not-match): New function.
(compile-match): Hook in not operator.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* txr.1: Pattern Matching is new. Though it works, the
programmer-visible, documented requirements may have to be adjusted to
make it better, and it would be nice to do that without caring about
backward compatibility. In other words, the feature is currently in
"beta": it is expected to be reliable, but the syntax and semantics are
not written in stone.
|
| |
|
|
|
|
|
|
| |
* tests/011/patmatch.tl: Add match-case test.
* txr.1: Document when-match, if-match and match-case.
|
| |
|
|
|
|
|
| |
* txr.1: Fix "the" mistyped as "he" in the new pattern matcher
documentation, as well as under call-finalizers.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* txr.1: Fix << that should be <.
|
|
|
|
|
|
|
| |
* txr.1: The operator is struct not structure. Formalize the
heading as Pattern operator.
* checkman.txr: Recognize the new Pattern operator heading.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/match.tl (compile-struct-match):
Allow a pattern instead of a struct type name, in which
case the object can be of any struct type which has
the slots required by the pattern.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: New Structurl Pattern Matching major section with new
subsections.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* METALICENSE: 2020 copyrights bumped to 2021. Added note
about SHA-256 routines from Colin Percival.
* LICENSE, LICENSE-CYG, Makefile, alloca.h, args.c, args.h,
arith.c, arith.h, buf.c, buf.h, cadr.c, cadr.h, chksum.c,
chksum.h, chksums/crc32.c, chksums/crc32.h, combi.c, combi.h,
configure, debug.c, debug.h, eval.c, eval.h, ffi.c, ffi.h,
filter.c, filter.h, ftw.c, ftw.h, gc.c, gc.h, glob.c, glob.h,
hash.c, hash.h, itypes.c, itypes.h, jmp.S, lex.yy.c.shipped,
lib.c, lib.h, linenoise/linenoise.c, linenoise/linenoise.h,
lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h,
parser.l, parser.y, protsym.c, rand.c, rand.h, regex.c,
regex.h, share/txr/stdlib/asm.tl, share/txr/stdlib/awk.tl,
share/txr/stdlib/build.tl, share/txr/stdlib/cadr.tl,
share/txr/stdlib/compiler.tl, share/txr/stdlib/conv.tl,
share/txr/stdlib/copy-file.tl, share/txr/stdlib/debugger.tl,
share/txr/stdlib/defset.tl, share/txr/stdlib/doloop.tl,
share/txr/stdlib/each-prod.tl, share/txr/stdlib/error.tl,
share/txr/stdlib/except.tl, share/txr/stdlib/ffi.tl,
share/txr/stdlib/getopts.tl, share/txr/stdlib/getput.tl,
share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl,
share/txr/stdlib/keyparams.tl, share/txr/stdlib/op.tl,
share/txr/stdlib/package.tl, share/txr/stdlib/param.tl,
share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl,
share/txr/stdlib/pmac.tl, share/txr/stdlib/quips.tl,
share/txr/stdlib/save-exe.tl, share/txr/stdlib/socket.tl,
share/txr/stdlib/stream-wrap.tl, share/txr/stdlib/struct.tl,
share/txr/stdlib/tagbody.tl, share/txr/stdlib/termios.tl,
share/txr/stdlib/trace.tl, share/txr/stdlib/txr-case.tl,
share/txr/stdlib/type.tl, share/txr/stdlib/vm-param.tl,
share/txr/stdlib/with-resources.tl,
share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl,
signal.c, signal.h, socket.c, socket.h, stream.c, stream.h,
struct.c, struct.h, strudel.c, strudel.h, sysif.c, sysif.h,
syslog.c, syslog.h, termios.c, termios.h, time.c, time.h,
tree.c, tree.h, txr.1, txr.c, txr.h, unwind.c, unwind.h,
utf8.c, utf8.h, vm.c, vm.h, vmop.h, win/cleansvg.txr,
y.tab.c.shipped: Copyright year bumped to 2021.
|
|
|
|
|
|
|
|
| |
* txr.1: The documentation section for makunbound also
erroneously lists the fmakunbound and mmakunbound functions in
the heading and syntax block. They are not documented there,
but in their own section which follows and has its own
heading, so these references to them must be removed.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (progn_fun, prog1_fun, prog2_fun): New static
functions.
(eval_init): Wire progn, prog1 and prog2 function bindings
to new functions.
* txr.1: Documented.
* checkman.txr (check-func): Recognize Macro/function and
Operators/functions heading.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (prog2_s): New symbol variable.
(me_prog2): New macro expander function.
(eval_init): Initialize prog2_s variable with interned
symbol.
Register prog2 macro expander.
* txr.1: Maintain the documentation for progn and prog1,
improving the wording and adding a dialect note .
Document prog2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (call_finalizers_impl): Iterate over the finalizer
registrations until no more finalizers are identified,
performing additional rounds, as necessary. Thus if finalizers
register more finalizers that are eligible for processing
according to the criteria of he current phase, those are done
in the current phase.
(gc_finalize): We must now carefully set the reachable flag to
1 for a new finalization entry. This was always the right
thing to do and is logically correct: if an object is being
passed to finalize, it is necessarily reachable. Leaving the
0 initialization would do bad things now, as follows. If any
object whatsoever has a finalizer registered against it during
GC-driven finalization, its finalizer will be called. This is
bad if the object isn't garbage. Secondly, the object may be
moved into generation 0, and put into the freshobj list. This
is extremely bad if the object is reachable by generation 1
objects, which is now a wrong-way reference.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the finalization count, we don't have to scan the
freshobj array for duplicates when calling finalizers.
However, the limited range of the counter limits how many
times we can register a finalizer against an object.
* gc.c (make_obj): Reset the new fincount field to zero
for a newly minted object.
(call_finalizers_impl): Decrement the fincount for
each object. Only run the freshobj-related logic when
the count hits zero.
(gc_finalize): Bump the fincount of a registered object. If
the counter overflows, throw an exception.
* lib.h (obj_common): Add new field fincount for the
finalization count.
* tree.c (tr_rebuild): Fix up dummy object initializer
to accommodate the new member.
* txr.1: Document that there is a limit on the number
of times an object can be registered for finalization.
|
|
|
|
|
|
| |
* txr.1: List the no-conversion - operator among the
shortcuts, so it is easier to discover. Add a note that
that fconv is potentially applicable to non-string fields.
|
|
|
|
| |
* txr.1: Add usage note to the fconv macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register shuffle and nshuffle as
two-argument functions with optional argument.
* lib.c (nshuffle): Take random-state argument, defaulting to
value of random_state special variable.
(shuffle): Take random-state argument, pass down to nshuffle.
* lib.h (shuffle, nshuffle): Declarations updated.
* txr.1: Updated.
|
|
|
|
|
| |
* doc: Common Lisp has a function like symbol-macro function;
it is called macro-function.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date. Fixed repeated
word in documentation under env-hash.
* share/txr/stdlib/ver.tl: Bumped from incorrect 243
value to 245.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (env_hash): Function renamed to get_env_hash and a
static variable named env_hash introduced.
Function returns a previously allocated hash table, if
it exists, except in compat mode.
(getenv_wrap): Stash the result into the hash also.
(setenv_wrap): Keep the hash up-to-date with the action of
setenv.
(unsetenv_wrap): Also delete from the hash.
(sysif_init): Protect the env_hash variable from gc.
* txr.1: Documented, with compat notes.
|
|
|
|
|
|
| |
* txr.1: The env function actually returns a cached list.
Spell out that the function is not required to construct a new
list.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
| |
* txr.1: TXR 216 bumped the compiled file version from 4 to 5,
but this was not documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Test for clock_gettime, generating
HAVE_CLOCK_GETTIME symbol in config.h.
* time.c (time_sec_nsec): New function.
(time_init): time-nsec intrinsic registered.
* time.h (time_sec_nsec): Declared.
* txr.1: Documented.
|
|
|
|
|
|
| |
* rand.c: Refer to "WELL512a" in comment, not "WELL 512".
* txr.1: Replace "WELL 512" with "WELL512a" everywhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* rand.c (rand32_bug): New static function formed by
renaming the original buggy rand32.
(rand32_good): Copy of rand32 with two bugfixes. The term
involving variable r2 must be only left shifted by 28 bits,
and not xor-ed with the original value. The order of
operations is wrong in the term that contains the & operation.
(rand32): New static function pointer variable, serving
as the rand32 function. Points to rand32_good by default.
(rand_compat_fixup): Test for 243 or lower compatibility,
under which rand32 is made point to rand32_bug. This is done
before the call to make_random_state for replacing
*random-state*, which has to use the old function.
* txr.1: compat note added.
* tests/013/maze.expected: Updated.
|
|
|
|
| |
* txr.1: Fix out-of-order compatibility 247 and 242 entries.
|
|
|
|
|
|
|
|
|
| |
* regex.c (trim_left, trim_right): New static functions.
(regex_init): New intrinsics registered.
* tests/015/trim.tl, tests/015/trim.expected: New files.
* txr.1: Documented.
|