| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
This provides a way to create lexical macros denoting slots,
such that method are invoked when they are updated.
* lisplib.c (struct_set_entries): Add rslot to list of
auto-load symbols for struct.tl module.
* share/txr/stdlib/struct.tl (sys:rslotset): New function.
(rslot, rslot): New macro and place macro.
(sys:rslot): New place kind.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The expansion of a place macro form should not be
subject to a complete macro-expansion (as a
regular macro form). Only one round of expansion
should be performed, and the results should be
re-tried as a place macro. Otherwise an opportunity
to expland a place macro will be missed.
* share/txr/stdlib/place.tl (sys:pl-expand):
Use macroexpand-1 rather than macroexpand.
* txr.1: Documentation updated to make the new behavior
clear. It's unlikely that anything in the world depends
on this, so no backward compatibility switch is being
provded to the old behavior. In situations where this
makes a difference, the old behavior is likely too wrong
to be useful.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (sys:l1-setq): Expand sym, because
it might not be a symbol. If it isn't a symbol, just generate
a set.
(dwim): Unconditionally bind sys:*lisp1* to t, whether
or not the unexpanded place is a symbol. It could expand to
a symbol. The context is lisp-1 if it does that.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (sys:*pl-env*): New special
variable for passing macro-expansion environment to
expanders.
(call-update-expander, call-clobber-expander,
call-delete-expander): bind sys:*pl-env* with
passed-in env argument, so if the expander needs to itself
recursively expand a macro, it has the macro-time env.
(nthcdr): Do not try to capture :env parameter, because
this will always be nil. Refer to sys:*pl-env* instead.
|
|
|
|
|
|
|
| |
Introduced on 2016-04-27 in 7afbcc19.
* parser.y (elem): Check $4 phrase position for
empty clauses, rather than $2. That's where they are.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
| |
* txr.1: Substantially rewrote incorrect and incomplete
description of merge directive.
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (txr_main): the --lisp option causes the parse
stream to be processed as Lisp, which is fine if it is a file
stream. If it is a byte string input stream created by the -c
option, it won't work due to missing character operations on
the stream, resulting in a strange error message and
termination. That issue isn't being fixed here; just providing
a more meaningful error message when --lisp is combined
with -c.
|
|
|
|
|
|
|
|
| |
* inst.nsi: Windows has no man page reading tools, and
the PDF and HTML are packaged already, so don't bundle
the txr.1 man page source. Furthermore, we need to remove
this when updating over existing installations, else
they will forever have a stale txr.1 file hanging around.
|
|
|
|
|
| |
* inst.nsi: consistently specify installation directory
with lower-case "txr" path component.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: The term "query language" is retired; "pattern
language" is used everywhere. The script argument can be TXR
Lisp or TXR, so is referred to as "script-file" in all
contexts where it could be either. Clarifications are added in
a few places that the script could be Lisp or that some
wording only applies when the script is TXR. Removing
incorrect, obsolescent wording which specifies that the
leading exclamation mark convention is honored in a file name
argument.
|
|
|
|
|
|
| |
* txr.1: Under INTERACTIVE LISTENER, add remarks that
using the exit function, or raising a fatal signal,
will prevent the history from being saved.
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: Revise the synopsis so that it doesn't insinuate
that the query-file or data-file arguments are mandatory.
A formatting issue with the brackets around options is
fixed. Under ARGUMENTS AND OPTIONS document that if
no arguments are present, the interactive listener
is launched. Under INTERACTIVE LISTENER, mention that
not only does the -i option run the listener, but so does
txr invocation with no arguments.
|
|
|
|
|
| |
* txr.1: Fix plural subject "lines" paired with singular
verb "has".
|
|
|
|
|
| |
* txr.1: Fix sentence talking about two functions,
respectively, but just one function as its subject.
|
|
|
|
|
|
|
|
|
| |
* parser.y (if_clause, elif_clauses_opt):
The previous commit changes the emulation of old @(if)
behavior, since expressions obtained via the n_exprs_opt
grammar phrase are not subject to expand_meta.
We can counteract this by calling expand_meta in
the compatibility code.
|
|
|
|
|
|
|
|
|
| |
* parser.y (if_clause, elif_clauses_opt, repeat_clause,
rep_elem): Recognize argument expressions as n_exprs_opt
rather than exprs_opt, so that expand_meta is not applied.
They are Lisp expressions, which are broken by expand_meta.
A failing test case is op syntax with @num metanum
variables, e.g. @(if (foo (op bar @1.slot))).
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (qquote_init): Stricter quote_form_p_f test
function: reject the quote form if it isn't a proper
list of two elements.
(optimize_qquote_form): Extract all arguments of list
forms and catenate them with mapcan, rather than
assuming that they have one argument. This wrong
assumption breaks ,,*(list ...) interpolation,
for instance.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (consp_f, second_f, list_form_p_f, quote_form_p_f,
xform_listed_quote_f): New static variables.
(qquote_init): New function.
(optimize_qquote_form): Use list_form_p_f, quote_form_p_f, and
second_f instead of constructing functions locally.
(optimize_qquote_args): Use xform_listed_quote_f instead
of locally constructed function.
(eval_init): Call qquote_init.
Register second function to second_f.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Staci-blowing test case:
(defstruct foo nil bar)
(mlet ((f (lnew foo bar (not f.bar))))
(prinl f.bar))
* struct.c (lazy_struct_init): Do not flip the lazy flag to zero
here. The problem is that it's being done after the
funcall(so->slot[0]), and so the struct is still marked for
lazy initialization while that function is running.
We could detect the circularity (as done in the force function) but that
would create inflexibilities in lazy struct initialization.
(check_init_lazy_struct): Flip the lazy flag to zero in
this function before calling lazy_struct_init.
* txr.1: Document behavior of struct being freely accessible during
lazy initialization.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The surface motive here is to get better code than
forms like (append (list 'a) (list 'b) ...).
The ulterior motive is to suppress the memory
explosion when heavily nested forms like ^^^^^^^^^^^x
are expanded. This problem was uncovered by
AFL (fast).
* eval.c (optimize_qquote_form, optimize_qquote_args,
optimize_qquote): New static functions.
(expand_qquote_rec): New function.
(expand_qquote): Contents moved into expand_qquote_rec.
This function now optimizes the results of calling
expand_qquote_rec.
|
|
|
|
|
|
| |
* eval.c (list_star_s): New symbol variable.
(eval_init): Initialize list_star_s and use it for the
list* function registration.
|
|
|
|
| |
* txr.1: list* symbol was typeset as meta.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (time_parse_s): New symbol variable.
(tm_to_time_struct): New static function,
based on code moved out of broken_time_struct.
(broken_time_struct): Bulk of code replaced with call to
tm_to_time_struct.
(time_struct_to_tm): New parameter, strict. Indicates
whether nils in time struct are converted to zeros,
or whether they trigger errors.
(time_string_meth): Specify strict conversion
of argument time struct to to struct tm when
calling time_struct_to_tm.
(time_parse_meth): New static function.
(time_init): Initialize time_parse_s symbol variable;
add time-parse static slot to time struct;
initialize slot with new method.
* txr.1: Document time-parse method.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The op transformer generates a lambda which has
as many arguments as the highest-valued metanumber
(@<digits> syntax) occurring in the form.
If this is a huge integer, it obligingly tries to
construct the argument list, running out of memory.
In this commit, we cap the value to 1024.
This issue was uncovered by the fuzzing utility
AFL (fast) 2.30b.
* eval.c (me_op): Throw error if max exceeds 1024,
preventing the call to supplement_op_syms to actually
generate an a formal parameter list of max symbols.
|
|
|
|
|
|
| |
* eval.c (me_def_variable): Check for sym not
being a bindable symbol. Otherwise we might call
mark_special on nil, which triggers an assertion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Variables defined with defvarl or defparml are being marked
special, due to a mark_special call in the macro expander
which existed before they were introduced.
* eval.c (me_def_variable): We have to call mark_special
at macro-expansion-time for defparm and defvar, rather than
arrange for it to be called later, for the same reasons
that the (now incorrect) mark_special call had been introduced
in do_expand function for handling defvar.
(do_expand): Do not call mark_special, because the symbol
being handled here is defvarl: define lexical variable.
|
|
|
|
|
|
| |
* eval.c (do_expand): Throw error if defsymacro form
isn't a list of three elements, just like defparm
and defparml do.
|
|
|
|
|
|
| |
* eval.c (op_defvarl, op_defsymacro): Report correct
symbol in not-bindable-symbol error message rather
than reporting as let.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (time_string_s): New symbol variable.
(time_fields_to_tm, time_struct_to_tm): New static functions.
(make_time_impl): Replace bunch of code with call to
time_fields_to_tm.
(time_string_meth): New static function.
(time_init): Initialize time_string_s. Add time-string
static slot to time struct. Register time-string
method.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Test for strptime.
* eval.c (eval_init): register time-parse intrinsic.
* lib.c (time_parse): New function.
* lib.h (time_parse): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When building in a separate directory, we can't just symlink
the win directory, because the txr.res output file is architecture
dependent and cannot be shared between 32 and 64 bit builds.
* Makefile (%.res): Convert .rc -> .res rule to use the
top_srcdir pattern, so the prerequisite will be found without
the aid of the win/ directory symlink.
* configure: Do not create win -> $source_dir/win
symlink in the build directory.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* jmp.S (DEFUN): Separate definition for 64 bit Cygwin,
which doesn't use leading underscores and has an
unusual prologue.
(jmp_save, jmp_restore): Separately defined for 64 bit
Cygwin, due to use of Microsoft 64 bit calling conventions.
* signal.h (struct jmp): In x86-64 version, only on Cygwin,
new members: rsi and rdi. These registers are considered
nonvolatile and so are saved and restored by jmp_save and
jmp_restore.
|
|
|
|
|
|
|
| |
* Makefile (DEPGEN): We must fold the backslash continuations
before trying to delete the first dependency element,
because if the target name is long, that first element may be
on the following line, and we delete the backslash.
|
|
|
|
|
|
|
| |
* parser.c (get_home_path): Do not try HOME first and
then USERPROFILE. If running on Cygnal, use strictly
USERPROFILE, and do not fall back on HOME. In all other
situations, try the HOME variable only.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
| |
* lib.c (out_quasi_str): New static function.
(obj_print_impl): Handle sys:quasi and sys:quasilist
forms, reproducing a syntax similar to their read
notation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't have to flip between two arrays, since the
nfa_closure and and nfa_move_closure can write the
output set into the same array.
* regex.c (struct nfa_machine): Replace flip and flop
members with a single set.
(nfa_closure, nfa_move_closure): out array parameter removed;
in renamed to set. References to in and out simply replaced
with set.
(nfa_run): Allocate one set instead of two, plus the stack.
Remove code to swap the two pointers on each iteration.
(regex_machine_reset): Prepare initial closure in the one
and only set array.
(regex_machine_init): Allocate set array, rather than flip an
flop.
(regex_machine_cleanup): Free set array and null out pointer
rather than flip and flop arrays.
(regex_machine_feed): Pass just the set ot the
nfa_move_closure function. Remove flip/flop pointer swapping
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (struct nfa_machine_t): Remove move and clos
array pointers, replace with flip and flop. Remove
nmove member.
(nfa_move): Static function removed.
(nfa_move_closure): New static function, based on nfa_move and
logic from nfa_closure.
(nfa_run): Use nfa_move_closure and flip between two
arrays.
(regex_machine_reset): Remove reference to nmove member
in nfa_machine_t. Prepare initial closure in flip array.
(regex_machine_init): Allocate flip and flop arrays,
rather than removed move and clos.
(regex_machine_cleanup): Free flip and flop arrays and
zero out the pointers, rather than removed move and clos.
(regex_machine_feed): Replace nfa_move and nfa_closure
with combined nfa_move_closure from flip to flop,
and exchange of flip and flop arrays.
|
|
|
|
|
| |
* lib.c (split_str): Fourth argument of search_regex is
Lisp boolean, so nil should be used to specify false.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Detect utsname and uname.
* sysif.c (utsname_s, sysname_s, nodename_s, release_s,
version_s, machine_s): New symbol variables.
(uname_wrap): New static function.
(sysif_init): Initialize new symbol variables.
Instantiate utsname struct type. Register uname_wrap
as uname intrinsic function.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Retracting the recent change to add the "t" mode when
opening non-binary streams on Cygwin, which arranges
for line ending conversion. This restores the Unix-like
treatment of text files on Cygwin, which is expected
of programs.
The Windows native version of TXR will do line ending
conversion thanks to the behavior of text streams in the
Cygnal fork of Cygwin.
* stream.c (format_mode): Only add the "t" option
on Cygwin if compatibility with 144 and 145 is selected.
* txr.1: Updated compatibility notes.
|
|
|
|
| |
* inst.nsi: delete sh.exe from bin directory, not root.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
| |
* LICENSE-CYG: Describe Cygnal situation and point
to Cygnal project. Also, treat the GCC runtime separately.
|
|
|
|
| |
* txr.1: Heading fixed from addrinfo to getaddrinfo.
|
|
|
|
|
|
|
| |
* socket.c (getaddrinfo_wrap): Initialize alist to null,
because getaddrinfo doesn't set it in the failure case!
Then, avoid calling freeaddrinfo for null pointer;
POSIX doesn't require that to work.
|
|
|
|
|
|
|
|
| |
* inst.nsi: the txr link now points to the executable
rather than the directory. This is because the executable
now does something meaningful: it brings up a console window
with a working REPL. The link to the directory is renamed
install-root.
|
|
|
|
|
|
| |
* inst.nsi: Delete sh.exe. If unable, it's okay to
leave it to the next reboot; it's not critical to
remove sh.exe.
|