| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* match.c (h_var): When processing variable bound over a regex
or text match, if that datum came from a modifier which was
a variable, we must process the substituted modifier, not the
original variable symbol. This is a regression that was
introduced on November 16, 2011, in commit
b86a599bbfcd591f64f31ddfc9ab1a659d39a7c0: "Variable matches can
span over function calls.". Reported by user vapnik spaknik.
|
|
|
|
|
|
|
|
|
| |
* parser.y (elem, define_clause): The match_reg_params
function is supposed to walk the pattern function parameters,
not the argument of the define directive (of which the second
one is those arguments). This bug causes spurious unbound
variable warnings when function bodies refer to their second
or subsequent arguments. Issue reported by user vapnik spaknik.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
| |
* lib.c (empty): Handle BUF in switch.
|
|
|
|
|
|
|
|
| |
* chksums/sha256.c (SHA256_update): Change in parameter to
const unsigned char *, avoiding the need for a local
variable in that type.
* chksums/sha256.h (SHA256_update): Declaration updated.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/except.tl (catch**): Obtain macro
environment and pass to constantp.
* share/txr/stdlib/place.tl (last, butlast): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the keyword parameter list contains a mixture of constant
and non-constant default value expressions, the order of the
extracted keys is scrambled, so values go to the wrong
variables.
* share/txr/stdlib/keyparams.tl (sys:build-key-list): Renamed
to build-key-list-expr and rewritten to preserve the key
order.
(:key): Follow rename of build-key-list.
|
|
|
|
|
|
| |
* share/txr/stdlib/keyparams.tl (sys:build-key-list): Take
macro environment parameter, and pass to constantp.
(:key): Pass macro environment to sys:build-key-list.
|
|
|
|
|
|
| |
* share/txr/stdlib/defset.tl (defset-expander): Move
with-gensyms to outermost scope so we can include nvsym in it,
avoiding the explicit (nvnsm (gensym)) binding.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Users of defset no longer have to ensure that in the store
form, the symbol which gives the new value to be stored is
inserted only once.
* share/txr/stdlib/defset.tl (defset-expander): Transform the
store form by inserting a temporary variable using alet.
(sub-list, sub-vec, sub-str): These place forms no longer
require a local gensym.
* txr.1: Updated doc.
* tests/012/defset.tl: The expected output for the inc case
now incorporates a gensym that comes from the compiled
defset macro. Since we can't control that by means of the
gensym counter, we resort to extracting it from the expansion
itself, then check the test case against a template which
incorporates that gensym. We check that the extracted item
really is a gensym: it's a symbol with no home package whose
name starts with "g".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A change in the nullify function to support hash tables has
broken various functions which classify an object using
seq_info, obtainig a SEQ_HASHLIKE kind, and then work with
si.obj using hash functions. But si.obj has been nullified.
An example of a broken function is find-max.
Basically, this can be attributed to a careless use of nullify
in seq_info. The purpose of nullify is to support code which
treats any sequence as if it were a list. But seq_info doesn't
do that; it classifies sequences and treats them according to
their kind. Under seq_info, the only non-list objects that get
treated as lists are list-like structures. For these it makes
sense to call nullify, in case they have a nullify method.
* lib.c (seq_info): Don't unconditionally call nullify on all
COBJ objects. Only call nullify on struct objects. If that
returns nil, then treat the object as SEQ_NIL; and if it
returns an object different from the original, then recurse.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (seq_begin): Do not null out si->inf.obj; it's needed
for accessing hashes and vector-like objects. This bug means
that seq-begin iteration has only worked correctly for lists.
The original motivation was not to have spurious retention of
the head of a lazy list, which is hereby reintroduced. But
iterators can be rewound. Let's just document this away and
leave it as a to-do item.
* txr.1: Document the limitation of seq-begin w.r.t.
lazy lists.
|
|
|
|
|
| |
* txr.1: The pos argument of put-buff and fill-buf is a
position within the buffer (not the stream).
|
|
|
|
|
| |
* txr.1: Update the list of syntactic places to list all the
new places that have been added, plus a few additional edits.
|
|
|
|
|
|
|
| |
* lib.c (in): A simple check and fallthrough lets this
function process hash tables more generally in this function.
* txr.1: Documented.
|
|
|
|
|
| |
* lib.c (in): Keep the existing specialized cases, but use
seq_info in the fallback.
|
|
|
|
|
| |
* lib.c (take, take_while, take_until, drop_while,
drop_until): Move repeated function name into self variable.
|
|
|
|
|
|
| |
* lib.c (drop_while, drop_until): Use seq_info, so these
functions work with all sequences. Thus now for instance
[drop-while zerop #b'0000f00d'] yields #b'f00d'.
|
|
|
|
| |
* lib.c (empty): Add carray sub case to COBJ case.
|
|
|
|
|
| |
* lib.c (nullify): Add carray and hash subcases into
the COBJ case.
|
|
|
|
|
|
| |
* txr.1: Clarify that nullify also just returns its argument
if it is not a sequence at all. Clarify that nullify works
on objects via the nullify method only.
|
|
|
|
|
|
| |
* lib.c (nullify, list_collect, list_collect_nconc,
list_collect_append, list_collect_nreconc,
list_collect_revappend): Handle buffer type.
|
|
|
|
|
|
|
|
|
| |
* lib.c (list_collect): Handle sequence-like COBJ objects.
We can add an item to using their respective replace
functions.
(replace_obj): Change to external linkage.
* lib.h (replace_obj): Declared.
|
|
|
|
|
|
|
| |
* lib.c (list_collect, list_collect_append,
list_collect_revappend): Use local
variables to avoid repeated expressions.
(list_collect_nconc): Only call nullify in necessary cases.
|
|
|
|
|
|
|
| |
* lib.c (seqp): Use seq_info to classify the object
as a sequence.
* txr.1: Update description of seqp.
|
|
|
|
|
|
|
|
|
| |
* lib.c (replace): If a COBJ is passed to replace which
doesn't support the operation, we wrongly pass it to
replace_buf because the BUF case was added into the
fallthrough pass. The end result is that length_buf blows up
on the object, resulting in a strange diagnostic.
The BUF case must be moved above COBJ.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (OBJS): Add chksums/crc32.o.
* chksum.c (crc32_stream, crc32): New functions.
(chksum_init): Register crc32-stream and crc32 intrinsic
functions.
* chksums/crc32.c, chksums/crc32.h: New files.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (sys:new-expander): The
syntax (lnew (type boa args ...)) is not being handled
at all due a typo in the case. Moreover, the
syntax (lnew type slot0 val0 slot1 val1 ...) is broken
due to a missing unquote on the type gensym in the
output template.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|