| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
* txr.1: Fix markup of syntax, invalid due to missing space.
|
|
|
|
|
| |
* txr.1: Clarify that both sort and nsort are not stable
for vectors and strings.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
| |
* txr.1: Section describing rcomb function wrongly
refers to comb.
|
|
|
|
|
|
|
|
|
| |
* txr.1: The Math Library is documented in a way that is
oblivious to User-Defined Arithmetic. This is now clarified.
When some of the argument types of a math function are
user-defined arithmetic structures, the stated conversions
and restrictions don't apply, since it defers all semantics
to the method invoked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've run into situations in which I wanted a comment in a
big JSON quasiliteral to explain some embedded piece of code.
We support only semicolon comments, and no #; ignore notation.
* parser.l (grammar): Recognize Lisp comments in the JSON
state also. That does it.
* tests/010/json.tl: One modest little test.
* txr.1: Documented.
* lex.yy.c.shipped: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (read_objects_common): New static function, formed
from read_objects_from-string.
(read_objects_from_string): Now wrapper for read_objects_common.
(read_objects): New function.
* parser.h (read_objects): Declared.
* eval.c (eval_init): Register read-objects intrinsic.
* autoload.c (getput_set_entries): Add three new symbols:
file-get-objects, file-put-objects and file-append-objects.
* stdlib/getput.tl (put-objects): New system function.
(file-get-objects, file-put-objects, file-append-objects):
New functions.
* txr.1: Documented.
* tests/018/getput.tl: New file.
|
|
|
|
|
|
|
|
|
|
|
| |
* hash.c (hash_join): New function.
(hash_init): hash-join intrinsic registered.
* hash.h (hash_join): Declared.
* tests/010/hash.tl: New tests.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* tests/010/hash.tl: Add test cases for the hash set operations.
* txr.1: Clarify that in hash-uni, the mapping functions are
used on all items, not just ones subject to joinfun.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When TXR executes a top-level program, such that it will
exit when the last form in that program terminates,
it simulates a load. There is a block named load visible,
and the program can evaluate a (return-from load <expr>).
The value of that <expr> is thrown away, and the
termination status is always unsuccessful.
In this patch, (return-from load <expr>) is made to work
such that the value of <expr> will determine the exit
status, according to the same interpretation that
(exit <expr>) would give to the value.
* sysif.[ch] (exit_wrap): Static function becomes external.
* txr.c (txr_main): In the cases where we execute a file
and return from main, we now call exit_wrap instead.
The termination status is not simply based on whether
the file was successfully read, but takes into account the
load block.
* tests/019/load-ret/{script.tl,bad.tl}: New files.
* tests/019/load-ret/load-ret.tl: New tests.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: Fix numerous "an" articles that should be "a",
as well as one case of "and" missing a "d".
|
|
|
|
|
|
|
|
| |
* txr.1: Add dialect note about TXR supporting ,',*args
whereby multiple items get spliced into a quote, which
effectively distributes into multiple quotes. The direct
equivalent does not work in all Common Lisp implementations,
and doesn't appear to be required by the standard.
|
|
|
|
| |
* txr.1: fix transposition: "ot" -> "to".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not all special characters can just be backslash escaped.
Spaces and newlines must be quoted.
* stream.c (sh_esc_common): New function. Handles both
sh-esc and sh-esc-all logic, distinguished by a flag.
Quoting is used, rather than backslash escaping.
If the string contains no special characters, it is just
erturned. If it can be double quoted, it is double quoted.
Otherwise it is single quoted and any contained single
quotes are replaced by '\''.
(sh_esc, sh_esc_all): Now just wrap sh_esc_common.
(sh_esc_dq): Remove the newline from the set of escaped
characters. Escaping a newline generates a continuation
sequence which eats the newline.
* tests/018/sh-esc.tl: Most test cases deleted; many new test
cases added.
* txr.1: Documentation revised.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This works fine:
1> (time-struct-utc 0)
#S(time year 1970 month 1 day 1 hour 0 min 0 sec 0 wday 4 yday 0
dst nil gmtoff 0 zone "GMT")
2> *1.(time-utc)
0
3> *1.(time-local)
28800
But we want the following to return the same results:
1> (time-struct-local 0)
#S(time year 1969 month 12 day 31 hour 16 min 0 sec 0 wday 3 yday 364
dst nil gmtoff -28800 zone "PST")
2> *1.(time-utc)
-57600
3> *1.(time-local)
-28800
With the patch, we do:
1> (time-struct-local 0)
#S(time year 1969 month 12 day 31 hour 16 min 0 sec 0 wday 3 yday 364
dst nil gmtoff -28800 zone "PST")
2> *1.(time-utc)
0
3> *1.(time-local)
28800
This is also broken:
1> (time-parse-utc "%H:%M:%z" "00:00:-0800")
-28800
It must return 28800.
* time.c (time_meth): This function, which is the
imlpementation of the time-utc and time-local methods, must
subtract the gmtoff field, not add it. This is so that
a UTC time expressed in a local time zone will convert
back to the correct UTC epoch.
(time_parse_local, time_parse_utc): Here we likewise
must subtract the gmtoff.
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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).
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/load-args.tl (load-args-process): When compile-update-file
doesn't do anything due to the compiled file being up-to-date,
the file must be loaded, so that the effect is similar to compiling.
Otherwise subsequent files may fail to compile due to missing
definitions such as packages.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* autoload.c (csort_set_entries): Register csort-group
as autoload trigger for stdlib/csort.tl.
* stdlib/csort.tl (csort-group): New function.
* tests/012/sort.tl: Tests for sort-group and csort-group.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch we change the convention of uncapitalized words
occurring in headings such as "Special variable *foo*".
* checkman.txr (check-var, check-func): Consolidated into
a single pattern function called check-coNP. This now
enforces capitalization, and also has a giant fall-back
clause which explicitly recognizes .coNP headings that
are not specially checked by the previous rules, after
which there is an error case, so that unclassified .coNP
headings are diagnosed. A bug is fixed here in the handling
of Special Variable and Variable headings. The pattern
match was wrong, so these were not being properly recognized.
Without the error case at the end, a number of errors
occur in the document where the .desc is missing after a
Variable or Special Variable.
* txr.1: (.dir, .dirs): Fix capitalization of Directive
and Directives in headings generated by this macro.
Fix capitalization in numerous .coNP headings.
* stdlib/doc-syms.tl: Updated. Unfortunately, many symbols
change their hash value because it's based on the entire
heading.
|
|
|
|
|
| |
* txr.1: Fix misspelled *stderr* in example demonstrating
binding of *stderr* to *stdnull*.
|
|
|
|
| |
* txr.1: Fix "User-defined Patterns" heading to "User-Defined".
|