| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
* txr.1: Clarify that list-like sequences are not lists.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: The wording is improved in the description of
sub-list, replace-list and all the other type specific
specializations of sub and replace. We avoid starting the
descriptions with "This function", and vague wording such
as "is like the sub function". Superfluous, obvious text like
"for a description of the semantics, see the sub function" is
removed. Also we avoid saying that the sub-list and
replace-list functions operate strictly on lists, since they
in fact operate on anything that supports list operations.
|
|
|
|
|
| |
* txr.1: Fix syntax section for carray-pun wrongly
showing carray-sub function name.
|
|
|
|
|
|
|
| |
* buf.c (buf_init): Intrinsics sub-buf and replace-buf
registered.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This slight inefficiency occurs in some 37 places in the code.
In most places we replace lt(x, zero) with minusp(x).
In a few places, !plusp(x) is used and surrounding logic is
simplified. In one case, the silly pattern
lt(x, zero) ? t : nil is replaced with just minusp(x).
* buf.c (sub_buf, replace_buf): Replace lt.
* combi.c (perm, rperm, comb, rcomb): Likewise.
* eval.c (do_format_field): Likewise.
* lib.c (listref, sub_list, replace_list, split_func,
split_star_func, match_str, lazy_sub-str, sub_str,
replace_str, sub_vec, replace_vec): Likewise.
* match.c (weird_merge): Likewise.
* regex.c (match_regex, match_regex_right_old,
match_regex_right, regex_prefix_match, regex_range_left,
regex_range_right): Likewise.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (usr:compile-file): Edit the
hash-bang line to replace the --lisp option with --compiled.
This supports the situation when a TXR Lisp hash bang script
that is unsuffixed is compiled to an unsuffixed compiled
script.
|
|
|
|
|
|
|
| |
* lib.c (cat_str, split_str_keep): Support single character
separator.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* lib.c (sel): Function converted to seq_info and iterators.
Negative indices handled in list case. Self-name corrected
to select; the C function is called sel just to avoid
clashing with POSIX select.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* buf.c (buf_check_index): Take struct buf p * parameter, to
be able to displace negative values using the buffer length.
(buf_put_bytes, buf_put_i8, puf_put_u8, but_put_char,
buf_put_uchar, buf_get_bytes, buf_get_i8, buf_get_u8,
buf_strm_get_byte_callback): Pass struct buf pointer to
buf_check_index. In buf_put_bytes, we use the returned value
instead of the original pos.
(buf_strm_seek): Don't use buf_check_index for validating the
position, since the negative indexing logic doesn't apply to
stream seek operations.
|
|
|
|
|
|
| |
* ffi.c (carray_refset): Support negative indexing by adding
the length of the array to a negative index value.
This is already done in carray_ref.
|
|
|
|
|
|
|
|
|
|
| |
The index-list replacement isn't following the convention that
negative index values reference from the end of the target
sequence. Let's fix that.
* lib.c (replace_list): Likewise.
* txr.1: Documentation updated.
|
|
|
|
|
|
| |
* lib.c (replace_str, replace_vec): Remove redundant
calculation of input sequence length; there is a len variable
bound on entry into the function.
|
|
|
|
|
| |
* ffi.c (carray_replace): add missing index list assignment
semantics required by documentation.
|
|
|
|
|
|
|
|
| |
* buf.c (replace_buf): New function.
* buf.h (replace_buf): Declared.
* lib.c (replace): Wire in.
|
|
|
|
|
|
| |
* Makefile (distclean): distclean target for not-configured
state removes .tlo files by wildcard, including the old .tlo2
files that we used to generate once.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (sub_vec): If range covers entire vector, just
return it.
* txr.1: Clarify that the output of sub may share structure
with the input regardless of type, not only when the input
is a list. This should have been updated when the optimizatin
was done in sub-str.
|
|
|
|
|
|
| |
* lib.c (toseq): Function removed.
* lib.h (toseq): Declaration removed.
|
|
|
|
|
|
|
| |
* lib.c (replace_vec, replace_str): Don't use dubious toseq
on input items, which converts non-sequence atoms into lists
of one. Use sequence iterators to reduce number of cases in
the code.
|
|
|
|
|
|
| |
* txr.1: carray is contrasted with the FFI type varray; but
there is no such type. varray is a name used internally in the
implementation; it means "variable-length zarray".
|
|
|
|
|
| |
* txr.1: Clarify how the null element in the C array is
generated for the dimensioned and undimensioned zarray.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The replace function now returns a list if a nil object's is
replaced with a range, rather than just returning the original
item sequence. This breaks the variable array in operation,
causing it to produce a list. We fix this sproblem, and also
the nonsense semantics of the operation also; the operation
should replace the original sequence, with the array,
similarly to how null terminated strings work.
* ffi.c (ffi_varray_null_term_in): If the original Lisp object
isn't nil, then assume it's a sequence and replace it with the
items gathered in the vector. Otherwise, replace it with the
vector.
* txr.1: Adjust documentation.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (replace_list): Avoid using the dubious toseq
function which turns a non-sequence object into a list of one
item. This is not documented. Rewrite the
assign-to-multiple-indices logic into one loop that uses
sequence iterators. A bug is fixed here: failing to step the
indices and items in parallel. Don't use list_vec on items;
it fails on strings. Strings are now supported properly: they
expand into a list of items that is spliced.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (seq_iter_peek_nil, seq_iter_peek_list,
seq_iter_peek_vec, seq_iter_peek_hash): New static functions.
(seq_geti): New function.
(seq_iter_init): Initialize new peek member of seq_iter
structure.
* lib.h (struct seq_iter): New member, peek.
(seq_peek): New inline function.
(seq_geti): Declared.
|
|
|
|
|
|
|
|
|
| |
* buf.c (sub_buf): New function.
* buf.h (sub_buf): Declared.
* lib.c (sub): Hook in BUF type.
(replace): Diagnose BUF specially as unsupported.
|
|
|
|
|
|
|
|
|
| |
* hash.c (hash_peek): New function.
(hash_init): hash-peek intrinsic registered.
* hash.h (hash_peek): Declared.
* txr.1: Documented.
|
|
|
|
|
|
| |
* hash.c (hash_next): We know after the loop that hi->cons is
not nil, because the loop contains no break, and is guarded
by hi->cons being nil.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This broke in TXR 216. TXR files with no suffix run
using #!/path/to/txr stopped working due to being interpreted
as Lisp. The rearrangement done in open_txr_file function
didn't respect the hacky treatment of the *txr_lisp_p flag,
which depended on the original order. The flag ends up being
set to t, because we tried (unsuccessfully) opening a .tl
suffix, and that then falsely indicates "Lisp" when the
unsuffixed file is open. That logic worked when we tried the
unsuffixed file first, and fell back on the added suffixes
last.
* parser.c (open-txr_file): Instead of repeatedly testing
for in == 0, we execute a forward goto when we successfully
open a file. Only in those successful cases, set *txr_lisp_p
to the appropriate value, not touching it otherwise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (sysif_init): registering variables e2big, eacces,
eaddrinuse, eaddrnotavail, eafnosupport, eagain, ealready,
ebadf, ebadmsg, ebusy, ecanceled, echild, econnaborted,
econnrefused, econnreset, edeadlk, edestaddrreq, edom,
edquot, eexist, efault, efbig, ehostunreach, eidrm, eilseq,
einprogress, eintr, einval, eio, eisconn, eisdir, eloop,
emfile, emlink, emsgsize, emultihop, enametoolong, enetdown,
enetreset, enetunreach, enfile, enobufs, enodata, enodev,
enoent, enoexec, enolck, enolink, enomem, enomsg,
enoprotoopt, enospc, enosr, enostr, enosys, enotconn,
enotdir, enotempty, enotrecoverable, enotsock, enotsup,
enotty, enxio, eopnotsupp, eoverflow, eownerdead, eperm,
epipe, eproto, eprotonosupport, eprototype, erange, erofs,
espipe, esrch, estale, etime, etimedout, etxtbsy ewouldblock
and exdev.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: changing HAVE_FCNTL_H to HAVE_FCNTL.
* sysif.c (flock_s, type_s, whence_s, start_s, len_s, pid_s):
New symbol variables.
(flock_pack, flock_unpack, fcntl_wrap): New static functions.
(sysif_init): Initialize new symbol variables.
Create flock struct type. Register new intrinsic variables:
o-accmode, o-rdonly, o-wronly, o-rdwr, o-creat, o-noctty,
o-trunc, o-append, o-nonblock, o-sync, o-async, o-directory,
o-nofollow, o-cloexec, o-direct, o-noatime, o-path, f-dupfd,
f-dupfd-cloexec, f-getfd, f-setfd, fd-cloexec, f-getfl,
f-setfl, f-getlk, f-setlk, f-setlkw, f-rdlck, f-wrlck,
f-unlck, seek-set, seek-cur and seek-end.
Register fcntl intrinsic function.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (sys:pl-expand): At each expansion
round, repeatedly expand the form as a place macro until that
can no longer be done and only then try macroexpand-1,
instead of just trying one place macro expansion.
* txr.1: Updated and revised description of expansion under
define-place-macro.
|
|
|
|
|
| |
* arith.c (int_flo): Don't subtract one from INT_PTR_MIN any
more, since it is now the most negative integer already.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (length_list, length_proper_list): Fix off-by-one bug
when calculating lengths of lists that overflow the cnum type.
Note that we will never see regular lists which hit this
situation, because there are more values in the range [0,
INT_PTR_MAX] then there are possible pointers in the system,
However, lazy lists can be that long or longer, because as we
calculate the length of a lazy list, the part we have already
traversed can be garbage-collected under the right
circumstances.
|
|
|
|
|
|
|
| |
* sysif.c (close_wrap): New static function.
(sysif_init): close intrinsic registered.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: add missing "or" to make "bitwise or".
|
|
|
|
| |
* txr.1: Misplaced comma nudged left.
|
|
|
|
| |
* txr: use .verb block instead of .mono block.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/path-test.tl (path-private-to-me,
path-strictly-private-to-me): These functions were neglecting
to trust the root user, as documented. If the file is owned
by root, we treat it as if it were owned by the caller.
Furthermore, if we have to process the group membership, we
allow the group to contain the superuser's name.
* txr.1: Documentation improved, and the treatment of
groups documented.
|
|
|
|
|
|
|
|
|
| |
* mpi.c (mp_set_int, mp_set_intptr, mp_set_double_intptr):
When the signed input is negative, do not simply calculate its
inverse with unary minus, because it could be the most
negative value that has no additive inverse. Instead, convert
to unsigned first, then apply the unary minus to the unsigned
type, which calculates the two's complement.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This bug causes a problem particularly in FFI. THe conversion
of an integer to the FFI int type begins by conversion via
c_num to the cnum type, which is at least as wide as int.
Alas, the INT_MIN value (e.g. #x-80000000 on 32 bits) will
not convert!
Fixing this has a ripple effect. We alter the INT_PTR_MIN
constant to include this value. This causes the derived
NUM_MIN to also include the extra negative value, extending
the fixnum range by one value. Everything seems to be okay.
* configure: Decrease value of INT_PTR_MIN and
DOUBLE_INTPTR_MIN constants by one to include the most
negative two's complement value.
* ffi.c (make_ffi_type_enum): We must not subtract 1 from
INT_PTR_MIN here any more.
* mpi.c (mp_in_range): If the bignum is negative, then extend
the range check by one value, so that we don't reject the
most negative two's complement value.
|
|
|
|
| |
* lib.h (maxint, minint): Remove unused macros.
|
|
|
|
| |
* win/fassoc.nsh: Patch applied.
|
|
|
|
|
|
|
|
|
| |
Add registration of .txr, .tl and .tlo suffixe.
* inst.nsi: Include fassoc.nsh file. Associate .txr, .tl and
.tlo with txr-win.exe
* win/fassoc.nsh: New file.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (sys:placelet-1): Adding
comment explaining why the explicit expansion and temporary
proxy place are necessary, even though in most cases
it can work fine without them.
|
|
|
|
|
| |
* share/txr/stdlib/asm.tl (%oc-list%): Unused global symbol
macro removed.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
| |
* txr.1: .PP added.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (open-compile-streams): The
input file is now determined in a manner similar to the load
function. If the path is relative and there is a *load-path*
binding, then it is now considered relative to *load-path*.
It is considered suffixed only if ending in .tl or
.txr. If unsuffixed, then it is first tried with the .tl
suffix.
(usr:compile-file): Bind *load-path* to the actual path used
for loading the file, rather than the input path.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (load): Bind *load-path* to the real path that was
used to open the file, not to the tentative path to which
the .tl suffix was added, subject to compatibility option.
* txr.1: Documentation for load revised for better wording and
to document the above change. Fixed *load-path* being wrongly
called a macro, and also load being called a macro.
Compat note added.
|
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (derived_s): New symbol variable.
(struct_init): Initialize derived_s symbol.
(make_struct_type): Check for derived method in parent, and
invoke.
* struct.h (derived_s): Declared.
* txr.1: Documented.
|