| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (copy_file_set_entries): Add chown-rec and
chmod-rec to list of symbols that trigger auto-load of
copy-file.tl.
* share/txr/stdlib/copy-file.tl (chmod-rec, chown-rec): Neew
functions.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/copy-file.tl (copy-file): Detect that
from-path is a directory before attempting to open it. The
issue is that the open will succeed for a directory, and only
the subsequent read will fail. By that time we have opened
created the target file.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (copy_file_instantiate, copy_file_set_entries):
New static functions.
(lisplib_init): Register auto-load of copy-file.tl via
new functions.
* share/txr/stdlib/copy-file.tl: New file.
* txr.1: New section Unix Filesystem Complex Operations.
Here copy-file, copy-files, copy-path-rec and remove-path-rec
are documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (compiler comp-catch): Compile
the try expression and the description in the newly extended
environment rather than the original environment. This is
necessary because the compiled code for both of these is
is placed into the frame level corresponding to the new
environment. Other than the level, the only difference between
the two environment is that nenv has a couple of gensyms.
Thus it is hygienic w.r.t. the try and desc code; the extended
environment can safely be used.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/with-resources.tl (with-resources):
Rearrange tree-case cases to recognize a sequence of cleanup
forms and insert into the output accordingly.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* LICENSE, LICENSE-CYG, METALICENSE, 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, 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/debugger.tl, share/txr/stdlib/defset.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/param.tl,
share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl,
share/txr/stdlib/pmac.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, 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: Extended copyright notices
to 2020.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new function only compiles a file if the output file doesn't exist
or is out of date.
In addition, both compile-file now deletes the output file if
compilation fails, and has a documented return value.
* lisplib.c (compiler_set_entries): Add autoload entry fro
compile-update-file.
(open-compile-streams): Accepts a third argument: a function to test the
input stream against the output path. The output file is opened, and the
streams are returned, only if that test function returns true.
Also, a third element is returned: the output path. This lets the
caller to know what to delete, if the output file must be deleted.
(compile-file-conditionally): New internal function, formed from
compile-file. Takes an extra argument, the test function to pass to
open-compile-streams. Compilation is skipped if open-compile-streams
returns nil. Internals reshuffled a bit. If compilation doesn't set the
success flag, then the with-resources logic now removes the output file
in addition to closing the output stream. Prior to setting the success
flag, we flush the output stream.
* txr.1: Documented new function, all return values, and deletion of
output file on unsuccessful compilation.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getopts.tl (sys:option-base): New struct
type, holding the boiler-plate methods and slots that were
generated into the user-defined struct by
define-option-struct.
(define-option-struct): Inject the required properties by
inheritance from sys:option-base, greatly reducing code bloat
in the macro. The slot hash and opt-desc-list static slots
have to be redefined in the derived structure so that type has
its own instance of them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Multiple inheritance is too useful to ignore any longer.
* lib.c (subtypep): Perform subtypep calculation between two
struct types via the new struct_subtype_p function.
It's too complicated now to do with ad hoc code outside of
struct.c.
* share/txr/stdlib/struct.tl (defstruct): This macro now needs
to deal with the super argument being possibly a list of base
types instead of a single one.
* strut.c (struct struct_type): Member super and super_handle
are removed. New member nsupers, supers, and sus.
(struct_init): The super function re-registered; it has an
optional argument.
(call_stinitfun_chain): The compat code here must now access
the supertype differently. We don't bother dealing with
multiple inheritance in the compat case; programs requesting
compatibility with TXR 151 shoudn't be trying to use multiple
inheritance.
(get_struct_handles, count_super_stslots, get_super_slots,
find_super_for_slot): New static functions, to off-load some
new complexity from make_struct_type.
(make_struct_type): Handle the increased complexity due to
multiple inheritance.
(super): Takes an additional argument now, to request which
supertype to retrieve. Defaults to zero: the first one.
(struct_type_destroy): Free the sus array.
(struct_type_mark): Mark the supers slot.
(call_initfun_chain): Call init functions of all bases, in
right-to-left order.
(call_postinitfun_chain): Likewise for postinit functions.
(call_super_method, call_super_fun, super_method): Use the
first base as the supertype. This requirement feels bad; it
needs to be revisited.
(do_struct_subtype_p): New static function.
(struct_subtype_p): New function.
(ancestor_with_static_slot): New static function.
(method_name): Revised for multiple inheritance; now relies on
ancestor_with_static_slot to find the original ancestor that
has brought in a method, so we can use that type in the
method name.
* struct.h (super): Declaration updated.
(struct_subtype_p): Declared.
* tests/012/oop-mi.expected: New file.
* tests/012/oop-mi.tl: New test cases.
* txr.1: Revised in order to document multiple inheritance.
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (path_test_set_entries): Autoload entry for
path-dir-empty.
* share/txr/stdlib/path-test.tl (path-dir-empty): New
function.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/asm.tl (operand-to-sym): Use decimal
with no leading zeros for t and d registers. Only the v
registers use hex, because that helps unravel their level
structure. The data table is dumped with decimal numbering, so
the d registers being decimal makes it easier to cross-ref.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getopts.tl (opthelp): Use a different line
breaking approach for literals: the escaped space is now at
the end of the previous line, rather than at the start of the
next line, which looks nicer. We don't do this for the option
type legend, because that has some instances of leading space
alignment, which requires a leading backslash.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This provides more streamlined option processing.
* lisplib.c (getopts_set_entries): Add auto-load entry for
define-option-struct.
* share/txr/stdlib/getopts.tl (define-option-struct): New
macro.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The reason for this rename is that add is a public symbol in
the usr package, thanks to the build macro. This will
interfere with an upcoming feature under which options appear
directly as struct slots, defined by symbols. If a user
defines an --add option using the symbol add, it will clash
with the add method. But add-opt will be sys:add-opt.
* share/txr/stdlib/getopts.tl (opts add): Rename to add-opt.
(sys:opt-processor parse-long, sys:opt-processor
parse-shorts): Follow rename.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The methods of sys:opt-processor pass down an argument called
out which is an opts instance that is created in parse-opts.
In this patch, we move that argument into a new slot of the
sys:opt-processor object, named opts. We instantiate the opts
structure in the getopts function instead. The motivation here
is that (meth sys:opt-processor parse-opts) doesn't know which
type of opts object it is working with; its user is now
responsible for instantiating the object and installing it as
the opts slot.
* share/txr/stdlib/getopts.tl (sys:opt-processor): New
slot, opts.
(sys:opt-processor (parse-long, parse-shorts): Drop out
argument; refer to me.opts instead of it.
(sys:opt-processor parse-opts): Don't instantiate opts object
here, and don't pass it to parse-long and parse-shorts which
no longer take that argument. Rather, rely on it already being
installed into the opts slot.
(getopts): Instantiate opts here, and specify it as the opts
slot of the sys:opt-processor object also being instantiated
here.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getopts.tl (opts): opt-processor slot
removed.
(sys:opt-processor parse-opts): When instantiating opts, do
not initialize the opt-processor slot with a backpointer to
self object. It is not referenced anywhere.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getopts.tl (opthelp): Use symbol-name to
get the string representation of type keywords instead of
tostringp, so there is no leading colon. In the type legend,
we don't have any colon. For instance --gravity=FLOAT rather
than --gravity=:FLOAT.
|
|
|
|
|
|
| |
share/txr/stdlib/getopts.tl (sys:opt-processor build-hash):
Don't construct (list od.long od.short) twice and iterate
through it twice; make just one and process it in one pass.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
| |
* share/txr/stdlib/op.tl (sys:op-expand): The compatibility
version check should be against 225, not against the not
yet existent 255.
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (sys:env postinit): The
the initialization of me.lev becomes more succinct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (obj_print_impl): Render the new syntactic conventions
introduced in qref/uref back into the .? syntax. The printers
for qref and uref are united into a single implementation to
reduce code proliferation.
* parser.l (grammar): Produce new tokens OREFDOT and UOREFDOT.
* parser.y (OREFDOT, UREFDOT): New terminal symbols.
(n_expr): Handle .? syntax via the new OREFDOT and UOREFDOT
token via qref_helper and uoref_helper. Logic for the existing
referencing dot is moved into the new qref_helper function.
(n_dot_expr): Handle .? syntax via uoref_helper.
(uoref_helper, qref_helper): New static functions.
* share/txr/stdlib/struct.tl (qref): Handle the new case when
the expression which gives the object is (t expr).
Handle the new case when the first argument after the object
has this form, and is followed by more arguments. Both
these cases emit the right conditional code.
(uref): Handle the leading .? syntax indicated by a leading t
by generating a lambda which checks its argument for nil.
Transformations to qref handle the other cases.
* txr.1: Documentation updated in several places.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/path-test.tl (path-strictly-private-to-me):
Fix mistake in test whether the file is group
readable/writable. The wrong flag is used for group
readability test, which means that, at that point in the
logic, if the file is merely not group writable, we jump to
the conclusion that the file is strictly private, when in fact
it may be group readable. Reported by user vapnik spaknik.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by user vapnik spaknik, who discovered the
path-symlink-p function yielding a false positive
on a regular file. The functions in this group are
bit testing rather than extracting a bitfield and
checking the enumerated value.
* share/txr/stdlib/path-test.tl (sys:path-test-type): New
function.
(path-file-p, path-dir-p, path-symlink-p, path-blkdev-p,
path-chrdev-p, path-sock-p, path-pipe-p): Use
sys:path-test-type rather than sys:path-test-mode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure (have_sys_stat): New variable. Set to y when our
test detects <sys/stat.h>. New test added for the presence of
high resolution time stamps in struct stat. If we have these,
we #define HAVE_STAT_NSEC 1 in config.h.
* share/txr/stdlib/path-test.tl (path-newer): Compare
nanosecond parts of the modification time if the seconds are
equal, improving the resolution of the test.
* sysif.c (atime_nsec_s, mtime_nsec_s, ctime_nsec_s): New
symbol variables.
(stat_to_struct): If nanosecond resolution is available, set
the new nanosecond slots from the three tv_nsec fields in
struct stat. Otherwise, set the new slots to zero.
(sysif_init): Initialize the new symbol variables. Add the
three new slots to the stat struct.
* sysif.c (atime_nsec_s, mtime_nsec_s, ctime_nsec_s):
Declared.
* txr.1: Documented new atime-nsec, mtime-nsec and ctime-nsec
slots of stat structure. Added note to path-newer mentioning
high resolution support.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A few macros in the library are local; they are needed only
inside functions in the same module. This means they are not
referenced by anything once those functions are compiled; we
should not be carrying the compiled versions of these macros
into the image. We wrap these macro definitions with
eval-only, telling the compiler not to emit their compiled
version into the output file.
* share/txr/stdlib/asm.tl (with-lev-idx, defopcode,
defopcode-derived): Wrap macro with eval-only.
* share/txr/stdlib/compiler.tl (compile-in-toplevel):
Likewise.
* share/txr/stdlib/path-test.tl (sys:path-test): Likewise.
|
|
|
|
|
|
|
|
|
|
| |
This is a left-argument-inserting syntactic sugar for do.
* lisplib.c (op_set_entries): Add auto-load entry for ldo.
* share/txr/stdlib/op.tl (ldo): New macro.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was reported by astute user vapnik spaknik that the
documentation says thing about the do operator which are
not actually true in the implementation. I've decided that
one of them should be true, and so both implementation
and documentation are changing.
The documentation claims that (do set x) will produce
a function that can be called with one argument; that
argument will be assigned to x. That doesn't work, but this
commit will make it work.
The documentation has this example transformation:
(do + foo) -> (lambda rest (+ foo . rest))
that cannot be made to work because do works with macros
and special operators to which arguments can't be dynamically
applied. This patch will not make the above work; instead
the example is corrected.
How do is going to work inow is that (do sym ...) syntax in
which no implicit variables appear will be equialent
to (do sym ... @1). The generated variadic function has one
required argument which is implicitly added to the syntax.
Obviously, that only works if that positon of the syntax
is an evaluated form or place.
Values of the -C option equal to 225 or less will restore
the old do behavior.
* share/txr/stdlib/op.tl (sys:op-expand): Support the new
style of do, subject to backward compatibility. A hack is
required here. We cannot discover the @1, @2 .. variables
in the syntax until we fully expand it. But that code walk
requires the syntax to be valid. For instance if (do set x) is
specified, with the expectation that it is equivalent to
(do set x @1), we cannot process that by code walking (set x).
(set x) is invalid syntax. What we do is to *try* expanding
it as (set x). If that doesn't work, we add a dummy gensym
to the form to produce (set x #:gNNNN) and try expanding that.
In that case, rather than adding @1 to the form, we replace
the dummy gensym with @1. The algorithm is careful not to
accidentally conceal real syntax errors in the form.
If the form without the dummy gensym fails to expand, and
the one with the dummy gensym expands fine but contains
references to implicit parameters (@1, @2, ... @rest),
we expand it again without the gensym and allow the error
to propagate. Other aspects of this change are fairly trivial.
Because the do logic possibly introduces a @1 that doesn't
exist, near the end of this function we have to bind another
metas variable which has an up-to-date copy of the gens slot.
(op-ignerr): New macro; we can't use ignerr because that
will create a bootstrapping cycle; ignerr expands to catch,
and the catch macro uses do. Wrapping this in eval-only,
since we don't need an op-ignerr macro in the compiled image.
* txr.1: Documentation revised and updated. Differences
between do and op put clarified and put into point form.
Bad do examples corrected. Syntax of do now shown as having
a required parameter that is an operator. Compat notes added.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/vm-param.tl (%max-lambda-fixed-args%): New
symbol macro.
* share/txr/stdlib/compiler.tl (compiler comp-lambda): If the
nubmer of fixed parameters exceeds %max-lambda-fixed-args%,
then issue a warning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (defset_set_entries): Autoload entries for left,
right and key.
* share/txr/stdlib/defset.tl (left, right, key): New
simple-form defsets.
* tree.c (set_left, set_right, set_key): New functions.
(tree_init): Register intrinsics set-left, set-right and
set-key.
* tree.h (set_left, set_right, set_key): Declared.
* txr.1: key, left and right classified as accessors.
Documented set-key, set-left and set-right.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Within the op syntax, the new implicit variable @rec
now refers to the function itself. There is also @(rec ...)
for calling the function through a function binding.
For instance, here is Fibonacci:
(do if (> @1 1) (+ @(rec (pred @1)) @(rec (ppred @1))) 1)
* share/txr/stdlib/op.tl (sys:op-ctx): New slots rec and
recvar.
(sys:op-rec-p, sys:op-ensure-rec): New functions.
(sys:op-alpha-rename): Check for the new syntaxes and
translate to appropriate gensymed expressions, while updating
the context structure, so the expander is informed about
the @rec or @(rec ...) activity in the expression.
(sys:op-expand): Check whether @rec or @(rec ...) has
been used in the expression, and generate the necessary
variants to support it. We need to bind the lambda to a
recursive binding using the same mechanism that labels
uses, and possibly to bind the gensym underneat @rec
to the value of that function binding.
* txr.1: op documentation extended to cover the new
feature, plus some wording improvements.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a symbol-function form is used as a syntactic place,
the generated code makes a run-time call to
sys:get-fun-getter-setter. A recent commit changed the
interface of this function, which means that such code
which has been previously comipled (or somehow retained
in macro-expanded form) will break.
* share/txr/stdlib/place.tl (sys:get-fun-setter-getter):
Change the interface so it's backward compatible with the old
one: the first argument is the symbol, like before, and
thanks to optional arguments, it can be called with just that
argument.
(defplace symbol-function): Generate code to call
sys:get-fun-setter-getter accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (lookup_fun): Check for a lambda expression and
return a faked binding containing the interpreted function.
(do_eval, op_fun): Remove checks for lambda that are now
being done in lookup_fun. In many other places where
lookup_fun is used, we still need lambda checks, like
in the expander.
* share/txr/stdlib/place.tl (sys:get-fun-getter-setter): Take
form argument. Diagnose assignments to lambda, and to unknown
function place syntax.
(defplace symbol-function): Pass sys:*pl-form* to
sys:get-fun-getter-setter as form argument.
* txr.1: fboundp and symbol-function doc updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Oops! We have many instances of compile-error being called
in the old way with a format string as its first agument,
instead of a context argument.
* share/txr/stdlib/ifa.tl (ifa): Take :form argument, pass to
compile-error. Let's call this "fix M".
(sys:if-to-cond): Add form parameter, pass to compile-error.
Let's call this let's call this "fix F".
(conda, condlet): Fix M.
* share/txr/stdlib/place.tl (sys:*pl-form*): New special
variable. We need this in order to communicate the real place
form to the place expander, similarly to how we communicate
the original environment using sys:*pl-env*.
(call-update-expander, call-clobber-expander,
call-delete-expander): Bind sys:*pl-form* to the unexpanded
place.
(shift, lset): Fix M.
(defplace fun): Arrange for value of sys:*pl-form* to be
passed to compile-error. Let's call this "Fix P".
(sys:get-mb): Fix F.
(defplace symbol-macro): Fix P.
(placelet*, placelet): Fix M.
* share/txr/stdlib/txr-case.tl (txr-case-impl): Fix M.
* share/txr/stdlib/with-resources.tl (with-resources): Fix M.
|
|
|
|
|
| |
* share/txr/stdlib/op.tl (sys:op-expand): Replace ^(,*args)
with just args.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/build.tl (list-builder add,
list-builder pend, list-builder pend): Refer to previously
cached variable holding self.head or self.tail, instead of
re-accessing the slot.
|
|
|
|
|
| |
* share/txr/stdlib/build.tl (list-builder pend): Use tailp
instead of last and eq.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/build.tl (list-buider pend*): Fix typo:
apply should be append. Funny, this didn't propagate to ncon*.
* tests/012/seq.tl: Some list-builder tests via build macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rewriting be addition, pending and nconcing methods of
list-builder to avoid loops and rely on lower list processing
functions. This cleans up the semantics and error messages.
Some examples of behavioral changes:
(build (pend "abc") (add #\d)) now returns "abcd",
consistent with (append "abc" '(#\d)).
Previously it returned '(#\d).
(build (add 1) (pend 2) (pend 3)) now produces a "cannot
append to 2" error.
Previously it produced "copy: cannot copy object of type fixnum".
* share/txr/stdlib/build.tl (list-builder add): Don't use
copy-list; rather the idiom for copying a sequence in
preparation for appending to it is (append x nil). This will
blow up nicely if x is an atom other than nil. We use
this trick twice.
(list-builder add*): Simplify with append.
(pend, pend*, ncon): Rewrite.
(ncon*): Use nconc once on a combined argument list: this is
borrowed from the rewritten pend*.
* txr.1: Documentation updated with clarifications,
particularly in the area of the requirements regarding
destructive manipulation and substructure sharing.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/build.tl (list-buider add,
list-builder add*, list-builder pend, list-builder pend*):
Use copy-list rather than copy. This copies terminating
atoms without complaining.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The list builder is failing on the documented example
(build
(add 1 2)
(pend (get))
(pend (get)))
-> (1 2 1 2 1 2 1 2)
wrongly constructing an infinite list.
* share/txr/stdlib/build.tl (list-builder pend): When
destructively appending the next argument, check whether
the current tail is a tail of that object. If so, copy
the object to prevent a cycle from forming.
(list-builder pend*): When appending the old head to the
catenated list, do the tail check and copy the object if
necessary to prevent the creation of a cycle.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (expand-bind-mac-params):
Remove the plen gensym. We don't need to store the form length
in a variable, because the generated length check code
references the value exactly once. Let's just propagate that
the length calculating expression into that code.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Virtual machine local variables registers don't require
nil initialization. In cases when a complex variable
initializer is known to return nil, we can elide the move
instrution which moves that nil into the register.
* share/txr/stdlib/compiler.tl (null-reg): New function.
(compiler comp-let): Don't move the value of the output
register of the init fragment into the variable, if that
register is the null register t0.
|