| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
* sysif.c (dirstat): Call lstat_wrap, rather than stat_wrap.
This function must report about the directory entry itself,
not about what that entry points to if it happens to be a
symlink. The d-type member of the dirent structure
representing a symlink must be set to dt-lnk.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ftw.c (ftw_callback): Pass nil to new parameter of
stat_to_struct, to have a new stat struct allocated as before.
* sysif.c (stat_to_struct, stat_impl, stat_wrap, lstat_wrap
dirstat): New optional parameter that lets caller specify an
existing struct object to fill.
(sysif_init): Adjust registrations of stat, fstat, lstat and
dirstat for new optional parameter.
* sysif.h (stat_to_struct, stat_wrap): Declarations updated.
* txr.1: Documented.
|
|
|
|
|
|
| |
* txr.1: Add remarks on the differences between how TXR Lisp
and ANSI CL deal with unhandled exceptions/conditions of type
error and warning.
|
|
|
|
|
| |
* txr.1: Improved wording and fixed some grammar issues in the
the paragraphs that introduce TXR Lisp exception handling.
|
|
|
|
| |
* txr.1: cptr-buf syntax wrongly refers to cptr-obj.
|
|
|
|
|
| |
* txr.1: "two three" should be three. Found thanks to the keen
eyes of Ivor Horton.
|
|
|
|
|
|
| |
* txr.1: Fix repeated "this this", and an an incorrect
insinuation that the ffi-get has an obj argument. Rather, it
returns an object.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions are quite helpful in dealing with semi-opaque
types, like the xmlNode type of libxml2. Such types must be
treated as an opaque handle when passed to and returned from
the API, and not subject to any encoding or decoding, which
means that the appropriate representation for them is via the
cptr family of types. However, semi-opaque types also have
client-visible members that must be accessed directly. These
new functions provide for that access in a convenient way.
* ffi.c (ffi_type_lookup_checked): New static function.
(cptr_getobj, cptr_out): New static functions.
(ffi_init): Register cptr-get and cptr-out.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A package is weak if it holds weak references to symbols,
meaning that if there are no references to a symbol other than
its entry in a weak package, it can be removed from the
package and reclaimed by the garbage collector.
* eval.c (eval_init): Update registrations for make-package
and sys:make-anon-package to reflect new optional argument.
* lib.c (make_package_common): New argument weak. If it is
true then both the hashes will have weak values.
(make_package, make_anon_package): New optional argument weak.
(obj_init): Add nil argument to calls to make_package. All the
standard packages are regular, not weak.
* lib.h (make_package, make_anon_package): Declarations
updated.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.h (minus_s): Declared.
* eval.c (reg_symacro): Changing to external linkage.
* eval.h (macro_time_s, reg_symacro): Declared.
* parser.c (repl): Bind the *-1 to *-20 symbol macros.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function back-fills the missing d-type information in a
dirent on platforms that don't provide d_type in the native
dirent.
* sysif.c (DT_FIFO, DT_CHR, DT_DIR, DT_BLK, DT_REG, DT_LNK,
DT_SOCK): Define all these preprocessor symbols to their Linux
values on platforms where DT_DIR is not defined.
(DT_UNKNOWN): Make sure this symbol is #undef-d if DT_DIR
is not defined, so the corresponding dt-unknown variable does
not exist.
(dirstat): New static function.
(sysif_init): Register dirstat intrinsic. Register dt-fifo and
the rest unconditionally now. Changing their order to
increasing numeric.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (opendir_free): Since d->dir may now be null, avoid
calling closedir on it in that situation. Also, set d->dir to
null after closedir.
(closedir_wrap): New static function.
(readdir_wrap): If the d->dir is null, safely treat that as a
directory entry not being available; do not pass a null DIR
pointer to readdir.
(sysif_init): Register intrinsic function closedir.
* txr.1: Documented, plus spelling error fix under readdir.
|
|
|
|
|
|
|
| |
* sysif.c (readdir_wrap): If d_name is "." or ".." loop around
and get another directory entry.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: Document that iter-more returns t when an
oop-iterator does not feature the iter-more method.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (UTF_DECL_OPENDIR): Macro defined, to enable
w_opendir declaration in utf8.h.
(w_opendir): Static function removed.
* sysif.c (UTF_DECL_OPENDIR): Macro defined.
(dir_s): Symbol defined unconditionally now, regardless of
HAVE_PWUID.
(dirent_s): New symbol.
(dirent_st): New static variable.
(struct dir): New struct type.
(opendir_free, opendir_mark opendir_wrap, readdir_wrap): New
static functions.
(opendir_ops): New static structure.
(sysif_init): Intern dirent symbol. Create dirent structure
type. Register opendir and readdir intrinsic functions.
Register variables dt-blk, dt-chr, dt-dir, dt-fifo, dt-lnk,
dt-reg, dt-sock and dt-unknown.
* utf8.c (UTF8_DECL_OPENDIR): Macro defined.
(w_opendir): Function moved here from stream.c, and turned
external.
* utf8.h (w_opendir): Declared, conditionally on
UTF8_DECL_OPENDIR being defined, so that most modules that
include utf8.h don't have to include <dirent.h>.
* txr.1: Documented.
diff --git a/sysif.c b/sysif.c
|
|
|
|
|
|
|
|
|
| |
* lib.c (list_seq_func): New static function.
(list_seq): Convert to lazy processing. The iterator is
threaded through the lazy cons's car field, so we don't have
to mutate the function's environment.
* txr.1: Added note about list-seq producing a lazy list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This turns out to be way easier than I thought.
* match.c (do_output_if): New static function.
(do_output): Handle if via do_output_if.
* parser.y (out_if_clause, out_elif_clauses_opt,
out_else_clause_opt): New nonterminal symbols and grammar
rules.
(out_clause): Now produces out_if_clause.
(not_a_clause): Remove ELIF and ELSE; these entries here cause
conflicts now. Here, continue to recognize the Lisp if, which
is distinguished by having at least two arguments.
out_if_clause matches only a one-argument if, and a
no-argumeent one that is diagnosed as erroneous.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (seq_iterable): Return t if argument is a structure
supporting the iter-begin method.
(seq_iter_get_oop, seq_iter_peek_oop, seq_iter_get_fast_oop,
seq_iter_peek_fast_oop): New static functions.
(seq_iter_init_with_info): Handle COBJ case. If the COBJ is a
structure which suports the iter-begin method, then retrieve
the iterator object by calling it, and then prepare the
iterator structure for either the fast or the canonical
protocol based on whether the iterator supports iter-more.
(seq_iter_mark): Mark the iter member if the iterator is a
struct object.
(iter_begin): Rearrange tests here to check object type first
before sequence kind. If the object is a structure supporting
the iter-begin method, then call it and return its value.
(iter_more, iter_step): Check for struct object with
corresponding special methods and return.
(iter_reset): Similar change like in iter_begin. We check for
the iter-reset special method and try to use it, otherwise
fall back on the regular iter_begin logic.
* lib.h (struct seq_iter): New member next of the ul union
for caching the result of a peek operation.
* struct.c (iter_begin_s, iter_more_s, iter_item_s,
iter_step_s, iter_reset_s): New symbol variables;
(special_sym): Pointers to new symbol variables added to
array.
(struct_init): New symbol variables initialized.
(get_special_required_slot): New function.
* struct.h (iter_begin_s, iter_more_s, iter_item_s,
iter_step_s, iter_reset_s): Declared.
(enum special_slot): New enum members iter_begin_m,
iter_more_m, iter_item_m, iter_step_m, iter_reset_m.
(get_special_required_slot): Declared.
* txr.1: Documented.
* tests/012/oop-seq.expected: New file.
* tests/012/oop-seq.tl: New file.
|
|
|
|
| |
* txr.1: article missing: "satisfies [the] predicate function".
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register iterable intrinsic.
* lib.c (seq_iterable): New static function.
(nullify): Use seq_iterable to simplify function.
(iterable): New function.
* lib.h (iterable): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows a CRC-32 calculation over multiple objects in
multiple steps.
* chksum.c (crc32_stream, crc32_buf, crc32_str, crc32): Take
additional argument.
(chksum_init): Add optional argument to registration of
crc32-stream and crc32 intrinsics.
* chksum.h (crc32_stream, crc32): Declarations updated.
* txr.1: Doc updated; two examples added.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (each_prod_instantiate, each_prod_set_entries):
New static functions.
(lisplib_init): Register autoload of each-prod.tl via new
functions.
* share/txr/stdlib/each-prod.tl: New file.
* txr.1: Documented. Also, under the existing collect-each
family of operators, added the equivalence to mapping with
lambda to help clarify the semantics.
|
|
|
|
|
|
|
|
|
|
| |
maprodo is like maprod, but doesn't collect or return
anything. It's the Cartesian product analog of mapdo.
* eval.c (collect_nothing, maprodo): New static functions.
(eval_init): Register maprodo intrinsic.
* txr.1: Documented.
|
|
|
|
|
|
| |
* txr.1: In length and empty, don't refer to an "object"
parameter since the syntax calls it "iterable". Simplified
description of length.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions convert any iterable to a list, vector or
string.
* eval.c (eval_init): Registered list-seq, vec-seq and str-seq
intrinsics.
* lib.c (list_seq, vec_seq, str_seq): New functions.
* lib.h (list_seq, vec_seq, str_seq): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* configure: detect strsignal, producing HAVE_STRSIGNAL symbol
in config.h.
* sysif.c (strsignal_wrap): New function.
(sysif_init): Register strsignal intrinsic.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (exit_wrap): Check for missing status argument, and
map to EXIT_SUCCESS.
(sysif_init): Register exit as having optional argument.
* txr.1: Update documentation regarding optional argument of
exit. Also, EXIT_SUCCESS and EXIT_FAILURE are no longer
mentioned, only that t maps to succes and nil to failure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All string_utf8(strerror(x)) calls are replaced with
errno_to_str(x).
* sysif.c (errno_to_str): New function.
(strerror_wrap): Now implemented via call to errno_to_str.
(mkdir_wrap, ensure_dir, chdir_wrap, getcwd_wrap, rmdir_wrap,
mknod_wrap, mkfifo_wrap, chmod_wrap, do_chown, symlink_wrap,
link_wrap, readlink_wrap, close_wrap, exec_wrap, stat_impl,
do_utimes, pipe_wrap, poll_wrap, getgroups_wrap, setuid_wrap,
seteuid_wrap, setgid_wrap, setegid_wrap, setgroups_wrap,
getresuid_wrap, getresgid_wrap, setresuid_wrap,
setresgid_wrap, crypt_wrap, uname_wrap): Use errno_to_str.
* sysif.h (errno_to_str): Declared.
* ftw.c (ftw_wrap): Use errno_to_str.
* socket.c (dgram_get_byte_callback, dgram_flush, sock_bind,
open_sockfd, sock_connect, sock_listen, sock_accept,
sock_shutdown, sock_timeout, socketpair_wrap): Likewise.
* stream.c (errno_to_string): Likewise, and don't handle
zero case any more; pass down to errno_to_str.
(stdio_close, pipe_close open_directory, open_file,
open_fileno, open_tail, fds_subst, open_command,
open_subprocess, run, remove_path, rename_path): Use
errno_to_str.
* termios.c (tcgetattr_wrap, tcsetattr_wrap, tcsetattr_wrap,
tcsendbreak_wrap, tcdrain_wrap, tcflush_wrap, tcflow_wrap):
Likewise.
diff --git a/termios.c b/termios.c
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure (have_strerror_r): New variable.
Detect whether we have strerror_r and which flavor:
GNU or POSIX. Define HAVE_STRERROR_GNU or HAVE_STRERROR_POSIX
in config.h.
* sysif.c (strerror_wrap): New function.
(sysif_init): Register strerror intrinsic.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* txr.1: Implementing new >< operator in the getm macro
syntax. >< foo x bar renders as <foo>x<bar> in the nroff-ed
man output; in HTML and PDF, foo and bar are italicized.
This is put to use in the Built-In Syntactic Places section to
correct the formatting of struct-obj.slot-name.
|
|
|
|
|
|
|
|
| |
* txr.1: Fix missing backslash on font changing directive in
the troff-oriented implementation of the <> operator.
This makes no difference to the output. The HTML output is
absolutely identical according to diff. Visual inspections of
the groff-generated PDF also reveal no difference.
|
|
|
|
|
| |
* txr.1: Fix "Buffers" and "The buf type" being at equal
section levels. Adjust the cptr type section to harmonize.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* txr.1: Fix instances in which the sequence argument of a
sequence manipulating function is called a list or object.
Also fix some unnecessary abbreviation of sequence to seq.
|
|
|
|
|
|
|
| |
* txr.1: Relocate description of nullify from bottom of
Sequence Manipulation to near the top, after the description
of empty. This is very similar to the recent relocation of
nullify in lib.c and lib.h.
|
|
|
|
|
|
|
| |
* txr.1: Move description of make-like from near the bottom of
the Sequence Manipulation section to close to the top, just
under the seqp description. Also, ref-sequence parameter is
renamed to object.
|
|
|
|
|
| |
* txr.1: Move description of copy function out of Sequence
Manipulation and into Object Equivalence.
|
|
|
|
|
|
| |
* txr.1: Move the descriptions of apply and iapply out of
Sequence Manipulation and into Functions, following the
description of the call function.
|
|
|
|
|
| |
* txr.1: Nullify documentation updated and clarified, with
examples.
|
|
|
|
|
|
|
|
| |
* doc: Add paragraphs uder Sequence Manipulation discussing
support for sequences, iterables and hashes. Establish naming
cnovention for arguments: iterables are called iterable or
iter. Update descriptions of functions that work with
iterables.
|
|
|
|
|
|
| |
* txr.1: The init-forms in (each ...) must be suitable for
iter-init and that is now documented. A (range 1 10)
in the example is replaced with 1..11.
|
|
|
|
|
| |
* txr.1: New section added under TXR LISP to introduce the
new iteration concept.
|
|
|
|
|
| |
* txr.1: Add more detail about list handling, and cover
numbers and ranges.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
iter-begin provides a paradigm for iteration that is more
compatible with lists. If the sequence is a list, then the
list itself is returned as the iterator, and the other
functions are basicaly wrappers for car/cdr and null testing.
Yet the API is defined in such a way that other objects can be
iterated with good efficiency, at the cost of allocating a new
iterator object (which can be re-used).
* eval.c (eval_init): Register iter-begin, iter-more,
iter-item, iter-step and iter-reset.
* lib.c (seq_iter_init_with_info): New static function.
(seq_iter_init): Now a thin wrapper for
seq_iter_init_with_info.
(iter_begin, iter_more, iter_item, iter_step, iter_reset): New
functions.
* lib.h (iter_begin, iter_more, iter_item, iter_step,
iter_reset): New functions.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
| |
* txr.1: Fix extra whitespace around env parameter.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (seq_getpos, seq_setpos): New functions.
* lib.h (seq_getpos, seq_setpos): Declared.
(search_list, rsearch_list): Static functions removed.
(search_common): New static function.
(search, contains, rsearch): These functions are now trivial
wrappers around search_common. A requirement problem is fixed
in rsearch: when the key is empty, the length of sequence is
returned rather than zero, because zero is obviously not the
right most place where an empty key matches.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fossies administrator Jens alerted me to some typos.
* txr.1: Fix two instances of alphanumeric being hyphenated,
and one case of invocable being rendered as invokable.
* linenoise/linenoise.c (struct lino_state): Misspelled
"buffer" in a comment. One other comment typos in this file is
from the original code, so it stays: who needs yet another
merge conflict? Not touching the original typo in example.c,
either.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (rt_assert_fail, me_assert): New static functions.
(eval_init): assert macro and sys:rt-assert-fail function
registered.
* lib.c (func_n4ov): New function.
* lib.h (func_n4ov): Declared.
* txr.1: Documented.
|