| 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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
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 (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.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* hash.c (hash_peek): New function.
(hash_init): hash-peek intrinsic registered.
* hash.h (hash_peek): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (struct_set_entries): Add autoload entries for
new* and lnew* symbols.
* share/txr/stdlib/struct.tl (sys:new-type, sys:new-expander):
New functions.
(new, lnew): Macros now implemented using sys:new-expander.
(new*, lnew*): New macros.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* struct.c (struct_init): Register struct-type-name intrinsic.
(struct_type_name): New function.
* struct.h (struct_type_name): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch we change the strategy for resolving unsuffixed
paths in load and @(load). In load, an unsuffixed name is
tried with a .tlo suffix, then .tl and only if those don't
resolve to a file it is tried as-is. The previous order is
as-is, .tlo, .tl. Similarly in @(load), but unsuffixed paths
are tried as .txr, then .tlo, then .tl.
The motivation for this is to avoid probing the filesystem
multiple times the optimized case that we care about: loading
.tlo files from Lisp.
* parser.c (open_txr_file): Rearrange the probing strategy.
Also recognize .txr_profile as a suffix, treating it like .tl.
This is so that we don't probe for .txr_profile.tlo and
.txr_profile.tl before finding the profile.
(load_rcfile): Take advantage of the new path-not-found
exception. We avoid wastefully checking with path-exists-p
to avoid calling open_txr_file. We just let open_txr_file
throw an exception if the file doesn't exist, and then
distinguish the non-existence case in the handler.
* txr.1: Updated @(load) and load documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Several new more specific exception types are derived from
file-error and used. Error handlers can distinguish unexpected
non-existence, unexpected existence and permission errors
from each other and other errors.
* lib.c (path_not_found_s, path_exists_s, path_permission_s):
New symbol variables.
(obj_init): New variables initialized.
* lib.h (path_not_found_s, path_exists_s, path_permission_s):
Declared.
* parser.c (open_txr_file): Use new errno_to_file_error
function to convert errno to exception symbol.
* socket.c (open_sockfd): Likewise.
* stream.c (open_directory, open_file, open_fileno,
open_command, open_process, run, remove_path, rename_path):
Likewise, and process-error is used in open_process and run
instead of file-error for problems related to creating the
process.
* sysif.c (errno_to_file_error): New function.
(mkdir_wrap, ensure_dir, chdir_wrap, getcwd_wrap, mknod_wrap,
chmod_wrap, symlink_wrap, link_wrap, readlink_wrap, stat_impl,
umask_wrap, ): Use
errno_to_file_error to convert errno to exception symbol.
(exec_wrap): Use process-error instead of file-error.
* sysif.c (errno_to_file_error): Declared.
* unwind.c (uw_init): Register path-not-found, path-exists and
path-permission as subtypes of file-error.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (enum wmap_op): New enum type.
(window_map_list): Use enum wmap_op for last argument instead
of Boolean flag. If the argument is WMAP_MAPDO, do not
accumulate.
(window_map_vec, window_map, window_mapped): Adjust to new
enum argument.
(window_mapdo): New function.
* lib.h (window_mapdo): Declared.
* eval.c (eval_init): window-mapdo intrinsic registered.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: Document --backtrace and also that it is implied
by --debug.
|
|
|
|
|
|
|
|
| |
* struct.c (struct_init): allocate-struct intrinsic
registered.
(allocate_struct): New static function.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* hash.c (hash_print_op): Implement max length.
* lib.c (lazy_str_put, out_lazy_str): Take struct strm_base *
parameter and implement max length.
(out_quasi_str_sym): Don't use obj_print_impl for symbol's
name string; just put_string. The use of obj_print_impl causes
symbols appearing as variables in quasiliterals to be
truncated when max length is imposed.
(out_quasi_str): Implement max length.
(obj_print_impl): Implement max length and depth. Note that
there is now always a non-null ctx pointer.
(obj_print): Always set up context pointer for obj_print_impl.
Context now has pointer to low-level stream structure, where
we can access max_length and max_depth. It also carries the
recursion depth.
* lib.h (lazy_str_put): Declaration updated.
* stream.c (strm_base_init): Add initializers for max_length
and max_depth.
(put_string): Pass stream structure to lazy_str_put.
(set_max_length, set_max_depth): New functions.
(stream_init): set-max-length and set-max-depth intrinsics
registered.
* stream.h (struct strm_ctx): New members depth and strm.
(struct strm_base): New members max_length and max_depth.
(set_max_length, set_max_depth): Declared.
* txr.1: Documented.
|
|
|
|
|
|
| |
* txr.1: example of with-resources should use .verb not .mono.
This must be because it previously used .cblk without
indentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The fourth indent mode indent-foff (force off) is introduced.
* buf.c (buf_print): Turn on data mode indentation if
the current mode is not indent-foff, rather than when it
is indent-off.
* lib.c (obj_print_impl): The unconditional set_indent_mode
calls are replaced with test_neq_set_indent_mode so we only
set the mode if it is not forced off.
* stream.c (formatv): For the ! directive, turn on data
mode identation is not indent-foff, rather than when it is
indent-off.
(put_string, put_char, width_check): Recognize ident-foff as
indentation off.
(test_neq_set_indent_mode): New function.
(stream_init): Register test-neq-set-indent-mode function
and indent-foff variable.
* stream.h (indent_mode): New enum constant, indent_foff.
(test_neq_set_indent_mode): Declared.
* struct.c (struct_inst_print): Turn on data mode indentation
if the current mode is not indent-foff, rather than when it is
indent-off.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (except_set_entries): Autoload for catch** symbol.
* share/txr/stdlib/except.tl (catch**): New macro.
* txr.1: Document catch** macro, and the desc slot of
the catch-frame struct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* debug.c (debug_depth, debug_quit_s): Variables removed.
(step_mode, next_depth, breakpoints, last_command, cols):
Static variables removed.
(debug_check): C99 inline instantiation removed.
(help, show_bindings): Static functions removed.
(debug): Function removed.
(debug_set_state): Now takes one int argument, returns int.
It's anticipated that the new debug system will have a
simple on-off switch; there won't be a debug_depth hack.
(debug_restore_state): Function removed.
(debug_init): Emptied.
* debug.h (debug_depth, debug_state_t): Declarations removed.
(debug_enter, debug_leave, debug_return): Macros removed.
(debug_check): Inline function removed.
(debug_set_state): Declaration updated.
(debug_restore_state): Declaration removed.
(debug_frame, debug_end): Macros removed.
* eval.c (do_eval, me_interp_macro): Debugging support scrubbed.
* lisplib.c (lisplib_try_load): Adapt to debug_set_state
interface change.
* match.c (h_fun, do_match_line, v_fun, match_files,
match_fun): Debugging support scrubbed.
* parser.y (parse_once): Adapt to debug_set_state interface
change.
* protsym.c: Regenerated.
* signal.h (debug_depth): Declaration removed.
(EJ_DBG_MEMB, EJ_DBG_SAVE, EJ_DBG_REST): Macros removed.
(EJ_OPT_MEMB, EJ_OPT_SAVE, EJ_OPT_REST): Reduced to
unconditionally empty definitions for future use.
* unwind.c (uw_push_debug): Function removed.
* unwind.h (uw_frtype_t): UW_DBG enum member removed.
(struct uw_debug): struct declaration removed.
(union uw_frame): db member removed.
(uw_push_debug): Declaration removed.
* txr.1: Debugger doc removed.
|
|
|
|
|
| |
* txr.1: Repeated debug session with new version of the
navytime.txr script, and the latest TXR.
|
|
|
|
|
|
| |
* txr.1: Reformat lines in .verb blocks that are wider than
79 columns for the sake of reading the manual with man on an
80 column terminal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1 (.cblk, .cble): Macros renamed to .mono and .onom
respectively.
(.verb, .brev): New macros. These are like .cblk and .cble but
instead of just switching the font, they switch in and out of
non-formatting mode also with .nf/.fi.
Everywhere in the document, .cblk/.cble used for just font
changes are replaced with .mono/.onom, and those instances
used for preformatted code blocks are replaced with
.verb/.brev.
* checkman.txr (check-cblk): Removed.
(check-mono, check-verb): New pattern functions.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register cptr-size-hint intrinsic.
* lib.c (cptr_size_hint): New function.
* lib.h (cptr_size_hint): Declared.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: Document cptrp and cptr-type.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (r_ceil_s, r_round_s): New symbol variables.
(ceildiv, roundiv): Route binary cases involving struts
directly to binary methods so the object is responsible for
the complete implementation.
(arith_init): Initialize r_ceil_s and r_round_s.
* tests/016/ud-arith.tl (numbase): Binary methods added for
ceil and round. Test cases added.
* txr.1: Descriptions for binary ceil and round methods added;
Notes about non-existence of binary methods removed from unary
ceil and round removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/016/ud-arith.expected b/tests/016/ud-arith.tl:
New file.
* tests/016/ud-arith.expected b/tests/016/ud-arith.expected:
New file.
* arith.c (divi): Bugfix: wrong argument tested for being
a COBJ.
(logtrunc): Fix incorrect method call: calling r-logtrunc-s
for the object-in-left-position case.
(sign_extend): Fix semantics not following documentation:
dispatch method with original arguments.
(divv): When there is just one argument, take advantage of the
hitherto unused unary case of divi rather than giving it both
arguments. The object dispatch is in that unary case, so we
need it now.
(arith_init): Fix wrong name of r_lognot_s symbol.
* txr.1: Fix atan2 being documented as atan.
Fix misspelling of r-lognot as lognot-r.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the library now accepts struct objects as
arguments, relying on them to implement methods.
* arith.c (minus_s, inv_minus_s, neg_s, abs_s, signum_s,
mul_s, div_s, recip_s, inv_div_s, trunc1_s, trunc_s,
r_trunc_s, mod_s, r_mod_s, zerop_s, plusp_s, minusp_s,
evenp_s, oddp_s, gt_s, lt_s, ge_s, le_s, numeq_s, expt_s,
r_expt_s, exptmod_s, isqrt_s, square_s, floor_s, floor1_s,
r_floor_s, ceil_s, ceil1_s, round_s, round1_s, sin_s, cos_s,
tan_s, asin_s, acos_s, atan_s, atan2_s, r_atan2_s, log_s,
log2_s, log10_s, exp_s, sqrt_s, logand_s, logior_s, logxor_s,
lognot1_s, lognot_s, r_lognot_s, logtrunc_s, r_logtrunc_s,
sign_extend_s, ash_s, bit_s, width_s, logcount_s): New symbol
variables.
(not_struct_error, method_error, do_unary_method,
do_binary_method, do_ternary_method): New static functions.
(plus, minus, neg, abso, signum, mul, trunc1, trunc, mod,
floordiv, round1, roundiv, divi, zerop, plusp, minusp, evenp,
oddp, gt, lt, ge, le, numeq, expt, exptmod, isqrt, square,
floorf, ceili, since, cosi, tang, asine, atang, atang2, loga,
logten, logtwo, expo, sqroot, logand, logior, logxor,
comp_trunc, lognot, sign_extend, ash, bit, logcount, width,
bits, unary_num, unary_arith): Support struct arguments.
(plusv, minusv, mulv, divv, sumv, prodv, gtv, ltv, gev, lev,
numeqv, exptv, logandv, logiorv): Use symbol for self instead
of string lit.
(arith_init): Initialize new symbol variables. Replace
existing intern calls in function registrations with
references to some of these symbol variables.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* txr.1: umask returns the current value, not the value t.
The argument is optional, for just returning the current
value, which is done via a destructive trick that we should
document. Mention all the permission constants also.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|