| 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Inspired by APL.
* eval.c (eval_init): Register grade intrinsic.
* lib.c (grade): New function.
* lib.h (grade): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* 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 (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.
|
|
|
|
|
| |
* txr.1: Behavior of subtypep is not specified if either
argument isn't a type.
|
|
|
|
|
| |
* txr.1: fix awkward wording which applies the definite
article "the" to a Lisp expression.
|
|
|
|
| |
* txr.1: Streams support put-byte, not buffers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* 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/awk.tl (sys;awk-mac-let): Provide the
implementation for the local macros --rng, --rng-,
rng+, -rng+ and --rng+.
* tests/015/awk-rng.tl: New file.
* tests/015/awk-rng.expected: New file.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (op_set_entries): Add lop to auto-load list.
* share/txr/stdlib/op.tl (sys:op-expand): Recognize lop
and implement its transformation.
(lop) New macro.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bunch of issues here: broken pre-171 compatibility,
non-termination on lazy infinite lists of indices,
doc issues.
* lib.c (partition_func, split_func, split_star_func): Do the
check for negative index values here, with the compat handling
for 170 or older.
(partition_split_common): Remove code that tries to adjust
negative indices, and delete zeros or indices that are still
negative after adjustment. The code consumes the entire list
of prefixes, so chokes on lazy lists. Also in the compat case,
there is complete breakage: the loop doesn't execute, and so
out is just nil, and it is taken as the index list.
(partition_star_func): Similar change like in partition_func.
(partition_star): Similarly to partition_split_common, take
out the bogus loop. Also take out loop that tries to remove
leading negatives: we cannot do that because we haven't
normalized them.
* txr.1: Revised doc. Condensed by describing index-list
argument in detail under partition. For the other functions,
we refer to that one. Conditions for safely handling infinite
list of indices spelled out.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
| |
* txr.1: fix flaw in comment next to ^(qquote (unquote ,x)).
Clarify accompanying text.
|
|
|
|
| |
* txr.1: instead of (op r^ ...) we can use (fr^ ...).
|
|
|
|
| |
* txr.1: singularize inappropriate plural.
|
|
|
|
|
|
| |
* txr.1: Change title and heading to just "programming
language". Opening paragraph explains TXR as being a
programming language supporting multiple paradigms.
|
|
|
|
| |
* txr.1: Introductory paragraphs mention FFI.
|
|
|
|
|
|
| |
* txr.1: The dual precedence of % leads to surprises;
when parentheses are used around % expressions, they don't
behave symmetrically on both sides.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This new function allows a program to determine whether a
given string is the prefix of any of the strings denoted by a
regular expression; or, in alternative words, whether a given
string is the prefix of a possibly longer string which matches
a regular expression.
* regex.c (regex_machine_infer_init_state): New static
function.
(regex_prefix_match): New function.
(regex_init): regex-prefix-match intrinsic registered.
regex.h (regex_prefix_match): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is that a.b .. c.d parses as (qref a b..c d),
which is useless and counterintuitive.
Let's fix it, but with a backward compatibility switch to give
more leeway to any hapless people out there whose code happens
to depend on this unfortunate situation.
We basically use two token numbers for the .. token:
OLD_DOTDOT, and DOTDOT. Both are wired into the grammar. In
backward compatibility mode, the lexer pumps out OLD_DOTDOT.
Otherwise DOTDOT.
* parser.l (grammar): When .. is scanned, return OLD_DOTDOT
when in compatibility with 185 or earlier. Otherwise DOTDOT.
* parser.y (OLD_DOTDOT): New terminal symbol; introduced at
the same high precedence previously occupied by DOTDOT.
(DOTDOT): Changes precedence to lower than '.' and UREFDOT.
(n_expr): Two productions added involving OLD_DOTDOT.
These are copy and paste of the existing productions involving
DOTDOT; the only difference is that OLD_DOTDOT replaces
DOTDOT.
(yybadtoken): Handle OLD_DOTDOT.
* txr.1: Compat notes added.
|
|
|
|
|
|
|
|
|
| |
* arith.c (poly, rpoly): New functions.
(arith_init): Registered intrinsics poly and rpoly.
* arith.h (poly, rpoly): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (do_macroexpand_1, do_macroexpand): New static
functions; take symbol macro lookup function poiner as
argument.
(macroexpand_1): Reimplemented as wrapper around
do_macroexpand_1.
(macroexpand): Reimplemented as wrapper around
do_macroexpand.
(macroexpand_1_lisp1, macroexpand_lisp1): New static
functions.
(eval_init): Registered intrinsics macroexpand-1-lisp1
and macroexpand-lisp1.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (inv_cum_norm): New function.
* arith.h (inv_cum_norm): Declared.
* eval.c (eval_init): Register inv-cum-norm intrinsic.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
| |
* txr.1: Fix syntax synopsis for unique identifying
the function as uniq.
|
|
|
|
| |
* txr.1: Fix run-on period included in .meta formatting.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new implementation treats the @1, @2 ... @rest
op arguments as local macros, leveraging the power of the
macro expander to perform the substitution which renames these
to gensyms.
As a result, the implementation is correct.
The old implementation blindly walks the tree
structure doing the substitution, so that @1 is substituted
even though it is in a quoted literal:
[(op list '(@1)) 42] -> ((#:arg-01-0166))
under the new implementation, '(@1) is left alone:
[(op list '(@1)) 42] -> ((@1) 42)
* eval.c (expand_quasi): Because the new op macro doesn't
rudely reach into quasi forms to substitute sys:var
elements, relying on macro expansion, we must now macro-expand
sys:var elements. The sys:var macro created by op is
smart enough to skip the compound ones that have modifiers;
they are handled via the inner expansion of the symbol.
That is to say, `@@1` contains the structure
(sys:var (sys:var 1)). The sys:var macro ignores the outer
sys:var. But existing behavior in expand_quasi expands the
inner (sys:var 1), so the substitution takes place.
(eval_init): Do not register the hacky old op and do macros,
except in compatibility mode with 184 or older.
* lisplib.c (op_set_entries, op_instantiate): New functions.
(dlt_register): Register auto-loads for op and do macros via
new functions, except when in compatibility mode with 184
or older, in which case we want the old build-in hacky op
to be used.
* share/txr/stdlib/op.tl: New file.
* txr.1: Fixed or removed no-longer-true text which hints at
special hacks implemented in the op expander. Added
compatibility notes for all new compat-switched op behaviors.
|
|
|
|
|
|
| |
* txr.1: the quasiliteral `rest: @rest` and `rest: @@rest`
in fact produce the same result. Remove text which claims
that the second one is erroneous.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The dot-to-apply transformation is now applied when
meta-expressions like @foo and @(bar) apparently occur in the
dot position.
This change is made in anticipation of a rewrite of the op
macro, in which the @1, @2, and @rest arguments will be
implemented as macrolets, rather than the ad-hoc, hacky code
walk currently performed in the transform_op function.
* eval.c (dot_meta_list_p): New static function.
(dot_to_apply): Detect the presence of a sys:var or
sys:expr argument in a form. If found, then turn
it and the remaining forms into a single compound
form which replaces them.
* txr.1: Update doc under Dot Position in Function Calls.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim, protsym.c: Regenerated.
|
|
|
|
|
|
|
|
|
| |
* filter.c (base64_stream_enc, base64_stream_dec):
Count bytes encoded or decoded (using a fast integral
counter which efficiently overflows to a Lisp value that may
be a bignum).
* txr.1: Doc updated.
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (truncate_stream): If the len argument is missing,
default to the current position, obtained by using the seek
operation.
(stream_init): Fix up registration of truncate-stream for one
optional argument.
* txr.1: Documentation of truncate-stream updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* filter.c (base64_stream_enc): Change return value
behavior. Return in unlimited mode, or number of bytes
encoded.
(get_base64_char): Stop reading when an invalid character is
encountered, push it back and and return 0.
(b64_code): Don't throw for invalid characters. This case
now only occurs if 0 is passed in.
(base64_stream_dec): Drop nchars argument. Read until
get_base64_char returns 0 due to EOF or an invalid character.
(base64_decode): Don't pass third arg to base64_stream_dec.
(filter_init): base64-stream-enc and base64-stream-dec
intrinsics registered.
* filter.h (base64_stream_dec): Declaration updated.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't want to be aborting on OOM, but throwing an
exception.
* lib.c (alloc_error_s): New symbol variable.
(oom_realloc): Global variable removed.
(oom): New static function.
(chk_malloc, chk_malloc_gc_more, chk_calloc, chk_realloc):
Call oom instead of removed oom_realloc handler.
(env): Throw alloc-error rather than error by calling oom.
(obj_init): Initialize alloc_error_s.
(init): Drop function pointer argument; do not
initialize removed oom_realloc.
* lib.h (alloc_error_s): Declared.
(oom_realloc): Declaration removed.
(init): Declaration updated.
* txr.1: Type tree diagram includes alloc-error.
|
|
|
|
|
|
|
|
|
| |
* arith.c (logand, logior, logxor): Allow one operand to be a
character, if the opposite opernad is a fixnum integer.
The result is a character.
(bit): Allow the value being tested to be a character.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
| |
* ffi.c (put_obj, get_obj, fill_obj): New functions.
(ffi_init): put-obj, get-obj, fill-obj intrinsics registered.
* ffi.h (put_obj, get_obj, fill_obj): Declared.
* txr.1: Documented.
|