| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
* txr.1: Example for sys:capture-cond uses wrong style
for the reference to the suspend operator suspend, causing it
not to be hyper-linked to the definition in the HTML version.
|
|
|
|
|
|
| |
* txr.1: Paragraph about sys:cont-poison must say
"continuation's evaluation frames" not "evaluation's
continuation frames"
|
|
|
|
|
|
|
| |
* txr.1: Under sys:capture cont, try to revise some
potentially confusing text. Also adding more notes, clarifying
the semantics of shared lexical environments, and behavior of
special variable bindings with regard to continuations.
|
|
|
|
|
|
| |
* txr.1: Fix example code that is too wide, causing
a visual problem for standard 80 column man page
formatting.
|
|
|
|
|
| |
* txr.1: Fix lack of escaping of backslash in #\c causing the
c to be interpreted as a troff code.
|
|
|
|
| |
* txr.1: Add missing comma in mapcar section heading.
|
|
|
|
|
|
|
| |
* txr.1: New major (SS*) section User-Defined Streams.
Documented make-struct-delegate-stream function,
the stream-wrap class and all the stream interface object
methods.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A new kind of stream object which redirects its operations to
the methods of a structure.
* Makefile (OBJS): New object file, strudel.o.
* lib.c (init): Call new strudel_init function.
* lisplib.c (stream_wrap_set_entries,
stream_wrap_instantiate): New static functions.
(lisplib_init): Arrange for autloading of new stream-wrap.tl.
* share/txr/stdlib/stream-wrap.tl: New file.
* stream.c (put_string_s, put_char_s, put_byte_s, get_line_s,
get_char_s, get_byte_s, unget_char_s, unget_byte_s, put_buf_s,
fill_buf_s, flush_s, seek_s, truncate_s, get_prop_s,
set_prop_s, get_error_s, get_error_str_s, clear_error_s,
get_fd_s): New symbol variables.
(stream_init): New symbol variables initialized. Numerous
functions registered via these variables now rather than
intern(...) expressions.
* stream.h (put_string_s, put_char_s, put_byte_s, get_line_s,
get_char_s, get_byte_s, unget_char_s, unget_byte_s, put_buf_s,
fill_buf_s, flush_s, seek_s, truncate_s, get_prop_s,
set_prop_s, get_error_s, get_error_str_s, clear_error_s,
get_fd_s): Declared.
* strudel.c, strudel.h: New files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a method is traced with (trace (meth class slot)),
a spurious warning occurs. This is because the function
is recorded in the trace hash first and then the hook
is installed, and the hook is installed using the
static-slot-ensure function which performs the trace
warning check.
* share/txr/stdlib/trace.tl (sys:trace): Swap the order:
install the hook first, and then put the the previous function
into the trace hash. Doing this in parallel with pset would
also work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* hash.c (eql_based_k): New keyword variable.
(equal_based_p): New static function.
(hashv): Use eql_based_p to determine whether to make an
equal-based hash table. Subject to opt_compat relative
to version 187.
(hash_init): Intern :eql-based keyword and store in new
variable.
* hash.h (eql_based_k, userdata_k): Declared.
* txr.1: Documentation updated, with compat notes too.
|
|
|
|
|
|
|
|
| |
* eval.c (op_prof): Deal with the cases when alloc_bytes_t
value cannot be converted to a val in a single call to
unum.
* lib.h (SIZEOF_ALLOC_BYTES_T): New macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* args.c (struct args_bool_key): Structure moved
to header file.
(struct args_bool_ctx): One more piece of context information,
the array size.
(args_check_key_store): Work with array of args_bool_key
structs rather than linked list.
Remove useless local variable "store".
(args_key_extract_vl): Function removed.
(args_key_extract): Takes array instead of va_list.
* args.h (struct args_bool_key): Structure declared here.
Loses the next pointer since not used for a linked list.
(args_key_extract_vl): Function removed.
(args_key_extract): Redeclared.
* hash.c (hashv): Adapt to new args_key_extract function.
|
|
|
|
| |
* hash.c (hashv): Switch over to args_keys_extract.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement a mechanism for extracting keyword arguments out of
"struct args *" argument lists which avoids consing up an
argument list and scanning it multiple times for multiple
keywords.
* args.c (args_for_each): New function.
(struct args_bool_key, struct args_bool_ctx): New struct
types.
(args_key_check_store): New static function.
(args_keys_extract_vl, args_key_extract): New functions.
* args.h (args_for_each, args_keys_extract_vl,
args_key_extract): Declared.
|
|
|
|
|
|
| |
* lib.c (mapcar_listout): Rework using seq_info for
efficient processing of vector-like sequences and
objects that implement sequences.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a form is a macro, but the macro declines to expand the
form, the form must still be code walked; we can't just return
it and be done. For instance if it is a function call, its
argument expressions have to be expanded.
This also causes undefined function warning to be generated
properly if a macro declines, and the resulting form is
a function call to a not-yet-defined function.
* eval.c (do_expand): If expand_macro yields the original
form, branch backwards to re-execute the whole if statement
again. Use the fact that the local variable macro is now
non-nil to skip the macro expansion case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements a new requirement which clarifies what
happens when a macro declines to expand a form.
To decline expanding a form means to return the original form
(same object) without returning it. The expander detects this
situation with an eq comparison on the input and output.
The current behavior is that no further attempts are made to
expand the form. This is problematic for various reasons. In
code which is expanded more than once, this can lead to the
expansion being different between the expansion passes. In
the first pass, a local macro M might decline to expand a
form. In the second pass, the local macro definition no longer
exists, and the form does get expanded by a global macro M.
This kind of instability introduces a flaw into complex macros
which expand their argument material more than once.
The new requirement is that if a macro definition declines to
expand a macro, then a search takes place through the outer
lexical scopes, and global scope, for the innermost macro
definition which will expand the form. The search tries every
macro in turn, stopping if a macro is found which doesn't
decline the expansion, or after passing the global scope.
* eval.c (expand_macro): Implement new searching behavior.
* txr.1: Documented the expansion declining mechanism
under defmacro and macrolet.
* tests/011/macros-3.tl: New file.
* tests/011/macros-3.expected: New file.
|
|
|
|
|
|
|
|
|
| |
* lib.c (unsup_obj): New static function.
(grade, find, rfind, find_max, find_if, rfind_if, pos, rpos,
pos_if, rpos_if, pos_max): Replace call to uw_throwf with call
to unsup_obj. IN all these functions except grade, the ~s
conversion specifier was wrongly used on the function name
rather than ~a, resulting in unwanted quoting.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Inspired by APL.
* eval.c (eval_init): Register grade intrinsic.
* lib.c (grade): New function.
* lib.h (grade): Declared.
* txr.1: Documented.
|
|
|
|
|
| |
* lib.c (lastcons): Don't wastefully call cdr on an object
after called cdr_l; just dereference the cdr_l loc.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (tail): This low-level function is used by the
list accumulation routines. Because it doesn't handle
improper lists, looking for a null terminator, certain
things don't work, like the associativity of append.
For instance (append '(1 2) #(3) 4) works but not
(append (append '(1 2) #(3)) 4). Fixing tail so that it
terminates on any atom, rather than failing trying to
cdr through it.
|
|
|
|
|
|
|
| |
* txr.1: Documentation for append and nconc is rewritten.
Treatment of non-list sequences is explained in detail.
Description of append* is split off into its own section,
because its handling of non-lists is too different.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two bugs in these functions, both attributable to
the lazy_appendv implementation:
They destructively catenate the input lists,
much like nconc, even though documented as
non-destructive.
If any input list is infinite, other than the
last input list, that list is forced, resulting
in an infinite loop.
* lib.c (lazy_appendv_func): Rewritten to use a
different algorithm which earnestly allocates a
new lazy cons for each element of the output
sequence, except for the tail part corresponding
to the last list.
(lazy_appendv): Set up the lazy cons according
to the new representation and just return it.
No searching for the tail of the nonempty list,
and no destructive manipulation.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim: Regenerated.
|
|
|
|
|
|
| |
* txr.1: mention that the rightmost maximum can be found by
manipulating the comparison function. (Hence, this is why
we don't provide rpos-max and rfind-max).
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (find, rfind, find_max, find_if, rfind_if, pos, rpos,
pos_if, rpos_if, pos_max): Consistently fixnum indices for
iterating over vector. In some functions, a cnum is already
used, but could be out of fixnum range; we switch to using
c_fixnum for extracting the length and then num_fast on the
index. Some functions are converted from using a val index.
In the case of rfind_if, a bug is fixed: it was using plusp,
which now becomes the correct >= 0.
|
|
|
|
| |
* lib.c (pos_max): Rewrite using seq_info.
|
|
|
|
|
|
| |
* lib.c (find_max): Fix a regression introduced
in recent work: only execute the loop when the vector isn't
empty.
|
|
|
|
| |
* lib.c (pos_if, rpos_if): Rewrite using seq_info.
|
|
|
|
|
|
|
| |
* lib.c (posq, posql, posqual, rposq, rposql, rposqual): These
functions are reduced to wrappers around pos and rpos,
respectively, so they generalize properly and efficiently
to sequences of all kinds.
|
|
|
|
|
|
|
| |
* lib.c (pos, rpos): Functions rewritten to use the seq_info
sequence classification mechanism. The rpos function is
thereby optimized to work with vectors. Both functions support
vector-like struct objects now.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (rfind_if): Function rewritten to use the seq_info
sequence classification mechanism, for much better
performance on vector-like objects. Also, supports hash
tables just like find_if.
* txr.1: Documentation updated regarding hash support
of rfind-if.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (find_if): Function rewritten to use the seq_info
sequence classification mechanism, for much better
performance on vector-like objects. Also, supports hash
tables just like find_max.
* txr.1: Documentation updated regarding hash support
of find-if.
|
|
|
|
|
|
| |
* lib.c (find_max): The vector case must loop from
index one, not zero, so as not to wastefully compare the
initial max element to itself.
|
|
|
|
|
| |
* txr.1: Behavior of subtypep is not specified if either
argument isn't a type.
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-mac-let): A few occurrences
of the deprecated set-diff function are replaced with diff.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, using "rb" in open-command reports an error on
GNU/Linux, due to popen not liking the "b" mode.
On Cygwin, the "b" flag is useful with popen.
* stream.c (normalize_mode_no_bin): New function.
(open_command): Use normalize_mode_no_bin instead of
normalize_mode to strip out the binary flag.
This doesn't happen on Cygwin, though.
* stream.h (normalize_mode_no_bin): Declared.
* share/txr/stdlib/getput.tl (command-get-buf): Since
we are getting binary data, pass the "rb" mode to
open-command, now that it works.
(command-put-buf): Add "b" flag to mode passed
to open-command.
|
|
|
|
|
| |
* txr.1: fix awkward wording which applies the definite
article "the" to a Lisp expression.
|
|
|
|
| |
* txr.1: Streams support put-byte, not buffers.
|
|
|
|
| |
* genvim.txr (iskeyword): add % character.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk%--rng, sys:awk%--rng-,
sys:awk%rng+, sys:awk%-rng+, sys:awk%--rng+): New functions.
(sys:awk-mac-let): Rewritten range expander. The four basic
ranges rng, rng-, -rng and -rng- are handled with in-line
expansion, because by doing that we avoid unnecessarily
evaluating the from-expression. The remaining cases expand
to function calls to the new functions, which receive the
flag vector, the index position in that vector and the values
of the from and to expressions. The behavior change is that
that the -- forms now do the right thing: they hide all
leading records that satisfy the from-expression, right to the
last record of the range if necessary.
* tests/015/awk-rng.expected: Updated.
* txr.1: Revise semantic description the -- range types, plus
minor fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (getput_set_entries): New autoload entries for
file-get-buf, file-put-buf, file-append-buf, command-get-buf
and command-put-buf.
* share/txr/stdlib/getput.tl (sys:get-buf-common): New
function.
(file-get-buf, file-put-buf, file-append-buf, command-get-buf,
command-put-buf): New functions.
* txr.1: Documented.
|
|
|
|
|
|
| |
* tests/015/awk-rng.tl: More rows of data.
* tests/015/awk-rng.expected: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is that when records appear in the middle
of the range which again match from-expr, they
get suppressed.
* share/txr/stdlib/awk.tl (sys:awk-mac-let): Get rid of the
flag-mid variable. It cannot work because middle is a state
in its own right that cannot be inferred from the existing
states (nil, t, :end) and the value of from-expr. We get rid
of the flag and introduce a :mid state value.
|
|
|
|
|
|
|
| |
* ffi.c (carray_blank, carray_buf, carray_cptr, carray_pun):
these functions should be using ffi_type_struct_checked,
since they are public interfaces to which anything can be
passed. Otherwise TXR can easily be crashed by misusing them.
|
|
|
|
|
|
| |
* ffi.c (carray_ref): If the index is negative,
displace it by the length of the array. (Then if
it is still negative, the function will throw.)
|
|
|
|
| |
* txr.1: rr searches for "a match" not "a matches".
|
|
|
|
|
|
| |
* txr.1: Fix bungled formatting of third argument
alternatives in the syntax synopsis of the
partition function.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/op.tl (sys:op-expand): Throw error if
argument list is empty. We refer to the compile-error
function by quote to avoid triggering the auto-load of
the module which defines it, due to the circular dependency
on op.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code is using a non-hygienic variable called flag
as a placelet alias. This binding is visible to range
expressions. For instance (rng #/x/ flag) actually
references the range expression's internal flag, rather
than producing a warning about an unbound variable.
* share/txr/stdlib/awk.tl (sys:awk-mac-let): Allocate a gensym
for the flag. Then use ,flag throughout the code templates
rather than flag to insert the gensym wherever the symbol
flag previously appeared.
|