| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Just the ANSI CL nth for lists.
* eval.c (eval_init): Register nth intrinsic.
* lib.c (nth): New function.
* lib.h (nth): Declared.
* share/txr/stdlib/place.tl (nth): New place macro,
trivially takes care of making nth an accessor.
Place macros are terrific!
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* stream.c (path_cat): New function.
(stream_init): Registered path_cat.
* stream.h (path_cat): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (remove_path): The second argument now defaults to
false rather than true, and controls only whether an exception
is thrown in the non-existence case. Thus, the function throws
errors by default, as before, but doesn't throw by default if
the failure reason is that the path doesn't exist. Previously
it threw by default in all situations, and the flag turned all
errors into a nil return.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register new intrinsic relate.
* lib.c (do_relate, do_relate_dfl): New static functions.
(relate): New function.
* lib.h (relate): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getopts.tl (opt-desc): New entry in
valid-types, :text symbol.
(sys:opt-parsed convert-type): Handle :text case.
This is a no-op since :text applied no treatment.
(opthelp): Provide help text for :text type.
* txr.1: Documented :text getopts option type.
|
|
|
|
|
|
| |
This was broken on 2016-11-03 by the commit "Support
simple list arguments in getopts." The sys:opt-parsed
type has no type slot.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ffi.c (ffi_put_into, ffi_in, ffi_get, ffi_out): New offset
parameter.
(ffi_init): Re-register ffi-put-into, ffi-in, ffi-get and
ffi-out with new optional parameter.
* ffi.c (ffi_put_into, ffi_in, ffi_get, ffi_out): Declarations
updated.
* txr.1: Documented new argument on ffi-put-into, ffi-in
and ffi-get. The documentation for ffi-out doesn't exist!
|
|
|
|
|
|
|
|
| |
* regex.c (print_rec): Switching from negative tests to
positive: print parens around elements of a compound which
have a lower precedence. The previously incorrectly omitted
set and cset remain unmentioned, so under this inversion of
logic, they print without parentheses.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For a floating-point argument, the following behavior
is supported by the ~a, ~s and ~f format directives:
if the precision has a leading zero, then leading zeros
are added, up to one less than the field width.
* stream.c (formatv): Set the precision to one less than
the field width when rendering floats, rather than to
zero. The output_num code takes the precision as the cue
for padding zeros.
* txr.1: Updated format documentation, and clarified
a few things also.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The accessors symbol-value, symbol-function and symbol-macro
can now be used to store a value to nonexistent bindings,
which brings those bindings into existence.
* share/txr/stdlib/place.tl (sys:ge-fun-getter-setter,
sys:get-vb): Don't throw exceptions for nonexistent binding
lookups: create and return the bindings instead. For methods,
use static-slot-ensure rather than static-slot-set. Thus
new methods can be defined by setting to a (meth ...) place.
* txr.1: Doc updated.
|
|
|
|
|
|
|
|
| |
* match.c (match_reg_var): The uw_tentative_def_exists
check is being made against a symbol rather than the
tag. This check will always fail. There is no ill consequence.
Just that uw_register_tentative_def will be called
redundantly when it doesn't have to be.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/trace.tl (sys:tr*, sys:trfm): New
variables, holding the * and format functions.
(sys:trace-enter, sys:trace-leave): Use format and *
through the aliases, so we don't trigger infinite
recursion if these are traced.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ffi.c (struct carray): New member, offs.
(make_carray): Initiialize offs member from new argument.
(copy_carray, carray_blank, carry_ptr, carray_sub,
carray_pun, carray_unum, carray_num): Pass zero offset to
(carray_buf): New optional parameter off_in.
(carray_buf_sync): Handle offset.
(ffi_init): Update registration of carray-buf.
* ffi.h (make_carray, carray_buf): Declaration updated.
* txr.1: Documented.
|
|
|
|
|
|
| |
* ffi.c (carray_cptr): Ref argument in make_carray
call should be specified as nil not 0. The meaning is
the same, but it's wrong style for TXR internals.
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (sys:placelet-1): Remove the
genyms called steal-getter which is not referenced.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Repro test cases for this:
A: (progn (defun f ()) [f]).
This emits a warning against the [f] usage, even though there
is a tentative definition of f as a function.
B: (progn (defun g () [f]) (defun f ())).
Emits a warning against [f] usage which is not purged by the
evaluation of the later definition.
Both problems are related to the separation of deferred
warnings into the tag namespaces: symbols and functions. When
[f] is being expanded, the deferred warning is put into the
variable namespace. So it doesn't match a tentative def in the
function namespace which would otherwise suppress it.
A subsequent function definition only purges the warning for
the function space.
We introduce a third space, the "symbol space". Lisp-1
deferred warnings are introduced against this namespace and
both variable and function definitions purge deferred warnings
from that namespace also, in addition to their respective
proper namespace. This solves problem B. Problem A is solved
by checking, when [f] is expanded, for tentative definitions
of f in both the variable and function tag space.
Note that test case B still warns when entered into the
listener, because the listener dumps deferred warnings
prior to evaluation, thus prior to evaluating (defun f ()).
* eval.c (op_defvarl, op_defun): Purge deferred warnings from
the sym tag namespace also.
(expand_lisp1): Do not emit the deferred warning for a
nonexistent name if it has a tentative definition either as a
function or variable. When emitting the deferred warning, use
the sym namespace.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is for those situations when multiple lists are being
collected, and must all be bound even if empty. Yet, the
lists are independent rather than parallel, so the discipline
of :vars is too rigid.
* match.c (lists_k): New keyword symbol variable.
(h_coll, v_collect): Extract :lists argument as local variable
lists, validate that :lists is not used on @(repeat)/@(rep)
and implement logic.
(match_expand_keyword_args): Treat expansion of :lists
the same way as :vars.
(syms_init): Initialize lists_k.
* match.c (lists_k): Declared.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: Fix text under gather and collect directive wrongly
referring to :vars keyword as just vars in the plain font.
|
|
|
|
|
|
|
|
| |
* txr-embedded-arg.txr: Streamline the logic by using buffers
and the FFI type (zarray 128 char) which converts between a
null terminated buffer of 128 UTF-8 characters and a string.
We get not only null termination, as before, but clean padding
ith zeros up to the size of the 128 byte area.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim, protsym.c: Regenerated.
|
|
|
|
|
|
| |
* txr.1: the sections following the Overview were
wrongly subordinated to Overview. They are now on the
same level.
|
|
|
|
|
|
|
|
|
| |
* ffi.c (zero_fill): New function.
(ffi_init): zero-fill intrinsic registered.
* ffi.h (zero_fill): Declared.
* txr.1: Documented.
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (sys:get:fun-getter-setter):
Remove superfluous @1 from op macro syntax, on the
basis that (op function @1) is equivalent to (op function).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this change, a struct type's initfun and postinitfun
become mutable. This is achieved by modeling them as
the pseudo-static-slots :initfun and :postinitfun.
Effectively these now behave as reserved names which do not
denote static slots but these special functions.
* eval.c (lookup_fun): When (meth type slot) syntax is
encountered, treat the slot names :init and :postinit
specially: retrieve these special functions instead of
accessing static slots.
* share/txr/stdlib/place.tl (sys:get-fun-getter-setter):
Similarly, when handling (meth type slot) syntax, return
the alternative getter/setter functions for the special
functions, not the static slot accessing functions.
Also, getting rid of a useless @1 here in existing code,
since (op foo @1) is equivalent to (op foo).
* share/txr/stdlib/struct.tl (sys:defmeth): Check for
the special names :init and :postinit, handling these
through the appropriate setter functions rather than
static-slot-ensure.
* struct.c (init_k, postinit_k): New keyword symbol variables.
(struct_init): Initialize init_k and postinit_k. Register
intrinsics struct-get-initfun, struct-set-initfun,
struct-get-postinitfun and struct-set-postinitfun.
* (struct_get_initfun, struct_set_initfun,
struct_get_postinitfun, struct_set_postinitfun): New
functions.
(method_name): For each struct type visited, check
whether the function is the initfun or postinitfun
and return the appropriate meth syntax if so.
* struct.h (init_k, postinit_k, struct_get_initfun,
struct_set_initfun, struct_get_postinitfun,
struct_set_postinitfun): Declared.
* txr.1: Documented. Updated description of method-name,
defmeth, and documented new functions.
|
|
|
|
| |
* txr.1: The word was "change" is missing in the sentence.
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: Fix a flaw in the compat note 156 wording. The
workaround described only applies to TXR that has not been
upgraded to 157 or newer; it is not an alternative to using
the compat option, but a way to fix code under old TXR.
Also adding here the recommendation that applications should
switch to the new evaluating case functions rather than
relying on the compat switch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the issue that when a multi-line result is pasted
into the edit buffer with Ctrl-X P, the line breaks appear in
it as linefeeds, displayed as ^J. In linenoise, we need line
breaks to be carriage returns.
* linenoise/linenoise.c (lino_set_result): replace newlines
with carriage returns in the given string.
* linenoise/linenoise.h (lino_set_result): Add comment that
function takes ownership of memory assumed to be malloced,
and that it modifies it.
|
|
|
|
|
|
|
|
| |
* txr.1: Replace description of make-struct-type's postinitfun
argument which was still claiming that the calls are in
opposite order relative to initfun calls. That changed after
TXR 148 but was documented only for defstruct.
Also updating the compat note for 148.
|
|
|
|
|
| |
* txr.1: Remove spurious parenthesis in syntax synopsis of
make-struct-type.
|
|
|
|
|
| |
* txr.1: grammar fix: S-V number agreement. Add missing
number 2.
|
|
|
|
|
| |
* txr.1: Fix "FFI types short ... long, ulong,"
to "FFI types short ... long and ulong".
|
|
|
|
|
| |
* txr.1: In some parametrized type descriptions, a parameter
is typeset using .code or .codn rather than .meta or metn.
|
|
|
|
|
|
|
| |
* genman.txr (closedtxt, opentxt): Add leading space.
In TOC filtering code, insert the toggle elements
just before the closing </dt> rather than before
opening <a>.
|
|
|
|
|
|
| |
* txr.1: the additional types are given proper headings
so the identifiers are cross referenced and appear in
the TOC.
|
|
|
|
|
|
| |
* txr.1: This change to the buffers heading causes the buf
identifier to be cross-referenced, which is useful to people
browsing the FFI section. Fixing some wording too.
|
|
|
|
|
| |
* txr.1: The FFI cptr type is described in two separate
sections. These are merged and duplication removed.
|
|
|
|
|
| |
* txr.1: The functions and macros in FFI are divided into
logical groups with own section headings.
|
|
|
|
|
|
|
|
| |
PDF page count hits 600!
* txr.1: FFI becomes a major SH section. The FFI types
become separate numbered paragraphs with headings.
Parametrized types look function-like with Syntax headings.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that lambda expressions are supported as function names in
the first position of a compound expression and as an argument
to the fun operator, it will greatly behoove us if we expand
them properly. Then tests/012/quine.tl will pass.
* eval.c (do_expand): Handle fun specially. If the argument
is a lambda expression, then expand that and generate an
expanded fun form, otherwise just yield form. When expanding
function calls, check whether the first argument is a lambda
and expand it.
|
|
|
|
|
|
|
|
| |
The tests fail as of this commit.
* tests/012/quine.expected: New file.
* tests/012/quine.tl: New file.
|
|
|
|
|
|
| |
* txr.1: Clarify an otherwise misleading text. It's true that
the fun operator doesn't resolve macros via straight symbol
names, but it does do so via (macro <name>) syntax.
|
|
|
|
|
| |
* txr.1: Under Compound Forms, specify what is a function
name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (lookup_fun): With this two-liner change, the
forms ((lambda (x) x) 42) and (fun (lambda ()))
just work. This is not just compatibility with other
dialects; it is necessary for consistency with func-get-name,
which already returns lambda expressions, effectively
asserting that they are function names.
* txr.1: Fix documentation for fun operator. The
Dialect Note saying that a lambda expression is not a
function name in TXR Lisp is removed. Document that
function names may be any of those produced by
func-get-name. This has already been true for macros
and methods, just not for lambda expressions.
Under fun-get-name, document that lambda expressions
are produced for interpreted functions not found in
any binding by the previous searches.
|
|
|
|
|
|
| |
* txr.1: The recommendation to use call-super-fun is rounded
out by mentioning that the (meth ...) syntax can achieve the
same thing. An example of it is added under call-super-fun.
|
|
|
|
|
|
| |
* txr.1: call-super-fun method intro paragraph wrongly refers
to call-super-method. Adding example about how to call a base
class method.
|
|
|
|
|
|
|
| |
* txr.1: Recommend call-super-fun for calling a base class
method. Mark call-super-method deprecated, and add a Note
about why it's not correct to use it for the purpose of
calling a base method.
|
|
|
|
|
|
|
|
| |
* struct.c (call_super_fun): Do not allow type to be a struct
instance, which is a consequence of the super function being
used. The documentation says that the argument is a type and
mentions no possibility of it being an instance. Allowing a
struct invites mistakes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (static_slot_rewrite_rec): A simple rearrangement:
switch to postorder traversal, doing the derived structs
first, then this struct. Why does this fix a bug? Because
when the assignment *s = *to occurs for the node at the root
of the recursion, s and from point to the same object. And
so the assignment alters from, which is the search key.
When the children are then processed, the search key doesn't
match anything: it now looks like the to slot that the
children are supposed to get, and so they don't have it, of
course. So in other words the slot being rewritten is not
found in the derived types and not rewritten there as it
should be.
|
|
|
|
|
|
| |
* tests/012/stslot.expected: New file.
* tests/012/stslot.tl: New file. b/tests/012/stslot.tl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* struct.c (static_sot_ens_rec): This change is in the case
when a static slot is being ensured in a struct type which
already has that static slot by inheritance. In that
situation, the inheritance is severed and the struct gets its
own non-inherited slot of that name. Then all of the derived
structs are scanned. If any contain the original inherited
slot, it is updated to the new, non-inherited one. The bug
here is that we were copying the home_offs field of the
original inherited slot to the new one! This is wrong; the new
slot is not related to the original inherited one. The new
slot is a home slot and its own offset must be home_offs.
We can calculate that simply as its delta from the static slot
table base.
|