| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The #<lazy-string ...> print syntax is gone. Lazy strings are
now printed by traversing their structure, without forcing
them to the flat representation.
* lib.c (lazy_str_put): New function.
(out_str_char, out_str_pretty, out_lazy_str): New static functions.
(obj_print_impl): Use out_str_pretty for standard-printing
regular strings. Use lazy_put_str for pretty-printing lazy
strings, and out_lazy_str for standard-printing them.
* lib.h (lazy_str_put): Declared.
* stream.c (put_string): Check for a lazy string and route
to lazy_str_put, so the string doesn't get forced
(though of course the underlying list does, if it is lazy).
|
|
|
|
|
|
|
|
|
|
|
| |
This is caused by the ("str0" "str1" .. "strn" nil)
representation put out by the interactive style lazy list.
The lazy string force function doesn't like the nil.
Quick and dirty fix applied here.
* lib.c (lazy_str_force, lazy_str_force_upto): If a nil comes
out of lstr->ls.list, break out of the loop as if the list
ended.
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (place_set_entries): Add with-slots to autoload
name list.
* share/txr/stdlib/struct.tl (with-slots): New macro.
* txr.1: Documented.
|
|
|
|
|
| |
* eval.c (error_trace): Don't check exsym for exact equality
to eval-error, but whether it is a subtype.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This originates to a commit on 2011-10-21. In that commit, I
attempted to make until/last clauses have visibility to the
bindings in the collect body (even though those are
discarded). The problem is that the until/last clause is tried
whether or not the body succeeds. When the body fails, no
bindings emanate from it. In that case, the until/last clause
is wrongly evaluated in an environment with no bindings
whatsoever, meaning that even bindings that existed before the
collect are not available to it.
* match.c (h_coll, v_collect): Evaluate the last/until clause
using the collect body bindings only if those bindings are not
nil, otherwise use the original bindings from before entry
into the collect.
|
|
|
|
|
|
|
| |
* match.c (extract_bindings): Process the final list of vars.
For any variable not already on the list of output bindings,
check if it has a Lisp binding, and if so, add *that* binding
to the output bindings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (format_field): Function moved here from match.c,
along with the introduction of a new behavior: if a meta-expr
occurs among the modifiers, its constituent expression
is evaluated in its place. This allows for @{a @[expr]}
which was previously not allowed in Lisp quasiliterals,
but worked in TXR quasiliterals due to the treatment
of @ by txeval.
(subst_vars): Static function turns external, so code in
match.c can call it instead of the subst_vars in that module.
For that purpose, it needs to take a filter argument and
process filters, like the match.c subst_vars.
(op_quasi_lit): Pass nil as filter argument to subst_vars.
* eval.h (format_field, subst_vars): Declared.
* match.c (format_field): Function removed, moved to
eval.c and slightly changed.
(subst_vars): Renamed to tx_subst_vars. By default, now just a
wrapper for subst_vars. In compatibility mode, invokes the
old logic.
(do_txeval, do_output_line): Call tx_subst_vars rather than
subst_vars.
* match.h (format_field): Declaration removed.
* parser.y (expr): Grammar production removed: no longer
referenced.
(o_var): Braced variable case now parsed as n_expr, and
expanded as expr by default, since this is Lisp now. In
compatibility mode, expanded using expand_meta.
Also SYMTOK case must be subject to expansion; an output
var can now be a symbol macro.
(expand_meta): Expand a quasi-literal as Lisp, except
in compatibility mode.
* txr.1: Bit of a documentation update. Existing doc isn't
totally clear.
|
|
|
|
|
|
|
|
| |
* lib.c (chr_isdigit, chr_isxdigit): Return the integer value
rather than the symbol t, which can be exploited to write
more compact scanning code.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* match.c (do_output_line, do_output): Decode (var expr)
syntax as argument of :counter and implement displacement.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: There is no Collect Keywords section.
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (data_s, name_s): New symbol variables.
(v_data, v_name): New static functions.
(syms_init): Initialize data_s and name_s.
(dir_tables_init): Register v_data and v_name as vertical
directives, and enable them in horozintal context too
using hv_trampoline.
* txr.1: Documented.
|
|
|
|
|
| |
* match.c (dir_tables_init): Register hv_trampoline handler
for line_s.
|
|
|
|
|
| |
* match.c (h_chr, v_line): Don't try to print clashing binding
or object using ~d, because it might not be an integer.
|
|
|
|
|
|
|
| |
* genvim.txr: Use new mboundp to check for macros, and
special-operator-p to detect operators. fboundp doesn't report
them any more. Also, :postinit must be included among
lispwords.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
Bumped copyright year in configure.
(Could be last chance this year).
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
| |
We must preserve ambiguity-free read-print consistency.
* lib.c (simple_qref_args_p): New static function.
(obj_print_impl): Check for qref and print as
dot notation if its argument list satisfies
simple_qref_args_p.
|
|
|
|
|
| |
* txr.1: Add the cadr functions, rest, first through tenth,
nthcdr and symbol-value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_iflet_whenlet): Allow the test form
to be an atomic expression instead of bindings.
This allows iflet to be used as the sole target
construct of condlet, while allowing condlet to
have a fallback clause with t. It also means that
an empty list of bindings is allowed (since it
is the atom nil).
* lisplib.c (ifa_set_entries): Add "condlet" to
the autoload names for the ifa module. That's
where we are adding condlet.
* share/txr/stdlib/ifa.tl (sys:if-to-cond): New
macro expander helper function, generalizing the writing
cond-like macros based on if-like operators.
(conda): Rewritten using sys:if-to-cond.
(condlet): New macro.
* txr.1: Documented change in iflet/whenlet.
Documented condlet.
|
|
|
|
|
| |
* txr.1: Redundant item removed from Conventions.
Indicate that braces may be removed where it is clear.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Address some situations in which the debug_check call is given
a piece of spec with no source loc information attached.
* (h_var): Use rlcp when constructing new piece of spec
representing a substituted variable, or a spec confined
to just search for a piece of text with no trailing match.
(do_match_line): Pass the whole specline to debug_check,
rather than just the elem, which might just be a string
with no location info attached.
(match_files): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (opt_dbg_expansion): New global variable.
(help): Print summary for --debug-expansion.
(txr_main): Recognize new option and set flag.
* parser.y (parse_once): Suppress debug stepping around parser
if opt_dbg_expansion is false.
* txr.1 (opt_dbg_expansion): Declared.
* txr.1: Documented new option.
|
|
|
|
| |
* lisplib.c (lisplib_try_load): if3(a, b, nil) -> if2(a, b).
|
|
|
|
|
|
| |
* lisplib.h (opt_dbg_autoload): Declaration removed.
* txr.1 (opt_debugger, opt_dbg_autoload): Declared.
|
|
|
|
|
|
| |
* configure: comment about saving command line
needs to be below the re-execution trick.
Comment added for re-execution trick.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (set_origin): New static function.
(eval_init): Register set_origin as sys:set-macro-ancestor.
* share/txr/stdlib/place.tl (sys:pl-expand): Set macro
ancestry when expanding a place macro.
(sys:cp-origin): New function.
(call-update-expander, call-clobber-expander,
call-delete-expander): Use sys:cp-origin to walk through
expanded code and attach the place form as the macro
ancestor of all the getter, setter or deleter calls,
effectively to say that those calls are expansions of
the place, which is approximately the case.
|
|
|
|
|
| |
* parser.y (n_expr): Fall back on getting line number info
from parser->lineno, if it didn't come from the operands.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Structs can now have code which executes after an object is
initialized, which is useful for doing work like registering
objects in global lists and whatever, when those actions need
access to the initialized slots of the object.
* share/txr/stdlib/struct.tl (defstruct): Handle :posinit
syntax, by generating lambda as eighth argument of sys:make-struct
call.
* struct.c (struct struct_type): New member, postinitfun.
(struct_init): Adjust registrations of make_struct_type
to account for new parameter. The user visible
make-struct-type is registered as having one optional
argument, for backward compat.
(make_struct_type): New argument, postinitfun. Store this
in the structure. For backward compatibility, the argument
is defaulted.
(struct_type_mark): Mark the new postinitfun member.
(call_postinitfun_chain): New static function.
(make_struct, lazy_struct_init): Call call_postinitfun_chain
after slots are initialized, and after the boa function is
called.
* struct.h (make_struct_type): Declaration updated.
* lib.c (time_init): Pass eighth argument to make_struct type.
* sysif.c (sysif_init): Likewise.
* unwind.c (uw_late_init): Likewise.
* tests/012/struct.tl: Update defstruct expansion test case.
* txr.1: Document new argument of make-struct-type,
and clarify ordering of initfun with regard to
other actions. Likewise, document :postinit, and clarify
ordering of :init actions with regard to other actions.
|
|
|
|
|
|
|
|
|
|
| |
* lib.h (enum functype): New member, N8.
(struct func): New members n8 and n8v in embedded f struct.
(func_n8, func_n8v, func_n70, func_n8o): Declared.
* lib.c (equal): Handle N8 in switch.
(func_n8, func_n8v, func_n70, func_n8o): New functions.
(generic_funcall): Handle N8 in two switches.
|
|
|
|
|
|
|
|
| |
* lib.c (dwim_set): When the range argument is a
vector or list, it is wrongly hangled through replace, even if
seq is a hash. replace throws since it doesn't handle hashes.
We must treat the vector or list as a hash key and
handle through sethash.
|
|
|
|
|
|
|
| |
* lib.c (replace_list, replace_str, replace_vec): The from
argument must be checked to be a list using listp not consp.
The legacy convention that nil is treated as missing does not
work in this function as it does in sub.
|
|
|
|
|
|
|
|
| |
Requires updated man2html which puts out lower case.
* genman.txr: All matched and generated HTML is lower case.
* txr.1 (NP*): Use lower case h4 tag in M2SS macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue: wrong [+] changes to [-], leading to
inconsistent state.
* genman.txr: In TOC extraction and transformation,
we fix the stupid broken <DT>....<DD> that man2html puts
out and turn it into <DT>...</DT>. This way a DL
now has a DT element as its previous sibling.
(tocjump): When we see a DL now, we get the correct
element which has the expand/collapse: the previous
sibling which is a DT containing the anchor.
|
|
|
|
|
|
| |
* txr.1: Improved wording, better explanation, explanation
that nested macro lists support all features, and
specified meaning of :whole inside nested lists.
|
|
|
|
|
|
|
|
|
| |
* eval.c (bind_macro_params): Remove the restriction that the
:whole and :form do not allow a destructuring pattern,
requring strictly a symbol. Common Lisp's &whole also
does destructuring. As a side effect of this change, the :env
parameter also supports destructuring, thought this isn't
going to be meaningful since macro environments aren't lists.
|
|
|
|
| |
* txr.1: "unless they are the same object."
|
|
|
|
|
|
|
|
| |
txr.1: Lose the useless use of conditional evaluation.
Everything is doable with the meIP macro. Only one piece
of conditional evaluation is needed for different wording:
textual man page says "angle brackets" whereas formatted
page refers to italic font.
|
|
|
|
|
| |
* genvim.txr: Below Contents, place a note for users who
have disabled Javascript.
|
|
|
|
|
| |
* genvim.txr: For some reason, we were generating a second
<title> tag, with different contents.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a section number is clicked, if the table of contents
section which contains it is collapsed, open it, and its
parents.
* genman.txr: (tocjump): New JS function. add onclick action
to jump-back links, which calls tocjump JS function which does
the expansion. The name anchor entries in the TOC are tagged
with a "tocanchor: class so they can be more specifically
selected by the tocjump function.
|
|
|
|
|
|
|
|
|
| |
Section numbers are now hyperlinks which jump back to their
respective table of contents entry.
* genman.txr (toc-tag): New function.
Generate link anchors into section titles.
Generate name anchors in TOC.
|
|
|
|
| |
* txr.1: Remove spurious z in example.
|
|
|
|
|
| |
* txr.1: Structures move under cobj types, which are indicated
with angle brackets to show they are not programmer-visible.
|
|
|
|
| |
* txr.1: more types are listed under typeof.
|
|
|
|
| |
* txr.1: Misuse of << in syntax block.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (symbol_function): Only retrieve function binding,
and not macro or operator bindings, unless compatibility
<= 127 is in effect.
(symbol_macro): New function.
(fboundp): Only test for existence of function, not
macro or operator, unless <= 127 compatibility is in effect.
(fmakunbound): Do not remove macro binding, unless
compatibility <= 127 is in effect.
(eval_init): Register sys:top-mb variable for use in place.tl
library module. Register symbol-macro intrinsic function.
* share/txr/stdlib/place.tl (sys:get-mb): New function
(symbol-macro): New syntactic place.
* txr.1: Updated incorrect documentation about environments
from the perspective that macros and functions coexist.
Documented symbol-macro. Updated symbol-function, fboundp
and fmakunbound documentation. Added missing documentation
for mmakunbound. Reference to fboundp under define-place-macro
revised to mboundp. Added compatibility notes.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_macro): The expander argument is now
a macro binding, which is a cons cell for built-in
macros written in C also, not only for Lisp-defined
macros.
(symbol_function): Dereference macro binding.
(reg_mac): Construct cons cell binding for built-in
macro instead of sticking it into the table directly.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
| |
* configure: re-test for ftello with _LARGEFILE_SOURCE
and add to lang_flags if that works.
|
|
|
|
| |
* configure (lang_flags): Add POSIX_C_SOURCE set to 200112.
|
|
|
|
|
|
|
|
|
|
|
| |
Incorrect, irrelevant handle test inside stdio_get_line
virtual function fails to detect closed stream, leading
to a null pointer passed to the stdio library.
* stream.c (snarf_line): Rewrite according to pattern
followed by the other functions. We must test h->f for
null, not stream->co.handle, which never goes null
until the object is being reclaimed by gc.
|