| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Instead of generating a definition of ALLOCA_H,
generate the variable HAVE_ALLOCA_<name> with a value of 1,
where <name> is one of stdlib, alloca or malloc.
* alloca.h: New header.
* args.c, eval.c, ffi.c ffi.c, ftw.c, hash.c, lib.c, match.c,
parser.c, parser.y, regex.c, socket.c, stream.c, struct.c,
sysif.c, syslog.c, termios.c, unwind.c, vm.c: Include
"alloca.h" instead of ALLOCA_H.
|
|
|
|
|
|
|
|
|
|
| |
* configure: try <stdlib.h> first for alloca. This should fix
a build issue which happens on the Musl library and perhaps
elsewhere. The problem on Musl is that #include <stdlib.h>
already includes <alloca.h>. That header contains an alloca
macro which interfers with our subsequent #include ALLOCA_H
directive: ALLOCA_H expands to <alloca.h> and the alloca token
gets further expanded.
|
|
|
|
|
| |
* configure: don't define HAVE_ALLOCA in config.h. It is not
used anywhere. Moreover, alloca isn't optional.
|
|
|
|
|
|
| |
* txr.1: Closing quote didn't come out in .codn; we must use
the \(dq code in this context. Let's make the opening quote
\(dq also for consistency.
|
|
|
|
|
| |
* txr.1: Wrong tense/person of "to expect"; spurious
occurrence of foo identifier deleted.
|
|
|
|
| |
* txr.1: .meti should be used to typeset code inline.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
| |
utf8.c (utf8_decode): The wch_min value is set incorrectly for
the four byte case due to an extra zero; it should be only
0x10000. Code points encoded to four utf8 bytes start at this value.
The consequence of this error is that utf8-encoded characters
in this range are treated as invalid bytes after being decoded
due to failing the range test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following situation can occur:
(defvar v expr) ;; expr throws!
What happens is that the internal hash table of global
variables ends up with an entry that has a nil value,
instead of the expected (v . <value>) cons cell.
The hash table entry is created when the table is probed
for the existence of v, but then is never populated
with a binding because expr throws.
The consequence then is that (boundp v) returns nil, yet
subsequent (defvar v ...) expressions think that v exists, and
refuse to define it. (defparm v ...) also fails; it relies on
(defvar ...) which fails to define the variable, and then
tries to assign to it, which throws.
* eval.c (rt_defvarl): If the hash table exists, but has a nil
value, treat that as an undefined variable. Thus, define the
variable not only if the hash cell is newly made, but also if
it already exists, with a null cdr.
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (assumed-fun): This variable
shouldn't be the first item in the compiler. It is moved after
the definitions of structs and important constants.
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (nzerop): New function.
* eval.c (eval_init): Register nzerop intrinsic.
* lib.h (nzerop): Declared.
* txr.1: Documented.
|
|
|
|
|
| |
* arith.c (zerop, plusp, minusp): style: if2(expr, t) should
be using tnil(expr).
|
|
|
|
| |
* arith.c (plusp): plusp wrongly reports itself as zerop.
|
|
|
|
|
|
|
| |
* configure: Add some help text for variables controllinig the
compiler command. Mention that CFLAGS and LDFLAGS are honored
from the environment or make command line on top of any of the
flags settable here.
|
|
|
|
|
|
|
| |
* configure (opt_flags): Add -fno-stack-protector to disable
this feature that is on by default in some toolchains/distros.
As a result, I'm seeing an over 5% VM speedup on a loop
benchmark.
|
|
|
|
|
| |
* Makefile (TXR_LDFLAGS): Fix use of wrong assignment operator
which clobbers the previous assignment of $(LDFLAGS).
|
|
|
|
|
|
|
|
|
|
| |
* hash.c: Don't include "cadr.h".
* stream.c: Don't include "struct.h".
* strudel.c: No <syslog.h>, ALLOCA_H, "args.h" or "utf8.h".
* vm.c: No "hash.h".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The <dirent.h> header is included all over the place because
it is needed by a single declaration in stream.h. That
declaration is for a function that is only called within
stream.c, so we make it internal. Now only stream.c has
to include <dirent.h>.
* buf.c, debug.c, eval.c, ffi.c, filter.c, gc.c, gencadr.txr,
hash.c, lib.c, lisplib.c, match.c, parser.c, regex.c, socket.c,
struct.c, strudel.c, sysif.c, syslog.c, termios.c, txr.c,
unwind.c, vm.c: Remove #include <dirent.h>.
* cadr.c: Regenerated.
* stream.c (make_dir_stream): Make external function static.
* stream.h (make_dir_stream): Declaration updated.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
| |
* txr.1: Fix .code macro occurring in middle of line.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register in-range and in-range*
intrinsics.
* lib.c (in_range, in_range_star): New functions.
* lib.h (in_range, in_range_star): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* eval.c: Fix incorrect treatment of cases like
(caseql* ((a b) ...)). The check for evaluation must come
before we do the keys = car(keys) transformation. Also,
hash_keys must be updated to the evaluated keys, otherwise if
the hash table optimization is used, the table will contain
the original expressions as the keys, not their values.
|
|
|
|
|
|
| |
* txr.1: Use the correct term "global environment" rather than
"dynamic environment" to desribe the scope in which caseq*,
caseql* and casequal* expand the key forms.
|
|
|
|
|
|
|
|
|
| |
* txr.1: Replace the term "empty lexical environment" with
"global environment" in a few places. In one case, it is
removed, and the surrounding wording is adjusted. The "empty
lexical environment" term is poor because the situations which
it describes retain visibility of the "global lexical"
variables.
|
|
|
|
| |
* eval.c (me_case): Throw error if the test form is missing.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_case): When there are no keys, then it is
logically true that all keys are integer, and the hash table
logic kicks in. The minkey and maxkey variables are supposed
to be calculated as zero in that case, but the empty test is
bungled since nkeys doesn't test false when it is zero. We
end up with minkey and maxkey containing nil which get passed
to the minus function. And so, here we fix the empty test.
|
|
|
|
|
| |
* txr.1: adding more details to description of the effect
of pretty printing.
|
|
|
|
|
|
|
|
| |
* lib.c (obj_print_impl): Always include leading colon when
printing keyword symbols, regardless of pretty flag.
Subject to backward compatibility.
* txr.1: Compat note added.
|
|
|
|
|
|
| |
* txr.1: Documentation of make-lazy-cons revised with
important clarifications and details, and removal of
some overly informal language.
|
|
|
|
|
|
|
|
| |
* arith.c (logand, logior): Remove wasteful zerop tests which
involve a type check. Also don't check for a == b equivalence
in CHR and NUM cases; this is a rare case that just adds to
the cycles and instruction count. Blindly copying and pasting
this code is what led to the bug in logxor.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Guillaume le Vaillant.
* arith.c (logxor): Fix broken behavior when the arguments are
the same nonzero fixnum, or the same bignum object.
(logxor_old): New function: verbatim copy of previous logxor.
* eval.c (eval_init): Register logxor intrinsic to the broken
function if compatibility is 202 or less.
* txr.1: Compat note added.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* vm.c (vm_getz): Manual CSE: calculate address of location,
then conditionally set to zero.
(vm_set_nil_error): New static function.
(vm_set, vm_sm_set): Call zero-argument vm_set_nil_error
instead of three_argument uw_throwf.
(vm_stab_slowpath): New function.
(vm_stab): Function marked inline. The slow path when the
binding is not cached goes through vm_stab_slowpath which is
not inlined.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: Text describing the changes in behavior, under
delmited continuations, of compiled code that mutates
variables seemed unclear; it is revised. Also, in the section
that discusses compiled versus interpreted differences
under Lisp Compilation, a paragraph is added mentioning
delimited continuations, referring the reader to this detailed
section.
|
|
|
|
|
| |
* txr.1: functionp belongs under Functions, not Global
Environment.
|
|
|
|
|
| |
* txr.1: Present the type cases of the copy function using a
more compact and visually appealing bulleted list.
|
|
|
|
|
|
| |
* lib.c (copy): Handle FUN type through copy_fun.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (arith_init): Register functions in the sys package:
b<, b>, b<=, b=, b+, b-, b*, b/ and neg.
* share/txr/stdlib/compiler.tl (%nary-ops%, %bin-ops%,
%bin-op%): New global variables.
(compiler comp-fun-form): Transform two-argument calls to any
of the variadic functions in %nary-ops% functions into calls
to their binary counterpart. These calls are faster, since
they bypass the wrapper which deals with the variable argument
list. Also, we detect unary - and map it to the new sys:neg
function, and reduce the one-argument cases of certain
functions to noops.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (funcall, funcall1, funcall2, funcall3, funcall4): Use
vm_funcall, vm_funcall1, vm_funcall2, vm_funcall3, and
vm_funcall4, respectively instead of the general
vm_execute_closure. Also, missing argument count check added
in funcall.
* vm.c (vm_funcall_common): New macro.
(vm_funcall, vm_funcall1, vm_funcall2, vm_funcall3,
vm_funcall4): New functions.
* vm.h (vm_funcall, vm_funcall1, vm_funcall2, vm_funcall3,
vm_funcall4): Declared.
|
|
|
|
|
| |
* vm.c (vm_gcall): For the 0 to 4 argument cases, use funcall,
funcall1, ..., funcall4 instead of generic_funcall.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (plus, minus, neg, abso, signum, mul, trunc, mod,
floordiv, plusp, minusp, evenp, oddp, gt, lt, ge, le, numeq,
expt, exptmod, isqrt, gcd, flo_int, logand, logior, logxor,
comp_trunc, lognot, logtrunc, sign_extend, ash, bit, logcount,
tofloat, toint, width, poly, rpoly): Use the unchecked c_n
rather than c_num on quantities that are known to be of NUM
and CHR type.
* lib.h (c_n): New inline function.
|
|
|
|
| |
* args.h (args_alloc): Macro removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this patch, the compile function can handle interpreted
function objects that have captured environments.
For instance, if the following expression is evaluated
(let ((counter 0))
(labels ((bm () (bump))
(bump () (inc counter)))
(lambda () (bm))))
then a function object emerges. We can now feed this
function object to the compile function; the environment
will now be handled.
Of course, the above expression is already compileable;
compile-toplevel handles it and so does the file compiler.
This patch allows the expression to be interpreted and then
the function object to be compiled, without access to the
surrounding expression. The compiled function will contain a
compiled version of the environment, carrying compiled
versions of the captured variables and their contents.
* eval.c (env_vbindings, env_fbindings, env_next): New static
functions.
(eval_init): Register env-vbinding, env-fbindings and env-next
intrinsics.
* share/txr/stdlib/compiler.tl (sys:env-to-let): New function.
(usr:compile): Wrap the interpreted lambda terms with let
bindings carefully reconstructed from their captured
environments.
* txr.1: Documented new intrinsic functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (deep_copy_env): New function.
(eval_init): Register copy-fun intrinsic.
* eval.h (deep_copy_env): Declared.
* lib.c (copy_fun): New function.
* lib.h (copy_fun): Declared.
* vm.c (vm_copy_closure): New function.
* vm.h (vm_copy_closure): Declared.
* txr.1: Documented copy-fun.
|
|
|
|
|
|
| |
* regex.c (reg_derivative): When classifying the regex's
operator, don't check for vanishingly unlikely internal
error cases first; that should be done at the end.
|
|
|
|
|
| |
* txr.1: Don't start sentence with And. Revise and correct
description of associativity of referencing dot.
|
|
|
|
|
|
| |
* txr.1: Substantially revising introductory paragraphs.
Mentioning compiling and stand-alone application deployment.
Mention licensing freedom.
|
|
|
|
|
|
|
| |
* txr.1: Revise wording implying that the Ctrl-Z suspend
depends on POSIX job control. Job control is required for it
to allow TXR to be foregrounded after it suspends.
That is not our problem.
|
|
|
|
|
|
| |
* txr.1: In descriptions of multi-line mode, remove notes
about behavior changes between TXR 178 and 179. This doesn't
affect TXR program and is probably of no interest to anyone.
|
|
|
|
|
| |
* txr.1: Fix awkward wording about env's dispatch of txr, and
references to wrong user name in examples.
|