| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is not an easy change to make because it breaks the
validity of existing URLs in the wild which point to specific
sections of the TXR manual.
Some of my recent changes to capitalization of numerous
headings have already broken many URLs, so we might as well
bite the bullet and do this now.
The problem with the current scheme is that entire section
titles are hashed: all the words of a title, not just the
names of functions. Whenever we add a new function, macro or
variable which is documented together with related functions
in the same paragraph under the same heading, the heading
changes, and the hash changes. For instance, the hash for
the hash-map identifier is actually the hash of the string
"Function <tt>hash-map</tt>".
Under the new scheme, section titles are hashed in a more
complicated way that is robust against most edits. If a
title contains any symbols marked up with <tt>, then the
leftmost such symbol is taken as the title. Otherwise,
the whole title is mapped to lower case.
There is no longer a stdlib/doc-syms.tl file, and the
special disambiguated "D-<HEX>" codes are also gone.
Symbols are no longer associated with section hashes or
disambiguation section codes. The hash of a symbol is
a 32 bit CRC-32 checksum, expressed as S-<HEX> where
<HEX> is 8 hex digits. A section which defines symbols
has not only a <a name="..."> for its own hash but also
additional <a name="...>" elements for each of the symbols
that it defines.
If a section defines an ambiguous symbol (one that is also
defined with a different meaning in a different section),
then that symbol is not linked to either section; it is
mapped to the generated disambiguating section.
* genman.txr (dupes): Renamed to dupe-hashes for clarity.
(tagnum): Hash removed.
(direct): New hash. Tracks the assocation between sections
hashes and hashes of symbols that are defined only in
those symbols (no ambiguity) and thus the symbol hashes
can navigate directly to the sections. Serves as a
complement to the disamb hash.
(colli): There are no collisions now, so
initialize this to empty.
(hash-str): Function removed.
(hash-title): This function becomes more complicated.
If a title has at least one <tt>..</tt> item, then
that is taken in its place. Either way, the title
is transformed and enumerated against duplication and
hashed with crc32 instead of the original custom hashing
function.
(enumerate): Function removed: enumeration of titles is
done inside hash-title.
All manipulations of symhash using material from HTML now
use html-decode, so that we hash the original symbol
name like "str<" and not "str<".
When filtering the BODY, we have a new case: whenever
we see a <a name="...">, we now check the new direct
hash to see if there is a list of symbol hashes for
the given section. If so, we generate additional
<a name="..."> definitions for all the symbol hashes.
At the end of the file, the "missing from image"
processing is condensed, and the generation of the
stdlib/doc-syms.tl file is removed.
* stdlib/doc-syms.tl: Removed.
* stdlib/doc-lookup.tl: Don't load doc-syms. Use crc32
plus formatting to conver a symbol to the hash that is
used in the document and try the lookup with that.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* inst.nsi (RequestExecutionLevel): Use the value "highest"
instead of "admin", so that privilege is required for users
that have it, otherwise not.
(AccountType): New variable.
(.onInit): Obtain the account type and store it in AccountType.
Default the installation directory to $LOCALAPPDATA.
If the user is admin, change the default to the appropriate
Program Files directory.
(TXR): If the user isn't admin, add TXR to the current user's PATH
rather than the system PATH for everyone.
(Uninstall): Remove TXR from the appropriate PATH.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (tofloat_s, toint_s): New symbol variables.
(tofloat, toint): If the argument is a COBJ, handle
it via do_unary_method.
(arith_init): Initialize new symbol variables.
The functions tofloat, toint, tofloatz and tointz.
are now registered here, rather than eval_init.
* eval.c (eval_init): Remove registrations of tofloat,
toint, tofloatz and tointz.
* tests/016/ud-arith.tl: New tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
| |
* tests/016/ud-arith.tl (numbase): Add methods for
the newer functions: cbrt, erf, ...
Add tests covering these.
|