| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* tree.c (tr_delete_specific): We cant' juse use key(node)
as the search key; we must apply the tree's key function
to the node key field to retrieve the correct search key.
* tests/010/tree.tl: New test case which fails without
this bugfix: a node which is the left subtree of the root
node doesn't get deleted since the search is led astray
by the wrong key object.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (listener_auto_compound_s): New symbol variable.
(repl): If *listener-auto-compound-p* is true, then evaluate
multiple forms directly as a compound expression, without
inserting progn at the head.
(parse_init): Initialize symbol variable and register
the *listener-auto-compound-p* special.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
| |
* parser.c (parse_init): Set the initial value
of *listener-sel-inclusive-p* to t instead of nil,
since terminals tend to have block cursors by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This problem was reported by Void Linux package maintainer
adigitoleo.
* configure: in glibc, _TIME_BITS and _FILE_OFFSET_BITS
are not independent. You cannot make the former 64 if
the latter isn't. I'm rewriting the test to check for
these together, in all combinations. We succeed if
we detect a combination that makes both time_t and
off_t 64 bits. If we don't find such a combination then
we at least enable 64 bit off_t alone or 64 bit time_t
alone, if we encountered an option which does that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (COMPILE_C_WITH_DEPS, WINDRES): Do not call mkdir.
(win/%.res): Express dependency on existence of win
subdirectory in the build directory. We use an order-only
prerequisite, so that timestamps are not compared.
We don't want to be rebuilding objects if the directory
they are in has a newer timestamp, which is often the case.
(OBJS): Extract the relative directory paths from $(OBJS),
and make each directory the target of a rule which creates it.
Then, make each target in $(OBJS) dependent (order-only) on
the directory into which it will be placed, so before that
object is built, the directory gets created with mkdir -p.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We get rid of the sed-based processing which produces .v
files from .d files. The only purpose of the variable
assignments in the .v files ended up being a filter
expression in the ABBREVN macro. I think the idea here
was to show all the direct prerequisites of the target,
suppressing the ones computed by generated dependency rules.
* Makefile (ABBREVN): Just use $^ instead filtering
out $^ using the $(DEP_$@) computed variable that holds
all the dependencies. I don't see an issue. This is
only used for linking and it correctly shows the .o
files.
(DEPGEN): Macro removed.
(COMPILE_C_WITH_DEPS): Remove call to DEPGEN, removing
an ugly sed step from the compilation of each file.
(NL, CM, DEP): Macros removed.
(OBJS, EXTRA_OBJS): Directly write rule which makes
all objects depend on config.make.
(opt/lex.yy.o, opt/txr.o, opt/match.o, opt/parser.o,
opt/y.tab.o, dbg/lex.yy.o, dbg/txr.o, dbg/match.o,
dbg/parser.o, dbg/y.tab.o): Explicitly write direct
rules for these so the parser generation is correctly
hooked into the dependency graph.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (unuse_sym): A used symbol may now appear in a package
under a different name. So if we don't find a symbol under
the symbol's name, or find a different symbol, we must try
a reverse hash search before giving up.
* txr.1: Add notes to use-sym-as that unuse-sym must be
used to undo its effect. Add notes to unuse-sym discussing
similarities and differences versus unintern.
* tests/012/use-as.tl: New test cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new function use-sym-as can bring a foreign
symbol into a package under a different name,
which is not that symbol's name. This is also
featured in a new defpackage clause, :use-syms-as.
With this simple relaxation in the package system,
we don't require package local nicknames, which is
more complicated to implement and less ergonomic,
because it doesn't actually vanquish the use of
ugly package prefixes on clashing symbols.
* eval.c (eval_init): Register use-syms-as.
* lib.c (use_sym_as): New function, made out of
use_sym.
(use_sym): Now a wrapper for use_sym_as.
* lib.h (use_sym_as): Declared.
* stdlib/package.tl (defpackage): Implement :use-syms-as
clause.
* tests/012/use-as.tl: New file.
* txr.1: Documented,
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (compiler comp-fun-form): Recognize
the pattern (subtypep (typeof x) y) and rewrite it to
(typep x y).
* stdlib/match.tl (compile-struct-match): Don't generate
the (subtype (typeof x) y) pattern, but (typeof x y).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/op.tl (opip-expand): Take arguments which specify
the op and do operators to be inserted. Pass these
through the recursive calls.
(opip, oand): Pass op and do for the new arguments.
(lopip, loand): New macros like opip and oand, but
passing lop and ldo to the expander.
(lflow): New macro.
* autoload.c (op_set_entries): Add autoload entries
for lopip, loand and lflow.
* tests/012/op.tl: A few new tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Regenerated.
|
|
|
|
|
| |
* txr.1: Mention that @nil can be used in pattern matching
to suppress unused variable warnings.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (close_stream): If the underlying method
returns the colon symbol :, then keep the cached
close_result as nil, so that the method can be called
again, but return t to the caller to indicate success.
* tests/018/close-delegate.tl: Test case added.
* tests/018/close-delegate.expected: Updated.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* socket.c (dgram_close): Return t when a
descriptor is closed, returning nil only when
the object is already in a closed state.
* stream.c (dev_null_close, dir_close): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is motivated by trying to implement a struct delegate
stream which performs reference counting in close, in
order to close the real stream when the count hits zero.
The caching behavior of close-stream is a problem.
* stream.c (strm_base_init): Initialize close_result to nil,
rather than nao.
(strm_base_mark): Don't check close_result for nao.
(close_stream): Suppress the call to op->close if close_result
has a non-nil value, rather than a value other than nao.
* tests/018/close-delegate.tl,
* tests/018/close-delegate.expected: New files.
* txr.1: Document that only a non-nil return is cached
by close-stream.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (dump-to-tlo): To ensure numbers are
externalized in such a way that they will be loaded back
exactly, we need to set a few special variables. For integers,
we want *print-base* to be 10. Numbers printed in other bases
cannot be read back correctly. Octal, hex and binary could be,
but they would need to be printed with the correct prefixes.
For floating-point values, we want to switch to the default
print format, and use flo-max-dig for the precision. That one
s not not the default value; the default is flo-dig.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compilation of stdlib from source code (an initial state
when no .tlo files exist obtained by "make clean" or
"make clean-tlo") is very sensitive to the file order.
If the compiler and optimize modules are compiled late,
it slows down the build greatly.
The compiler mainly executes the code in the files
compiler.tl, param.tl, optimize.tl and asm.tl. These
should be compiled first, and I empirically determined
the best order.
* Makefile (STDLIB_EARLY_PATS): Remove error.tlo. The circular
dependency involving error.tl doesn't seem to be an issue
any more. A while ago I addressed some circular dependencies
in stdlib that prevented it from being usable uncompiled;
make tests didn't pass with a source-only stdlib.
We instead repurpose STDLIB_EARLY_PATS to specify the four
modules that should compile first, in their desired order,
at least if parallel make is not being used.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure (txr_ver): Bumped version.
* stdlib/ver.tl (lib-version): Bumped.
* txr.1: Bumped version and date.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The optimizer eliminates calls to pure library functions when
all their arguments are D-registers. The call is made at
compiled time and its value is inserted into the program
as a constant (in a newly allocated D register).
The bug is that we can't do this for a D register that
is linked to a load-time value, because we don't know its
value until run-time.
* stdlib/optimize.tl (basic-blocks do-peephole-block): Add
a constraint that none of the D registers can be a member
of bb.lt-dregs, which holds the list of D registers that
are used for load-time values.
|