| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Adjust registrations of sum and prod to
be binary functions with an optional argument.
* lib.c (nary_op_keyfun, sumv, prodv): New static functions.
(sum, prod): Implement optional keyfun argument via sumv and
prodv helpers.
* lib.h (sum, prod): Declarations updated.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (compiler_set_entries): Register
dump-compiled-objects for auto-loading.
* share/txr/stdlib/compiler.tl (usr:dmp-to-tlo): New
function.
(compile-file): Code to be shared with dump-compiled-objects
moved into dump-to-tlo function.
(usr:dump-compiled-objects): New function.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: New section on Treatment of literals.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (txr_main): In processing the -f option, if there is
already an input source, but its name exactly matches the
argument of the -f option, then ignore the -f and its option
intead of terminating with a diagnostic. This allows the user
to use -f in the Null Hack to achieve the usual trick of
allowing the script to take options passed through to the
interpreter.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
|
|
|
| |
* txr.1: eval mistakenly referred to instead of compile-file
under Compile File. Spurious pluralization of literals fixed.
New "Bound symbols in dwim" heading to separate text from
discussion of unbound symbols in dwim. Clarifying text added
about compile-toplevel's treatment of form.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a zero-length carray is converted with vec-carray or
list-carray and the null-term-p argument is t, there is an
exception about a negative index. An empty vector or list
should be returned in this case, and the documentation says
exactly that.
Also, if a carray of unknown length is converted, there is
an exception from vec-carray, as documented, but it's
an uninformative one that is incidentally produced when -1
is passed to the vec function. The list-carray just returns
nil, contravening the documentation.
* ffi.c (vec_carray, list_carray): Fix the problems described
above.
* txr.1: Reviewing the documentation for these functions, an
improperly terminated sentence was found.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* LICENSE, LICENSE-CYG, METALICENSE, Makefile, args.c, args.h,
arith.c, arith.h, buf.c, buf.h, cadr.c, cadr.h, combi.c,
combi.h, configure, debug.c, debug.h, eval.c, eval.h, ffi.c,
ffi.h, filter.c, filter.h, ftw.h, gc.c, gc.h, glob.c, glob.h,
hash.c, hash.h, itypes.c, itypes.h, jmp.S, lib.c, lib.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/doloop.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/path-test.tl,
share/txr/stdlib/place.tl, share/txr/stdlib/pmac.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, txr.1, txr.c, txr.h,
unwind.c, unwind.h, utf8.c, utf8.h, vm.c, vm.h, vmop.h,
win/cleansvg.txr: Extended Copyright line to 2018.
|
|
|
|
|
| |
* txr.1: with-dyn-lib relates not only to deffi but also
deffi-var and deffi-sym.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* ffi.c (min): New macro.
(ffi_array_put_common): Tolerate sequences which are shorter
than the array. Use seq_info to classify the sequence and use
separate code for the vector and list case, avoiding taking
the length of the list.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The square function calulates (* x x) but is faster for bignum
integers by taking advantage of mp_sqr.
* arith.c (square): New function.
* eval.c (eval_init): Register square as intrinsic.
* lib.h (square): Declared.
* txr.1: Documented.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (nzerop): New function.
* eval.c (eval_init): Register nzerop intrinsic.
* lib.h (nzerop): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
| |
* txr.1: Document that the load function ignores the hash
bang line in both compiled and source files.
|
|
|
|
| |
* txr.1: Fix funny formatting.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is that the file compiler is emitting one big form
that contains all of the compiled top-level forms. For obvious
reasons, this doesn't work when that form contains symbols
that are in a package which is defined by one of those forms;
the compiled file will not load due to qualified symbols
referencing a nonexistent package.
The solution is to break up that big form when it contains
forms that manipulate the package system in ways that
possibly affect the read time of subsequent forms.
* lib.c (delete_package): Use a non-destructive deletion on
the *package-alist*, because we are going to be referring
to this variable in the compiler to detect whether the list
of packages has changed.
* share/txr/stdlib/compiler.tl (%package-manip%): New global
variable. This is a list of functions that manipulate the
package system in suspicious ways.
(user:compile-file): When compiling a form which is a call to
any of the suspicious functions, add a :fence symbol into
the compiled form list. Also do this if the evaluation of the
compiled form modifies the *package-alist* variable.
When emitting the list of forms into the output file, remove
the :fence symbols and break it up into multiple lists
along these fence boundaries.
* txr.1: Documented the degenerate situation that can arise.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
| |
* buf.c (copy_buf): New function.
(buf_init): Register copy-buf intrinsic.
* buf.h (copy_buf): Declared.
* lib.c (copy): Handle BUF via copy_buf.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/asm.tl (op-getf): Rename to op-oldgetf.
This opcode becomes obsolescent.
(op-getf): New opcode.
* share/txr/stdlib/compiler.tl
(assumed-fun): New global variable.
(compiler comp-fun): Use the new getf instruction which takes
a function table index instead of a data table index.
(compiler comp-lisp1-value): Don't use getl1 opcode any more
for dynamic lisp1-style lookup. Instead, we bake the behavior
at compile time perform a function lookup if the symbol is
completely unbound, a variable lookup if it is bound to a
variable (where we decide at compile tie whether it is lexical
or dynamic) or else a function if a function binding exists at
compile time. Also, if we assume that an unbound symbol is a
function, put it on the assumed-fun list.
(compiler comp-dwim): If the first argument is a symbol
with no lexical binding, and is not bound as a variable, then
treat it as a function by transforming the form into a
function call form with that symbol in the car position.
Put the symbol on the assumed-fun list.
(compiler-emit-warnings): New function.
(with-compilation-unit): Call compiler-emit-warnings when
bailing out of most enclosing compilation unit.
(%tlo-ver%): Bump compiled file version to 4, since
we added an opcode.
* vm.c (vm_execute): Follow rename of GETF to OLDGETF.
Implement the new GETF.
* parser.c (read_file_common): Extend version range to allow
version 4 compiled files.
* txr.1: Documented everything.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The functions sys:expand, sys:expand* and
sys:expand-with-free-refs are now in the usr package and
documented for public use.
* eval.c (eval_init): Move registrations of the symbools
expand, expand* and expand-with-free-refs from the
system package to the user package.
* share/txr/stdlib/awk.tl (sys:awk-mac-let, awk): Uses of
sys:expand drop the sys: prefix.
* share/txr/stdlib/op.tl (sys:op-alpha-rename): Likewise.
* share/txr/stdlib/place.tl (call-upudate-expander,
call-clobber-expander, call-delete-expander, sys:placelet-1):
Likewise.
* tests/011/macros-2.txr, tests/012/struct.tl: Likewise.
* txr.1: Documented expand, expand* and expand-with-free-refs.
|
|
|
|
| |
* txr.1: Fix misnamed references to macro parameter.
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (arith_init): Do not define *flo-dig*, *flo-max*,
*flo-min*, *flo-epsilon*, *pi* and *e* unless compatibility
with TXR 199 or earlier is requested.
* txr.c (txr_main): Likewise for *self-path*.
* txr.1: Compat note added.
|