| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* 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.
|
|
|
|
| |
* txr.1: Fix misspelled "elements" in 289 compatibility notes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/op.tl (sys:opip-single-let-p,
sys:opip-let-p): New functions.
(sys:opip-expand): Restructure from collect loop
to car/cdr recursive form, because the new let operators
in opip need access to the rest of the pipeline.
Implement let operators.
* tests/012/op.tl: New tests.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a regression due to a March 2016 commit which
introduced the ability for :vars in an output-side @(repeat)
block to have initial values.
The bug has the effect that all arguments in @(repeat)
which are conses/lists get duplicated, which messes up
the property list structure.
* parser.y (expand_repeat_rep_args): Do not unconditionally
add reg to the output at the bottom of the loop. A few
cases above in the consp(arg) case handle that themselves, and
do not continue the loop, so control ends up at the bottom,
adding a spurious item. By removing this list_collect,
we have to introduce it to just one case which relies on it.
* tests/008/repeat.txr,
* tests/008/repeat.expected: New files.
* y.tab.c.shipped: Updated.
|
|
|
|
|
|
|
|
|
|
|
| |
Discovered while experimenting with new optimizations.
* stdlib/optimize.tl (basic-blocks join-block): When we
join the following block into the current block, we must
propagate the nojoin property of the following block.
The nojoin property has to do with the last instruction
being xend. The joined block has that last instruction
and so must be nojoin.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Discovered while experimenting with new optimizations.
* stdlib/optimize.tl (basic-blocks :postinit): Pass t argument
to new parameter of basic-blocks link-graph.
(basic-blocks link-graph): New parameter indicating whether
this is the first call; if false, we reset all the links.
(basic-blocks elim-dead-code): This no longer has to reset
the links before calling link-graph. But now calls link-graph
one more time after the dead code removal so that no dead
blocks appear in the graph.
|
|
|
|
|
|
|
|
|
| |
* stdlib/place.tl (sys:get-fun-getter-setter): The check added
recently for a non-bindable sym at the top is completely
bogus, and makes it impossible to use trace for methods.
The function handles various kinds of function names that
are not symbols. The check must be done in the fallback
case, where plain symbols are handled.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* eval.c (error_trace): Push a new dynamic environment and
bind *print-circle* to t. More could be done here like
setting object limits.
|
|
|
|
|
|
|
|
| |
* stdlib/optimize.tl (basic-blocks :postinit): Calculate the
basic block partitions more directly using partition-if,
eliminating the calculation of two sequences of indices
that have to be merged and then passed to the partition
function.
|
|
|
|
|
|
|
| |
* stdlib/place.tl (sys:get-fun-setter-getter):
Throw error if sym isn't a bindable symbol, so
that nonsense like (set (symbol-function 3) ...)
isn't allowed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a pattern variable match like @foo references a global
symbol macro, that's treated as an existing expression to
match, and not a new binding. However, local symbol macros
are not treated this way; they are invisible to variable
patterns. That is an unintended inconsistency.
* stdlib/match.tl (var-list exists): Use lexical-binding-kind
rather than lexical-var-p. This returns true for lexical
symbol macros also.
* tests/011/patmatch.tl: New test cases.
* txr.1: Documentation revised to clarify that both global
and local symbol macros are considered to be existing variable
bindings by pattern matching.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* evalc (macro_k): New keyword symbol variable.
(lexical_binding_kind, lexical_fun_binding_kind)
New functions.
(lexical_var_p): Bugfix: if the symbol is a special
variable, do not short-circuit to a nil answer.
Special variables can be shadowed by symbol macros.
The function is now defined in terms of lexical_binding_kind.
(lexical_symacro_p, lexical_macro_p): New
functions.
(lexical_fun_p): Now defined using lexical_fun_binding_kind.
(lexical_lisp1_binding): Bugfix: check for special
variables; do not report special variables as :var.
(eval_init): Initialize macro_k. Register new intrinsics:
lexical-binding-kind, lexical-fun-binding-kind,
lexical-symacro-p, lexical-macro-p.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
| |
* tests/011/patmatch.tl: Move the form which compiles the
entire file to the end of the file, so that all the
interpreted test cases complete before we compile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When functions are optimized away due to constant folding,
instead of replacing them with a nil, we now compact the
table to close the gaps and renumber the references in the
code.
* stdlib/compiler.tl (compiler null-stab): Method removed.
(compiler compact-dregs): Renamed to compact-dregs-and-syms.
Now compacts the symbol table also. This is combined with
D-reg compacting because it makes just two passes through
the instruction: a pass to identify the used D registers
and symbol indices, and then another pass to edit the
instructions with the renamed D registers and renumbered
symbol indices.
(compiler optimize): Remove the call to the null-unused-data
on the basic-blocks object; nulling out D regs and symbol
table entries is no longer required. Fllow the rename of
compact-dregs to compact-dregs-and-syms which is called
the same way otherwise.
* stdlib/optimize.tl (basic-blocks null-unused-data):
No longer used method removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now have some constant folding in the optimizer too, not
just in the front end compiler pass. This is leaving behind
dead D registers that are not referenced in the code.
Let's compact the D register table to close the gap.
* stdlib/compiler.tl (compiler get-dreg): In this function
we no longer check that we have allocated too many D
registers. We let the counter blow past %lev-size%.
Because this creates the fighting chance that the compaction
of D regs will reduce their number to %lev-size% or less.
By doing this, we allow code to be compilable that otherwise
would not be: code that allocates too many D regs which
are then optimized away.
(compiler compact-dregs): New function. Does all the work.
(compiler optimize): Compact the D regs at optimization
level 5 or higher.
(compile-toplevel): Check for an overflowing D reg count
here, after optimization.
* stdlib/optimize.tl (basic-blocks null-unused-data):
Here, we no longer have to do anything with the D registers.
|