| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit addresses a bug of the following type:
(defpackage p (:fallback usr))
(in-package p)
(let ((lb (new list-builder)))
lb.(add 1)) ;; problem: this add is p:add
the add symbol is not on the auto-load list; it occurs
as a slot of the list-builder class, but is not interned
when TXR starts. Thus the (:fallback usr) doesn't pick it up.
Expected behavior is that add is usr:add.
* lisplib.c (intern_only): New static function.
(sock_set_entries, build_set_entries, getopts_set_entries,
stream_wrap_set_entries): Define additional lists of
supplemenary symbols which are passed to intern_only
just to be interned in the usr package without autoload
registratiions. These symbols are all slots documented for
public use in various structures defined by the respective
modules managed by these autoload functions.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim, protsym.c: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This prevents a bug which manifests itself as a totally bogus
file name and line number being reported in a diagnostic.
The cause is that source loc info is recorded for an interned
symbol when it is first encountered in one place in the
code. Then that symbol occurs again in another place (perhaps
a different file) in such a way that its source loc info is
inherited into a surrounding generated form which now has
incorrect source loc info: the location of the first
occurrence of the symbol not of this form. Then when some
error is reported against the form, the bogus source loc info
is shown.
* parser.y (rlviable): New static function.
(rlset): Only record source loc for forms which satisfy
rlviable.
|
|
|
|
|
|
| |
* txr.1: Several places in the document refer to a section
called Equality Substitution which supposedly exists under the
Structures section. As of now, it actually does!
|
|
|
|
|
| |
* txr.1: Restructure long sentence for readability, fixing
awkward comma in the process.
|
|
|
|
|
|
| |
* txr.1: Describe fallback of ref and refset onto
list-like operations if lambda/lambda-set are
not supported.
|
|
|
|
| |
* txr.1: "behavior ... becomes" second person agreement.
|
|
|
|
| |
* txr.1: Fix run-on parenthesis.
|
|
|
|
|
| |
* txr.1: a :maxgap of zero also means that the collected items
must match immediately.
|
|
|
|
|
|
| |
Reported by Martin Dvořák.
* txr.1: Word "five" should be "n".
|
|
|
|
|
|
|
| |
Reported by Martin Dvořák.
* txr.1: In pattern matching clauses, repeat and rep are
shorthands for collect and coll.
|
|
|
|
| |
* txr.1: use mono font for @(output).
|
|
|
|
|
|
| |
txr.1: The equivalences between [x i] and some functions like
ref are dynamic; they depend not only on the type ofx, but
also whether i is a range or integer.
|
|
|
|
|
|
|
| |
* lisplib.c (sock_set_entries): Add missing sock-bind,
sock-connect, sock-listen, sock-accept, sock-shutdown,
open-socket, open-socket-pair, sock-send-timeout and
sock-recv-timeout.
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: Update the documentation to reflect the current
handling of objects, eliminating some contradictions
in the process, like text which says that rplacd is
erroneous on anything but conses and lazy conses, followed by
text which states other kinds of objects are allowed.
The semantics of car and cdr forms as places is described
strictly in terms of rplaca and rplacd, so the mechanism is
then described in one place.
|
|
|
|
|
|
| |
* lib.c (tail): Don't call cdr on the same cell twice in the
loop body. tail is used in list_collect and friends, which are
used all over the place.
|
|
|
|
|
|
|
|
|
| |
* eval.c (term): Function here from lib.c, and changed to
static. It is used only by iapply.
* lib.c (term): Function moved to eval.c.
* lib.h (term): Declaration removed.
|
|
|
|
|
|
| |
* lib.c (listref_l): Unused function removed.
* lib.h (listref_l): Declaration removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
refset and range assignment is implemented for objects that
have no lambda-set but do have a car method.
* lib.c (refset): Implementation for lists rewritten
to avoid listref_l, and use nthcdr instead.
For structs, if there is no lambda-set method, but
a car method exists, jump to the list case: the idea
is that we can cdr down and then use rplaca.
(dwim_set): Error handling streamlined. In this function too,
we check whether there is a car method and branch to the list
case.
|
|
|
|
|
| |
* lib.c (nthcdr): Terminate loop when nil is
hit rather than continuing to count down to zero.
|
|
|
|
|
| |
* lib.c (car, cdr): Type mismatch messages now identify
functions.
|
|
|
|
|
|
| |
* lib.c (car, cdr): Don't fail if the struct object has no car
or cdr method. Use it if it is available, otherwise try to
fall back on the lambda method if that is available.
|
|
|
|
|
|
|
|
| |
* lib.c (ltail): Function removed. This was introduced at the
same time as lazy_appendv and used only by it. That function
was rewritten a few months ago and doesn't use lail.
* lib.h (ltail): Declaration removed.
|
|
|
|
|
|
| |
* lib.c (seq_info): The obj_struct_p test must be applied to
obj, not to cls, which is a symbol. Due to this bug, seq_info
would always report struct-based sequences as SEQ_NOTSEQ.
|
|
|
|
|
| |
* lib.c (seq_info): Incorrect indentation of else
statement fixed.
|
|
|
|
|
| |
* lib.c (last): Use seq_info classification
rather than relying on listp.
|
|
|
|
|
|
| |
* lib.c (lastcons): Return value is just the last cons rather
than a loc. The only caller of this function is last.
(last): Adapt to the new lastcons.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reduces the proliferation of car_l and cdr_l.
With this change, nreverse should work on chains of
objects that implement rplacd.
* combi.c (comb_gen_fun_common, rcomb_gen_fun_common): Use
rplaca.
* eval.c (mappendv, mapdov): Likewise
* hash.c (hash_equal_op): Likewise.
* lib.c (nreverse, acons_new, aconsql_new, sort_list): Use
rplaca and rplacd.
* match.c (dest_set, v_gather, v_collect, v_flatten, v_cat,
v_output, v_filter): Likewise
* parser.c (ensure_parser): Use sys_rplacd.
* unwind.c (uw_register_subtype): Use rplacd.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (replace_obj): New static function.
(sub): Handle struct case via lambda method.
(replace): Handle struct case via replace_obj.
* txr.1: Documented.
* tests/012/aseq.tl (add): The lambda method now has to handle
a range argument. One test case uses the last function, which
for non-lists relies on sub, which now calls the lambda method
if the object has one.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (seq_info, car, cdr, make_like, nullify,
generic_funcall, copy, length, empty, ref, refset, dwim_set,
dwim_del, populate_obj_hash): Use new obj_struct_p test when
we know that the object is a COBJ.
* struct.c (struct_inst_ops): Change from static to extern.
* struct.h (ob_struct_p): New inline function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register rplaca and rplacd using new
rplaca_s and rplacd_s symbol variables.
* lib.c (rplaca_s, rplacd_s): New symbol variables.
(rplaca): Handle struct object via rplaca method, if it has
one, otherwise lambda-set, if it has that, or else error
out.
(rplacd): Handle struct object via rplacd method.
* lib.h (rplaca_s, rplacd_s): Declared.
* txr.1: Documented rplaca and rplacd methods.
|
|
|
|
|
|
| |
* lib.c (refset): If structure has no lambda-set method,
diagnose it like that, rather than "not a sequence".
Also, diagnostics should use refset:, not ref:.
|
|
|
|
|
| |
* txr.1: Fix wording under invoke-catch which refers to a
nonexistent function called get-frames.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recording of source location info incurs a time and space
penalty. We don't want to impose this on programs which are
just reading large amounts of Lisp data that isn't code.
* eval.c (eval_init): Register lisp-parse and read functions
to the newly introduced nread function rather than lisp_parse.
lisp_parse continues to record source location info
unconditionally.
* parser.c (rec_source_loc_s): New symbol variable.
(parser_common_init): Set the new member of the parser
structure, rec_source_loc, according to the current value of
the special var *rec-source-loc*.
(lisp_parse_impl): New second argument, rlcp_p. If true, it
overrides the rec_source_loc member of the parser structure
to true.
(lisp_parse): Pass true argument to rlcp_p parameter of
lisp_parse_impl, so parsing via lisp_parse always records
source loc info.
(nread): New function.
(iread): Pass true argument to rlcp_p parameter of
lisp_parse_impl, so *rec-source-loc* controls whether source
location info is recorded.
(parse_init): Initilize rec_source_loc_s symbol variable,
and register the *rec-source-loc* special var.
* parser.h (struct parser): New member, rec_source_loc.
(rec_source_loc_s, nread): Declared.
* parser.y (rlcp_parser): New static function. Like rlcp but
does nothing if parser->rec_source_loc is false.
(rlc): New macro.
(grammar): Replace rlcp uses with rlc, which expands to a call
to rlcp_parser.
(rlrec): Do nothing if source loc recording is not enabled in
the parser.
(make_expr, uref_helper): Replace rlcp with rlc. This is
possible because these functions have a parser local
variable that the macro expansion can refer to.
(parse_once): Override rec_source_loc in the parser to 1, so
that source loc info is always recorded when parsing is
invoked through this function.
* txr.1: Documented *rec-source-loc* and added text under
read and iread.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TXR 188 makes a slight mess of the #H notation. An :eql-based
hash table prints as #H(() ...), but when that notation is
read, it produces an :equal-based hash table. No aspect of
this situation was intended; the intent was that the notation
stays the same as before, and just the hash function changes
to make :equal-based the default. Let's just go with this
and have #H(() ...) denote :equal-based tables.
* hash.c (hash_print_op): Print an :eql-based for eql-based
hash tables, and nothing for equal-based ones. In
compatibility mode with 188 and older, reproduce the old
behavior, rendering equal-based tables with :equal-based and
the absence of a symbol for eql-based.
* txr.1: Updated places that touch on :equal-based and
added compatibility notes.
* tests/009/json.expected: updated, since equal-based hash
tables now print without :equal-based keyword.
|
|
|
|
|
| |
* txr.1: There is no :print command in the listener to print
the current prompt; it is actually the :prompt command.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim, protsym.c: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
These easily express discontinuous ranges.
* eval.c (rlist_fun, rlist_star_fun, rlist, rlist_star): New
static functions.
(eval_init): Register rlist and rlist* intrinsics.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* eval.c (do_expand): In the function call case, check for the
operator being the rcons function. If it is called with
exactly two arguments and they are constantp in the given
environment, then evaluate them and replace with a range
literal object. Rationale: ranges often appear in constant
form like [array 1..:] and whatnot.
|
|
|
|
|
|
| |
* txr.1: Clarify that Ctrl-D is the only deletion command
which copies into the clipboard, and only in visual selection
mode.
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: Fix wrong wording about the by-value nuance of the
in operation. What is specifically doesn't do, in contrast
to the by-pointer nuance, is propagate the foreign
representation back to Lisp. Not Lisp to foreign, which is
opposite to the in operation. Also clarifying some wording
in the description of the out operation: that the by-value
nuance doesn't reconstruct from the updated Lisp structure,
to help the reader keep in mind the data direction.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-mac-let): Move repeated
boiler-plate code from the various rng macrolets into an
the implementation of the sys:rng macro they rely on.
That implementation is split into two macros: sys:rng is
now the name of a wrapper which adds the boiler-plate, and the
bulky implementation macrolet is now called sys:rng-impl.
|
|
|
|
|
|
| |
* txr.1: Fixed a number of places where structure slots
are called members. In the context of structures, we use the
word member only for C structures; Lisp structures have slots.
|
|
|
|
|
|
| |
* 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.
|