| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There used to be a hack in the Makefile whereby the
compilation of stdlib/error.tl was forced to occur earlier.
I got rid of it. Now, the issue that was solving reproduced.
A situation can occur whereby loading error.tl triggers
loading some other files, which end up performing an expansion
that needs sys:bind-mac-check: but that function has not yet
been defined because error.tl has not yet loaded that far.
The issue occurs when stdlib/place.tl is compiled before
stdlib/error.tl. The compiled place.tl has a run-time
dependency on functions in error.tl, because the compiled
version of mac-param-bind and other forms relies on a run-time
support function sys:bind-mac-check defined in stdlib/error.tl.
* stdlib/error.tl (sys:dig): This function triggers the
problem, but it's not the only cause. Here, the problem is
because the (set ...) macro is used which triggers loading the
stdlib/place module. That brings in the need for
bind-mac-params. So here we use sys:setq instead. That is not
a complete solution. The changes in eval.c are also required,
because built-in macros like whilet expand to code that uses
the (set ...) macro. Note how sys:dig uses whilet.
(sys:bind-mac-check, sys:bind-mac-error): We move these
functions above compile-warning. This addresses remaining
circularity problem. The compile-warning function uses the
catch macro which brings in stdlib/except.tl, which pulls in
stdlib/op.tl due to its use of (do ...), which pulls in
stdlib/place.tl. So if we already define sys:bind-mac-check
at that point, we are good.
* eval.c: Sweep the file for almost all places where macros
generate code that invokes (set <symbol> <value>) and replace
that with (sys:setq <symbol> <value>) to eliminate the
dependency on loading the stdlib/place.tl module.
(me_def_variable, me_gun, me_while_until_star, me_case,
me_whilet, me_mlet, me_load_for, me_pop_after_load):
In all these macro expanders, use sys:setq rather than set
in the generated code.
* tests/019/load-hook.tl: Some test cases here look for a
macro expansion containing (set ...), needing to be fixed
to look for (sys:setq ...) due to the change in eval.c.
|
|
|
|
|
| |
* txr.1: The rlink function resolves the target path
if it is a symlink, not the new link's path.
|
|
|
|
|
|
|
|
| |
* txr.1: Fix numerous occurrences of nil and t being
typeset using "meta" rather than "code". That makes them
slanted in the HTML and PDF, and appear in angle
brackets as <nil> and <t> in text-based man output.
We want a non-slanted type, and no angle brackets for these.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (dwim_del): Remove check against structures from
OBJ case; we just let this pass through to the logic that
invokes replace.
* tests/012/aseq.tl: New test cases.
* txr.1: Document how del works on a [obj index] place.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (invalidate_special_slots): New static function.
(invalidate_special_slot_nonexistence): Move static function
up in file, to be next to invalidate_special_slots.
(make_struct_type, static_slot_ens_rec): Call the new
invalidate_special_slots function in addition to calling
static_slot_home_fixup whenever the stslots array is resized.
The spslot array contains pointers to the elements of stslots,
which become invalid when that is resized.
* tests/012/oop-seq.tl: Repro test case added.
|
|
|
|
|
|
|
| |
* lib.c (dwim_set): The "not a place" diagnostic applies
not only in situations when the object is a list;
the diagnostic should not imply that the argument is a list
when it isn't.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register mref intrinsic.
* lib.[ch] (mref): New function.
* stdlib/place.tl (sys:mref1): New place.
(mref): New place macro, defined in terms
of sys:merf1, ref place and mref function.
* tests/012/seq.tl: New tests.
* txr.1: Documented.
|
|
|
|
| |
* stdlib/place.tl (dwim): Fix incorrect indentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ref function is not defined in the documentation
as an accessor, but there is a ref place. Unfortunately,
deletion is broken: (del (ref x y)) does not store the
new sequence back into place x, and so it does not work
correctly for lists; if x is a list, it doesn't change.
Various accessors are defined in terms of ref, as place
macros, such as the first, second, third, ... accessors.
This fixes the bug for them also; (del (second list))
must update list.
* stdlib/place.tl (ref): Fix the delete-expander to
fetch the clobber expander of the sequence place,
and use the simple setter to put the edited sequence into
that place.
* tests/012/seq.tl: Test case, which breaks without
this fix. Test the (second ...) place also, which is defined
in terms of ref.
* txr.1: Split documentation for ref and refset, mainly
because one is an Accessor and one is a Function. Removing
some discussions about the equivalences between DWIM brackets
and ref; there are subtleties there not worth going into.
Description of refset is simplified. We mention the possibility
of del over a ref place; only in that case is the sequence
itself required to be a place.
|
|
|
|
|
|
|
|
|
|
|
| |
* autoload.c (op_set_entries): Add tap symbol as autoload
trigger for op module.
* stdlib/op.tl (tap): New macro.
* tests/012/op.tl: New test.
* txr.1: Documented.
|
|
|
|
| |
* stdlib/quips.tl (%quips%): New one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The motivation here is that casequal brings in some optimizations
not done by match-case, like hashed lookup and jump tables.
* stdlib/match.tl (non-triv-pat-t): Move temporary definition
higher in file since it is needed earlier in the bootsrapping.
(match-case-to-casequal): New function.
(match-case): Try converting clauses to casequal with new
function. If that returns something, use that as the expansion,
otherwise perform the normal expansion.
* txr.1: Documentation revised. Existing text is wrong which
says that the clauses of a caseq, caseql or casequal are
always evaluated sequentially. Furthermore, now that
match-case and match-ecase can be transformed to casequal,
they also don't necessarily evaluate sequentially. We spell
out the conditions under which they may translate.
|
|
|
|
|
| |
* configure: make it clear that the user must run "make"
or "make all" before "make tests" and "make install".
|
|
|
|
|
|
| |
* autoload.c (match_set_entries): We must not just intern
match-error, but load the function if it is referenced.
Likewise, we must register an autoload for sys:match-pat-error.
|
|
|
|
|
|
|
| |
* genvim.txr (txr_quasilit): Fix gaping omission here: the
quasiliteral region does not contain any of the character
escapes, screwing up the syntax highlighting if any of them
occur.
|
|
|
|
|
|
| |
* Makefile (TXR_LDLIBS): Fix PLAFORM_LDLIBS typo in definition
of variable. This typo renders ineffective the --platform-ldlibs
option of the configure script.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are functions for testing whether a list or
sequence is shorter than a given integer. This is cheaper
than calculating the length of lists, which is in
some cases impossible if they are infinite.
A length-str-< function already exists, useful
with lazy strings.
length-< uses length-list-< or length-str-<
as appropriate
* lib.[ch] (length_list_lt, length_lt): New functions.
* eval.c (eval_init): length-list-< and length-<
intrinsics registered.
* tests/012/seq.tl: New tests.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: Document that flatcar and flatcar* accept
an atom argument, which is returned.
|
|
|
|
| |
* tests/012/seq.tl: New tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (lazy_flatten_scan): Fix a problem which results
in cases like (()), ((())) ... to incorrectly flatten
to (nil). The do loop in this function which iteratively
descends into a nested left-nesting of a list does not handle
all cases, and therefore the function may not return at that
point. Removing the return fixes the problem, but so does
removing the loop so that in that case we just descend one
level into the nested list, and continue in the main loop.
What is incorrect is that when the consp(a) test fails and the
do loop terminates, we need to distinguish the cases off
a being an atom versus nil. Continuing in the loop does that.
This bug was spotted by a reviewer in the comp.lang.c
Usenet newsgroup.
(lazy_flatten): We neglect to handle the case here that
the input is an empty list, resulting in (flatten* nil)
returning (nil) rather than nil. The flatten function
is correct.
* tests/012/seq.tl: New tests.
* txr.1: Documentation improved. In particular, these
functions don't handle improper lists. Also, it needs
to be documented that the argument may be an atom.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Defining libpng bindings, with longjmp catching, is
now possible.
* autoload.c (ffi_set_entries): Add setjmp symbol, which is
a new macro in stdlib/ffi.tl.
* ffi.c (jmp_buf_s): New symbol variable.
(mk_jmp_buf, rt_setjmp, longjmp_wrap): New functions.
(ffi_init): Initialize jmp_buf_s. Register
sys:rt-setjmp and longjmp intrinsics.
* ffi.h (jmp_buf_s): Declared.
* stdlib/ffi.h (setjmp): New macro. Rather than introducing
a new special operator, we use a run-time support function
called sys:rt-setjmp, which takes functional arguments.
* unwind.[ch] (uw_snapshot, uw_restore): New functions.
The rt_setjmp function needs these to restore our unwind
frame stack into a sane state after catching a longjmp,
which bails without unwinding it, leaving the pointers
referring to frames that no longer exist.
* tests/017/setjmp.tl,
* tests/017/setjmp.expected: New files.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register hist-sort intrinsic.
* lib.c (gt_f): New global variable.
(hist_succ_f): New static variable.
(hist_succ): New static function.
(hist_sort): New function.
* lib.h (gt_f, hist_sort): Declared.
* tests/012/sort.tl: New tests.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The T mode uses O_TMPFILE to create an unlinkd temporary file.
* stream.h (struct stdio_mode): New flag, tmpfile.
(stdio_mode_init_blank, stdio_mode_init_r, stdio_mode_init_rpb):
Updated to cover new bitfield member.
* stream.c (w_open_mode): If tmpfile flag is on, add O_TMPFILE.
(do_parse_mode): Recognize "T" mode selector and set all
appropriate mode bits. If we are not on a platform that has
O_TMPFILE, set the maformed flag.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This uses the linkat function to implement a variant of
link which resolves the source object if it is a symlink.
* configure: test for linkat.
* sysif.c (link_wrap_common): New static function, used
by both link_wrap and rlink_wrap.
(link_wrap): Now a one-liner which calls link_wrap_common.
(rlink_wrap): New static function.
(sysif_init): Register rlink intrinsic.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: the awk macro divides input into records
and fields, not records or fields.
|
|
|
|
|
| |
* txr.1: in description of weak packages, fix "uninterested"
symbols to "discarded".
|
|
|
|
|
| |
* txr.1: Fix hash-map being described as constructing a function.
It returns a hash table. Revise wording.
|
|
|
|
|
|
|
| |
* Makefile (.DELETE_ON_ERROR): Special target added.
The GNU Make manual says that this is what we always
want. Without this, a partially generated txr-manpage.html
target is not removed if the recipe happens to die.
|
|
|
|
|
|
|
|
| |
* txr.1: Revise all wording which says that arguments are applied
to a function, or other object being used as a function. I seem
to remember taking the same initiative some years ago, but wrong
usages have snuck in. I even found some in the definition of the
apply function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register nestd-vec-of and nested-vec
intrinsics.
* lib.[ch] (vec_allocate, vec_own, vec_init): New static functions.
(vector, copy_vec): Expressed in terms of new functions.
(nested_vec_of_v, nested_vec_v): New functions.
* args.[ch] (args_cat_from): New function.
* tests/010/vec.tl: New tests.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: Typos in recently added paragraphs.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* glob.c (glob_wrap): #ifdef GLOB_BRACE around code that removes
the flag.
(super_glob_find_inner): Initialize pst. The older compiler I'm
using on Solaris 10. isn't smart enough to figure out that it
is not used uninitialized.
* tests/018/glob.t: Skip the ...\/** test on Solaris. It
takes a long time, and produces nil in the end. We don't
care how it behaves, only that we pass through that
pattern to glob without interpreting it as a double star.
|
|
|
|
| |
* tests/018/glob.tl: exit successfully on Cygwin.
|
|
|
|
|
|
|
|
| |
* glob.c (glob_path_cmp): Compare bytes as unsigned.
After the loop, don't test whether the pointer are null;
they never are. Test whether they point to null.
* tests/018/glob.tl: Expected data replaced.
|
|
|
|
|
|
|
| |
* glob.c (super_glob_rec): Do not recognize a trailing /**
if it is preceded by a backslash.
* tests/018/glob.tl: Test case added.
|
|
|
|
|
|
|
|
|
| |
* autload.c (place_set_entries): Add ensure as an autoload
trigger symbol for the place module.
* stdlib/place.tl (ensure): New macro.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: new test for fchdir resulting in
HAVE_FCHDIR.
* sysif.c (get_fd): Define for HAVE_FCHDIR also.
(chdir_wrap): If HAVE_FCHDIR, handle non-string
arguments via fchdir, with help of get_fd.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The glob* function supports brace expansion, the **
pattern for matching zero or more path components,
as well as a sane sort for path names.
glob* relies on brace expansion written in Lisp;
the ** processing and sorting is done by a glob-compatible
C function called super_glob that uses glob.
* autoload.c (glob_set_entries, glob_instantiate): New static
functions.
(autoload_init): Register autoload of stdlib/glob module.
* glob.c (GLOB_XNOBRACE, GLOB_XSTAR): New macros.
(glob_wrap): Call super_glob instead of glob if GLOB_XSTAR
is present in flags. Avoid passing extension flags to glob.
(super_glob_find_inner, super_glob_rec, glob_path_cmp,
glob_str_cmp, super_glob): New static functions.
(glob_init): Register sys:glob-xstar, and glob-xnobrace.
sys:glob-xstar is used by glob* to request support for
the ** pattern from glob.
* stdlib/glob.tl: New file.
* tests/018/glob.tl: New file.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The vargs typedef is underused. Let's use it consistently
everywhere.
* args.c,
* args.h,
* args.c,
* args.h,
* arith.c,
* eval.c
* ffi.c,
* gc.c,
* hash.c,
* lib.c,
* lib.h,
* parser.c,
* stream.c,
* struct.c,
* struct.h,
* syslog.c,
* syslog.h,
* unwind.c,
* vm.c,
* vm.h: All "struct args * declarations replaced with existing
"varg" typedef that comes from lib.h.
|
|
|
|
|
|
|
|
| |
* tests/018/crypt.tl: replace (crypt "a" "*$") test with
(crypt "a" "::"). Musl's crypt treats all unrecognized hashes
through DES, and the DES module accepts almost anything
as salt characters, except '\0', '\n' and ':', since
those characters would wreck the password file.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (out_json_rec): Handle NUM and BGNUM cases same as FLNUM
so integers get printed. The restriction against integers has
been largely unhelpful and bothersome. Handle LCONS together with
CONS. Lists that are not special notation fall through to the VEC
case, which now uses seq_iter_t iteration to handle vectors and lists.
* tests/010/json.tl: New tests.
* txr.1: Documented support for printing integers and lists.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It has been reported by user cielesti that some of our
crypt tests fail on the Musl library.
Musl has some additional agorithms so it yields
a meaningful hash for a "$0$" salt, as well as for "$9$".
Musl uses "*" and "x" as error tokens rather than "*0"
and "*1". We need to change how we detect error tokens.
* sysif.c (crypt_wrap): Detect error tokens only by their
length: if a string emerges from crypt or crypt_r, whose
length is less than 13, it's an error token.
* tests/018/crypt.tl: Drop the tests that require :error
for salts "$0$" and "$9$", replacing them with a test
for a salt that is almost certainly invalid in all C libraries
on Linux.
* txr.1: Document that crypt throws an error exception and
under what circumstances (when the C library function does
what).
|
|
|
|
|
| |
* chksum.c: Fix incorrect comment stating that the crc32
functions are generated.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (sh_esc, sh_esc_all, sh_esc_dq, sh_esc_sq): New static
functions.
(stream_init): sh-esc, sh-esc-all, sh-esc-dq, sh-esc-sq: Intrinsics
registered.
* tests/018/sh-esc.tl: New file.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* lib.[ch] (str_esc): New function.
* eval.c (eval_init): str-esc intrinsic registered.
* tests/015/esc.tl: New file.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* stdlib/awk.tl (awk-state prn): Return nil in the no-argument
case instead of returning whatever put-string returns.
* tests/015/awk-misc.tl: New file.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These remove repetitive (op ...) syntax from
the arguments of functional combinators.
* stdlib/opt.tl (opf, lopf): New macros.
* autoload.c (op_set_entries): Register opf and
lopf as autoload triggers.
* tests/012/op.tl: New tests.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* genman.txr (process-ambiguities): Keep track of
calculated hashes and error out when there is a
duplicate. When the time comes, we will have to
resolve those somehow, and also change the doc
function to do it the same way.
|
|
|
|
|
|
| |
* genman.txr (symhash, tagma, tochash): Define
in @(do ...) block with defvar for consistency
ith other hashes.
|
|
|
|
|
|
|
|
|
| |
* genman.txr: remove the manual insertion of
the mapping of the "lbAB" tag to the new hash for "NAME",
the first section of the man page. This is an outdated
dud that does nothing. The tag is being properly processed
without this hack and the new hash-title function will assign
it to a different hash.
|