| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The checks for native Windows are incorrect, plus there
are some issues in the path-volume function.
We cannot check for native Windows at macro-expansion time simply by
calling (find #\\ path-sep-chars) because we compile on Cygwin where
that is false. What we must do is check for being on Windows at
macro-expansion time, and then in the "yes" branch of that decision, the
code must perform the path-sep-char test at run-time. In the "no"
branch, we can output smaller code that doesn't deal with Windows.
* stdlib/copy-file.tl (if-windows, if-native-windows): New macro, which
give a clear syntax to the above described testing.
(path-split): Use if-native-windows.
(path-volume): Use if-native-windows. In addition, fix some broken
tests. The tests for a UNC path "//whatever" cannot just test that the
first components are "", because that also matches the path "/".
It has t be that the first two components are "", and there are more
components. A similar issue occurs in the situation when there is
a drive letter. We cannot conclude that if the component after the
drive letter is "", then it's a drive absolute path, because that
situation occurs in a path like "c:" which is relative.
We also destructively manipulate the path to splice out the volume
part and turn it into a simple relative or absolute path. This is
because the path-simplify function deosn't deal with the volume prefix;
its logic like eliminating .. navigations from root do not work if the
prefix component is present.
(rel-path): We handle a missing error case here: one path has volume
prefix and the other doesn't. Also the error cases that can only occur
on Windows are wrapped with if-windows to remove them at compile time.
|
|
|
|
|
|
|
|
| |
* stdlib/match.tl (compile-match): Handle
the (sys:expr (sys:quasi ...)) case by recursing on
the (sys:quasi ...) part, thus making them equivalent.
This fixes the newly introduced broken test cases, and meets
the newly documented requirements.
|
|
|
|
|
|
| |
* tests/011/patmatch.tl: Add failing test cases.
* txr.1: Document desired requirements.
|
|
|
|
|
|
|
| |
* stdlib/pic.tl (insert-commas): Use ifa to bind the
anaphoric variable it to [num (pred i)]. With the new
ifa behavior involving read-place, this now prevents
two accesses to the array.
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/ifa.tl (ifa): When the form bound to the it
anaphoric variable is a place, such that we use placelet,
wrap the place in (read-once ...) so that multiple
evaluations of it don't cause multiple accesses of the
place.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (place_set_entries): Trigger autoload on
read-once.
* stdlib/place.t (read-once): New function and place.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following behavior is observed. When we clean the compiled files
using "make clean-tlo", then autoloading during completion does not
work reliably for some symbols like dissassemble and compile.
The symbols don't complete, and afterward, the functions remain
undefined, and no longer autoload.
The root cause is that when some modules are loaded form source,
deferred warnings occur, due to code referring to symbols that
are defined later. But the provide_completions function installs
a catch for all exceptions, including deferred warnings. It
thereby abruptly terminates loads which trigger deferred warnings,
leaving them half-complete.
The fix is to catch only errors.
* parser.c (catch_error): New global variable.
(load_rcfile): Use catch_error from now on instead of locally
consing this.
(provide_completions): Use catch_error instead of catch_all.
(parse_init): gc-protect catch_error and initialize it.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function includes the 1.0 value excluded by random-float.
* rand.c (random_float_incl): New static function.
(rand_init): Register random_float_incl intrinsic.
* txr.1: Document, and add discussion about uniformity requirements
and what they mean and do not mean.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ffi.c (ff_cptr_in, ffi_carray_in): New static functions.
(ffi_type_compile): Wire in new functions for dynamically
compiled cptr and carray types.
(ffi_init_types): Also, wire in ffi_cptr_in function for
the non-parametrized cptr type.
(carray_set_ptr): New function.
* ffi.h (carray_set_ptr): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (compiler optimize): After the dataflow-driven
peephole optimization, call elim-dead-code again.
* stdlib/optimize.tl (basic-blocks check-bypass-empty): New method.
(basic-bocks elim-dead-code): After eliminating unreachable blocks
from the list, we use check-bypass-empty to squeeze out any
empty blocks: blocks that have no instructions in their list,
other than the leading label. This helps elim-next-jmp
to find more opportunities to eliminate a wasteful jump, because
sometimes these jumps straddle over empty blocks.
Furthermore, elim-next-jmp can generate more empty blocks itself;
so we check for this situation, delete the blocks and iterate.
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/optimize.tl (basic-blocks elim-dead-code): When
clearing the links before recalculating the graph, also clear
the next field of every block, because link-graph only sets
this if necessary, assuming that the value is already nil.
Thus by not resetting it, we risk leaving stale values in
these .next fields. The code reachability calculation relies
on next fields, so if they falsely point to dead blocks, those
blocks could be falsely retained.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The parser wrongly reads #(#; abc) as (nil) instead of (), and
related cases derived from this one are all likewise wrong.
A number of tests added in the previous commit target this
and fail. They are hereby fixed.
* parser.y (listacc): In the productions that begin with
HASH_SEMI, do not produce a (nil . nil) leading cons, but a
(nao . nil) leading cons; so the fact that the first item is
commented out is represented by a nao in the car field of the
leading cons.
(n_exprs): If the first element of the list produced by the
listacc grammar symbol is nao, then pop it off. Thereby, we
lose the spurious nil that we previously had there left by the
commented-out item.
* y.tab.c.shipped: Updated.
|
|
|
|
| |
* tests/012/syntax.tl: New tests, some of which fail.
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/compiler.tl (usr:compile-toplevel): Do not
bind *load-time* to t at the top level. The idea behind this
binding was to treat load-time as a transparent form that does
nothing if it occurs in the top-level since the top-level is
already at load-time. However, this is problematic because it
breaks the expectation that load-time calculations are
factored out of a form and done prior to its evaluation, even
if that form is top-level.
|
|
|
|
|
|
| |
Add three tests; the first and third fail.
* tests/019/load-time.tl: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The immediate problem is that with-dyn-lib creates a defvarl,
but deffi uses load-time forms to refer to that. In compiled
code, these load-time evaluations will occur before the
defvarl exists. The conceptual problem is that with-dyn-lib
might not be a top-level form. It can be conditionally
executed, as it happens in stdlib/doc-syms.tl, which is now
broken. Let's not use load-time, but straight lexical
environments.
* stdlib/ffi.tl (with-dyn-lib): Translate to a simple let
which binds sys:ffi-lib as a lexical variable.
(sys:with-dyn-lib-check): Use lexical-var-p to test what
sys:ffi-lib is lexically bound as a variable.
(deffi, sys:deffi-cb-expander): Instead of gloval defvarl
variables, bind the needed pieces to lexical variables,
placing the generated defun into that scope.
|
|
|
|
|
|
|
|
|
| |
* ffi.c (align_sw_get, align_sw_end, align_sw_put_end,
align_sw_put): On Intel, PowerPC and also on ARM if certain
compiler options are in effect (set by the user building TXR,
not us), define these macros to do nothing. This shrinks and
speeds up all the functions which use these macros for
handling unaligned accesses.
|
|
|
|
|
|
|
|
|
| |
* stdlib/copy-file.tl (path-simplify): If the incoming path's
first component is "", it is absolute; in that case swallow
any components that go above.
* tests/018/path-equal.tl: Uncomment two previously failing
tests.
|
|
|
|
|
|
| |
* txr.1: Document the parenthesized pattern notation for
obtaining a negative number with parentheses. Also putting the
escape syntax first, because it's a short section.
|
|
|
|
|
|
|
|
|
|
| |
* pic.tl (add-neg-parens): New system function.
(expand-neg-parens): New macro.
(expand-pic): New numeric pattern with parentheses.
Also suport escaping of parentheses.
(pic): Recognize parenthesized numeric pattern here also.
* tests/018/format.tl: New tests.
|
|
|
|
| |
* tests/018/format.tl: New test cases.
|
|
|
|
|
| |
* stdlib/pic.tl (comma-positions): Must also look for ! point
if the . point is not found.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* pic.tl (expand-pic-num): If the overflowing field specifies
a decimal point other than in the rightmost position, then
stick one into the fill pattern. The motivation for this is
that it harmonizes with the digit separators. The new digit
separator insertion logic will treat the # characters like
digits, and requires the embedded decimal in order to work
properly. Allowing digit separation to work in the fill
pattern will make for better looking output in column
displays. That's the same reason why we insert digit
separators among leading zeros.
* tests/018/format.tl: Overflow test cases updated in
light of this requirement change.
* txr.1: Documented.
|
|
|
|
| |
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows for pic patterns like #,###,###.###
which incorporate digit separating commas into the output.
* stdlib/pic.tl (comma-positions, insert-commas,
expand-pic-num-commas): New system functions.
(expand-pic): Recogize comma as a character which can be
escaped using the tilde. Recognize a more complicated numeric
pattern with commas. If the matched token contains commas,
treat it using expand-pic-num-commas.
(pic): Propagate a copy of the new numeric pattern here, where
it is used for separation into tokens.
* txr.1: Documented.
|
|
|
|
|
| |
* stdlib/quips.tl: New quips about rights, Lisp smugness, macros
and Reddit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a basic read/print consistency problem. When a symbol
is printed that is anywhere in the fallback list of the
current package, we are dumping it unqualified, even if
it is hidden by a same-named symbol in the current package
itself or such a symbol occurring earlier in the fallback
list.
* lib.c (symbol_needs_prefix): When the to-be-printed symbol
is found in the fallback list, re-scan the current package
for a symbol having the same name, as well as the preceding
nodes in the fallback list. If such a symbol is found, then
the to-be printed symbol must be package-qualified.
* tests/012/syms.expected: New file.
* tests/012/syms.tl: Likewise.
* tests/012/compile.tl: Pull syms into compile job.
* txr.1: Clarify text about this. The existing text's
only reasonable interpretation supports the behavior which
this patch ensures (which is needed on grounds of read/print
consistency) but the text lacks precision.
|
|
|
|
|
|
|
| |
* stdlib/copy-file.tl (path-equal): This function is based on
rel-path and so suffers the same bugs. Retarget it to use the
new functions and approach to volumes from rel-path, so it
benefits from the fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The first bug is that we are using the spl function with
pat-sep-chars. But spl does not take a set of characters; we
need the sspl function. Other bugs are handling drive letters
or UNC paths properly on Windows.
* stdlib/copy-file.tl (path-split, path-volume): New
functions.
(rel-path): Split path properly. Diagnose for all bad
combinations of mismatching absolute/relative paths
with or without a volume or incompatible volumes.
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (copy_file_set_entries): Add path-equal to autoload symbols.
* stdlib/copy-file.tl (path-equal): New function.
* tests/018/path-equal.tl: New file.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* stdlib/copy-file.tl (path-simplify): New function.
(rel-path): Get rid of macrolet by using macro-time
expression; remove flet since canon is now path-simplify at
the top level. Fix diagnostic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes two failing test cases introduced in the
parent commit.
* arith.c (c_dbl_unum): Here, what is wrong that if the
incoming value is a CHR or NUM, we just convert it to a signed
cnum, and return that value. The problem with this is that
negative values are supposed to be out of range for
double_uintptr_t. We now check for negative and route to
the out-of-range error.
* mpi/mpi.c (s_mp_in_big_range): Here, the edge case of
handling the most negative two's complement value is
incorrectly coded. We replace the logic by a simple test for
that exact special case. If a negative bignum being tested
whether it fits into the signed double_intptr_t, then
we check whether its mantissa has the 0x80..00 bit pattern.
That is the only value greater than 0x7F..FF that is
still in range, so we return 1 for that case. We remove the
bogus subtraction (top - neg). After handling the above
special value, we just need to look whether the most
significant word of the bignum is 0x7F...FF or lower.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Paul A. Patience.
* ffi.c (make_ffi_type_enum): Do not use the cnum native type
for doing the member value calculations. Work with Lisp
numbers, and verify their range by passing them into the put
function of the underlying integer type. Duplicated code is
merged, too.
* tests/017/ffi-misc.tl: New tests. Two 64 bit ones fail
due to conversion bugs.
|
|
|
|
|
| |
* ffi.c (make_ffi_type_enum): the variables lowest, highest
and count do not serve any purpose; they are hereby removed.
|
|
|
|
|
| |
* ffi.c (make_ffi_type_enum): Add missing argument to two
uw_throwf calls. Reported by Paul A. Patience.
|
|
|
|
|
|
| |
* ffi.c (sock_opt, sock_set_opt): Fix a few integer
conversions to use convert (mapping to static_cast)
rather than coerce (reinterpret_cast).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On systems with true Unix heritage, like Solaris,
MacOS/Darwin, and undoubtedly various BSDs, getsockopt is
returning a bitmask value for some options , rather than 1.
For instance if we enable SO_REUSEADDR, and then read back the
value of the option, we get 4 and not 1. This is because the
value of the SO_REUSEADDR symbol itself is 4; it is a mask.
The kernel code is evidently just masking out the desired
option out of the option mask, and returning the mask value
without reducing it to 0 or 1.
* tests/014/socket-misc.tl: Test the result of sock-opt for
nonzero using nzerop rather than testing specifically for 1.
|
|
|
|
|
|
|
| |
* stream.c (run): replace_env takes only one argument.
* tests/018/process.tl: *child-env* tests are reporting some extra
environment variables on Windows; let's just disable them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/awk.tl (sys:awk-compile-time): Slot field-names renamed to
field-name-conv.
(sys:awk-expander): Parse the new syntax which allows (sym fn)
pairs with optional fn, creating a list of normalized items
in the field-name-conv slot of the compile-time structure.
(sys:awk-symac-let): Adjust the code to the pair representation in
field-name-conv.
(sys:awk-field-name-code): New function for generating the
field conversion code.
(awk): Now that we have two optional pieces of code to wrap around
p-actions form, we factor that out of the awk-lambda, to a series
of conditional assignments. Here we handle the generation of the
field conversionns.
* conv.tl (sys:conv-expand-sym): New macro, used in
sys:awk-field-name-code and sys:conv-let.
(sys:conv-let): Simplify with sys:conv-expand-sym. Drop optional
argument from i; it connects with no documented feature, and is
not usable from fconv.
* tests/015/awk-fields.tl: New tests.
* txr.1: Updated, including cruft in fconv documentation.
Change-Id: Ie42819f58af039fdbcdb1ae365c89dc1add55c93
|
|
|
|
| |
* txr.1: Fix typos and stylistic issues.
|
|
|
|
|
|
|
| |
* txr.1: fill-array -> fill-carray, put-array -> put-carray.
Refer to fill-buf and put-buf with .code (or .codn). Use .code
when referring to a carray object rather than an argument called
carray.
|
|
|
|
|
|
| |
* ffi.c (mmap_wrap, mmap_op): Switch to uw_ethrowf.
* sysif.c (getresgid_wrap): Same.
|
|
|
|
|
|
|
|
|
|
|
| |
* ffi.c (cptr_carray): New function.
(ffi_init): Register cptr-carray intrinsic.
* ffi.h (cptr_carray): Declared.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stdlib/awk.tl (sys:awk-compile-time): New slot, field-names.
(sys:awk-expander): Validate and store field-names into compile-time
structure.
(sys:awk-symac-let): New macro.
(awk): Wrap sys:awk-symac-let around code to generate field
name macros.
* tests/015/awk-fields.tl: New file.
* txr.1: Documented.
|
|
|
|
|
|
| |
* stdlib/optimize.tl (basic-block peephole-block): In a few more
cases, we should be setting the recalc flag to recalculate liveness,
and adding some block to the rescan list.
|
|
|
|
|
|
|
|
| |
* stdlib/optimize.tl (basic-blocks peephole-block): Rearrange the code a
bit so we don't calculate the xbl, which potentially performs the
cut-block, if there is no ybl. We set the bb.recalc flag since we may
have cut a block into two and have redirected a jump, and also
update the links for that reason.
|
|
|
|
|
|
|
| |
* stdlib/optimize.tl (basic-blocks thread-jumps-block,
basic-blocks peephole-block): Streamline various cases of [bb.hash
jlabel] being wastefully called twice to look up the same block
referenced by the same label.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The next-block method performs a linear search through the basic
block list, which is physically ordered, to find the physically
next block. This is actually not needed in several places that use the
method; they want the logically next block, which is nil if the last
instruction of the current doesn't potentially fall through to the next
block. In the one place where we need the physical next block, in the
elim-next-jump method, the caller can dynamically provide this, since it
walks the list.
* stdlib/optimize.tl (basic-block next-block): Method removed.
(basic-block link-graph): We revise the logic here a little bit. All of
the cases now consistently use the mechanism of setting link-next to
nil to indicate that they don't fall through to the next block.
The special case handling of the close instruction is clearer.
(basic-block (thread-jumps-block, peephole-block)): Several cases here
referred to the physically next block via the next-block method. This
can be replaced by just using the next pointer, which will be the same.
(basic-blocks elim-next-jump): This method now takes the next block as
an argument, since there is no next-block method it can call to get
the physcally next block. The argument is guaranteed non-null, so we
don't need the .? null-safe slot access syntax.
(basic-blocks elim-dead-code): Iterate over the next blocks
simultaneously, and pass the next block into elim-next-jump.
We no longer iterate over the last block, which has no physical next
block.
|
|
|
|
|
|
| |
* stdlib/optimize.tl (basic-blocks join-block): Merge set
forms into one.
(basic-blocks elim-dead-code): Likewise.
|