| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
* chksum.c, chksum.h, chksums/sha256.c, chksums/sha256.h: New files.
* lib.c (init): Call chksum_init.
* txr.1: Documented.
* LICENSE: Add SHA-256 copyright notice.
|
|
|
|
|
|
|
|
| |
* txr.1: Buffers are now documented after strings and vectors.
Buffer streams are in the I/O section. Note: the diff between
this and the previous commit needs to be generated with
git diff --minimal. Otherwise it looks like over 30,000 lines
of changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* filter.c (base64_encode): Handle an object of either string
or buffer type by using make_byte_input_stream.
(base64_decode_buf): New function.
(filter_init): Register base64-decode-buf intrinsic.
* filter.h (base64_decode_buf): Declared.
* stream.c (make_byte_input_stream): New function.
* stream.h (make_byte_input_stream): Declared.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Objects should almost always be printed as ~s.
If a bad object is printed as ~a, junk could result
on the terminal if it's a buffer, for instance.
* stream.c (stdio_maybe_read_error, stdio_maybe_error,
stdio_close, pipe_close, parse_mode, normalize_mode,
normalize_mode_no_bin, cat_unget_byte, cat_unget_char,
unget_byte, open_directory, open_file, open_tail,
open_command, open_process, run, remove_path, rename_path):
Revise conversion specifiers in error message formatting.
|
|
|
|
|
| |
* txr.1: Two issues fixed while proof-reading: missing "a"
article and a missing plural.
|
|
|
|
|
| |
* txr.1: In two places, fix an awkward "; that is, has ..."
and "; that is, is ..." grammatical curiosity.
|
|
|
|
| |
* txr.1: "following three expressions" should be "two".
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (usr:dump-to-tlo): This
function has no reason to be named by a usr package symbol.
Renaming to sys:dump-to-tlo.
|
|
|
|
|
| |
* sysif.c (at_exit_do_not_call): Reverse Boolean polarity of
return value to match documentation.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
* protsym.c: Likewise.
|
|
|
|
|
|
|
|
|
| |
* arith.c (ash): Introduce smaller scopes and move variable
initializations close to their use. The NUM case of argument
a no longer falls through to the BGNUM case, and doesn't
cons up a bignum object. Rather, a temporary mp_int is
allocated, used and freed. The gc_hint added in the previous
commit is now gone.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On 32 bit x86 Solaris 10, with gcc 4.9.0, this issue caused a
miscompilation of the pset macro, due to ash abruptly
returning zero, causing the op-code field of an instruction to
be NOOP rather than GCALL.
I'm committing this fix just for reference; I will immediately
replace it with a refactoring of the function.
* arith.c (ash): Add a gc_hint to prevent the a bignum from
being reclaimed if the b = make_bignum() triggers gc.
This happens in the case when the previous case computes
a = make_bignum() and falls through.
|
|
|
|
|
|
|
|
| |
* gc.c (sweep_one): If the swept object matches the break_obj,
only log it if the object isn't free. Otherwise if break_obj
is sitting on the free list, we will uselessly report on it on
every sweep operation, which is very often under --gc-debug
torture operation.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (make_package_common): The way the two hashes are
assigned into the new package here is not correct. The problem
is that the first make_hash can trigger gc. Then it is
possible that the package object will move into the mature
generation, after which the assignment of the second package
is a wrong-way assignment requiring the set macro.
Instead of bringing in that macro, the obvious way to solve it
is to just allocate the hashes first, and then the package:
exactly the way we build a cons cell from existing values.
|
|
|
|
|
|
|
| |
* struct.c (make_struct_type): The length and plus operations
can cons if the number of static slots doesn't fit into a
fixnum. Let's move that operation out of the sensitive object
construction region.
|
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (make_struct_type): The static slot lookup for for
a derived method in the supertype can potentially allocate a
cons cell when there is a cache miss, which can trigger gc. So
we can't be doing this while a the new type object object is
partially initialized, because then the garbage collector will
visit uninitialized memory. We move the derived method
lookup down farther to where that value is needed to do the
derived call, just before we return the new type.
|
|
|
|
|
|
|
|
|
| |
* buf.c (buf_strm_seek): index is a BSD function; we want
to refer to the local variable npos here. This was
fortuitiously caught by GNU C++ which is obtains multiple
overloaded declarations of index from somewhere, and so
in this variable argument list situation thinks that there
isn't enough context to resolve the overload.
|
|
|
|
|
|
|
| |
* arith.c (logcount): NUM case doesn't have a return statement
in 64 bit build, statement causing fall-through to BGNUM case
where the integer object is treated as a bignum. This bug has
existed in the function ab initio.
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (bitset_s): New symbol variable.
(bitset): New function.
(arith_init): bitset_s initialized, bitset intrinsic
registered.
* lib.h (bitset): Declared.
* txr.1: Documented bitset function and method.
|
|
|
|
|
| |
* ffi.c (carray_replace): Use generic sequence iteration for
range replacement instead of separate list/vector code.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (defset_instantiate): Add sub-list, sub-vec and
sub-str symbols as autoload triggers for defset.tl.
* share/txr/stdlib/defset.tl (sub-list, sub-vec, sub-str): New
syntactic places defined with defset.
* txr.1: sub-list, sub-vec and sub-str documented as
accessors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The motivation here is that there are behaviors in the
expander which hinder symbol-macro-based renaming techniques.
For instance (expand '(symacrolet ((x y)) (sys:setq x x)))
throws. The right hand side of the setq is fine, but the left
hand one is a forbidden symbol macro. Yet, we would just like
this to expand to (sys:setq y y). The original idea was that
sys:setq occurs as a result of macro-expansion. Therefore,
if its argument is a symbol macro, something must be wrong; it
didn't get expanded. That reasoning is wrong in the face of
explicit expansion techniques that make multiple expansion
passes. For instance (set a b) can become something like
(sys:setq #:g0005 #:g0007) when the intent that in another round
of renaming these gensyms will be defined as symbol macros
which perform one more renaming.
* eval.c (expand_lisp1_value, expand_lisp1_setq): Macro-expand
the symbol and work with the expanded one. We still keep the
check for a symbol macro; these situations can arise if a
symbol macro cannot expand due to circularity.
(do_expand): When checking sys:setq for a bad symbol or symbol
macro, work with the expanded argument.
|
|
|
|
|
|
| |
* share/txr/stdlib/ffi.tl (carray-sub, sub-buf):
Unfortunately, defset doesn't arrange for the new value to
be evaluated once; we must do it.
|
|
|
|
|
|
| |
* share/txr/stdlib/defset.tl (defset-expander):
Reduce (,*params) to ,params, which is parallel with the ,args
that it matches.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/defset.tl (defset-expander): In code that
binds user-supplied variables and contains a user-supplied
form that refers to those variables, we can't use code like
(op list (gensym)) or [mapcar car ...]. These are susceptible
to capture of the symbols list and car.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/defset.tl (defset-expander): In a scope
where we are binding the user-supplied params, we cannot be
binding variables like gpf-pairs that don't have anonymized
names. All these locals must be gensymed, otherwise they are
visible to the store form.
|
|
|
|
|
|
| |
* tests/012/defset.tl: New file.
* tests/012/defset.expected: New file.
|
|
|
|
|
| |
* buf.c (buf_shrink): It's not immediately obvious why len is
incremented by one if it is zero.
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (ffi_set_entries): Register autoload for sub-buf
symbol.
* share/txr/stdlib/ffi.tl (sub-buf): Syntactic place
defined via defset.
* txr.1: Updated sub-buf documentation.
|
|
|
|
|
|
| |
* txr.1: Documentatation for sub accessor fails to specify
that the seq variable is updated with the value returned by
replace.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/ffi.tl (carray-sub): We use defset to
define a carray-sub place that updates via carray-replace,
rather than using a place macro to defer to the
generic sub accessor. This results in a more efficient
implementation. This new accessor doesn't require the carray
argument to be a place; unlike sub, it doesn't have to capture
the return value of carray-replace and store it back into
the carray variable.
* txr.1: Updated doc.
|
|
|
|
|
|
| |
* txr.1: Add mentions of the forgotten define-accessor macro
in text that lists ways of defiing places. Cross-reference
short form of defset and define-accessor.
|
|
|
|
| |
* txr.1: Fix ftw function being mistakenly called nftw.
|
|
|
|
|
|
| |
* txr.1: Numerous library functions whose Description
paragraph begins with "This function" are now introduced by
their name.
|
|
|
|
| |
* txr.1: Clarify that list-like sequences are not lists.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: The wording is improved in the description of
sub-list, replace-list and all the other type specific
specializations of sub and replace. We avoid starting the
descriptions with "This function", and vague wording such
as "is like the sub function". Superfluous, obvious text like
"for a description of the semantics, see the sub function" is
removed. Also we avoid saying that the sub-list and
replace-list functions operate strictly on lists, since they
in fact operate on anything that supports list operations.
|
|
|
|
|
| |
* txr.1: Fix syntax section for carray-pun wrongly
showing carray-sub function name.
|
|
|
|
|
|
|
| |
* buf.c (buf_init): Intrinsics sub-buf and replace-buf
registered.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This slight inefficiency occurs in some 37 places in the code.
In most places we replace lt(x, zero) with minusp(x).
In a few places, !plusp(x) is used and surrounding logic is
simplified. In one case, the silly pattern
lt(x, zero) ? t : nil is replaced with just minusp(x).
* buf.c (sub_buf, replace_buf): Replace lt.
* combi.c (perm, rperm, comb, rcomb): Likewise.
* eval.c (do_format_field): Likewise.
* lib.c (listref, sub_list, replace_list, split_func,
split_star_func, match_str, lazy_sub-str, sub_str,
replace_str, sub_vec, replace_vec): Likewise.
* match.c (weird_merge): Likewise.
* regex.c (match_regex, match_regex_right_old,
match_regex_right, regex_prefix_match, regex_range_left,
regex_range_right): Likewise.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (usr:compile-file): Edit the
hash-bang line to replace the --lisp option with --compiled.
This supports the situation when a TXR Lisp hash bang script
that is unsuffixed is compiled to an unsuffixed compiled
script.
|
|
|
|
|
|
|
| |
* lib.c (cat_str, split_str_keep): Support single character
separator.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* lib.c (sel): Function converted to seq_info and iterators.
Negative indices handled in list case. Self-name corrected
to select; the C function is called sel just to avoid
clashing with POSIX select.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* buf.c (buf_check_index): Take struct buf p * parameter, to
be able to displace negative values using the buffer length.
(buf_put_bytes, buf_put_i8, puf_put_u8, but_put_char,
buf_put_uchar, buf_get_bytes, buf_get_i8, buf_get_u8,
buf_strm_get_byte_callback): Pass struct buf pointer to
buf_check_index. In buf_put_bytes, we use the returned value
instead of the original pos.
(buf_strm_seek): Don't use buf_check_index for validating the
position, since the negative indexing logic doesn't apply to
stream seek operations.
|
|
|
|
|
|
| |
* ffi.c (carray_refset): Support negative indexing by adding
the length of the array to a negative index value.
This is already done in carray_ref.
|
|
|
|
|
|
|
|
|
|
| |
The index-list replacement isn't following the convention that
negative index values reference from the end of the target
sequence. Let's fix that.
* lib.c (replace_list): Likewise.
* txr.1: Documentation updated.
|
|
|
|
|
|
| |
* lib.c (replace_str, replace_vec): Remove redundant
calculation of input sequence length; there is a len variable
bound on entry into the function.
|
|
|
|
|
| |
* ffi.c (carray_replace): add missing index list assignment
semantics required by documentation.
|
|
|
|
|
|
|
|
| |
* buf.c (replace_buf): New function.
* buf.h (replace_buf): Declared.
* lib.c (replace): Wire in.
|
|
|
|
|
|
| |
* Makefile (distclean): distclean target for not-configured
state removes .tlo files by wildcard, including the old .tlo2
files that we used to generate once.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (sub_vec): If range covers entire vector, just
return it.
* txr.1: Clarify that the output of sub may share structure
with the input regardless of type, not only when the input
is a list. This should have been updated when the optimizatin
was done in sub-str.
|