| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state loop): Instead of
using the lexical variable stin, use *stdin*, so that
the standard input stream is re-bound.
* txr.1: Documented binding and scope of *stdin*.
|
|
|
|
|
|
|
|
| |
* match.c (match_reg_var): No need to call
uw_purge_deferred_warning here any more.
* unwind.c (uw_register_tentative_def): Purge any
deferred warnings for the tag.
|
|
|
|
|
| |
* txr.1: Describe the Lisp expansion neglect in the pattern
language that is fixed for 166, reversible with -C.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/build.tl (sys:list-builder-macrolets): Function
renamed to sys:list-builder-flets. Builds local functions
instead of macrolets.
(build): Follow rename of sys:list-builder-macrolets.
* txr.1: Documentation updated and example added of
use of add as a higher order function.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/except.tl (sys:expand-handle): New
function.
(handle): Use sys:expand-handle to expand arguments. The
previously unused :whole form argument is now put to use,
and correctly captured using :form rather than :whole.
(handle*): New macro.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (op_catch): The sys:catch operator now passes the
exception symbol as the first argument of each clause.
This means the catch macro must be adjusted.
* share/txr/stdlib/except.tl (catch): Macro now inserts
a gensym dummy first argument into each clause to take the
symbol passed by the sys:catch operator.
(catch*): New macro, which is identical to the previous
catch macro, and thus exposes the symbol passed as the
first argument.
* txr.1: Documented catch*.
* tests/012/struct.tl: Some gensym numbers need adjusting
in one test case.
|
|
|
|
|
|
|
| |
* eval.c (do_expand): Expander for mac-param-bind is
redundantly expanding the main expression and taking that as
the epanded context form, rather than expanding the context
form.
|
|
|
|
| |
* args.h (args_init): Inline function removed.
|
|
|
|
|
|
|
| |
* lib.c (take_while_list_fun, take_until_list_fun):
We must terminate the output list when the output list
is empty, and not try to apply the predicate to
car(list) in that case.
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register plist-to-alist and
improper-plist-to-alist intrinsics.
* txr.1: Documented improper plist concept and new
functions.
|
|
|
|
|
|
|
| |
* lib.c (proper_plist_to_alist): Renamed to plist_to_alist.
* lib.h (proper_plist_to_alist): Declaration replaced.
(plist_to_alist): Declared.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/keyparams.tl (sys:extract-keys,
sys:extract-keys-p): Use the brand new memp function rather
than memq. memq is not correct for plist lookup because of
ambiguities like (:foo :bar :bar 3) where memq retrieves (:bar
:bar 3) for :bar rather than (:bar 3).
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register memp intrinsic.
* lib.c (memp): New function.
* lib.h (memp): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue is that optional argument init forms have visibility
to prior arguments. However, they are being expanded in the
original macro environment which doesn't take into account
any preceding variable bindings. This is wrong: the preceding
variables must shadow any symbol macros in the outer
environment.
* eval.c (expand_opt_params_rec, expand_params_rec): Create
a var shadowing macro environment for every parameter name
(or destructuring parameter list) that is traversed, and use
that macro environment to process the remaining parameters.
(make_var_shadowing_env): Allow the function to take a single
symbol instead of a list of symbols.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_param_macro): Use lisplib_try_load to retry
failed parameter macro lookup, thereby supporting auto-loading
of modules that define parameter macros.
* lisplib.c (keyparams_set_entries, keyparams_instantiate): New static
functions.
(lisplib_init): Support autoloading of keyparams.tl via new
functions.
* share/txr/stdlib/keyparams.tl: New file.
* txr.1: Documented :key param list macro.
* checkman.txr: Support "Parameter list macro" documentation
section type.
|
|
|
|
|
| |
* eval.c (bind_macro_params): Test that the rest of the
param list after the keyword is consp, not just non-nil.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In bind_macro_params allow the argument of :whole and :form
to be a destructuring pattern. Yet, in expand_params, we
are wrongly requiring it to be a bindable symbol, thus
blocking the feature.
* eval.c (expand_opt_params_rec): Only require the argument
of a keyword to be a bindable symbol if that keyword is :env.
(expand_params_rec): Some refactoring here not to recursively
expand keyword as parameters, removing a hacky test in the
atom case. Also car_ex is renamed to param_ex. Other than
that, same fix as in expand_opt_params_rec.
|
|
|
|
|
|
|
|
| |
Symptom: variables appearing in a @(catch) are
reported as unbound variables anyway.
* parser.y (process_catch_exprs); The parameters are the
second element of the catch form, not its rest.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* LICENSE, LICENSE-CYG, METALICENSE, Makefile, args.c, args.h,
arith.c, arith.h, cadr.c, cadr.h, combi.c, combi.h, configure,
debug.c, debug.h, eval.c, eval.h, filter.c, filter.h, ftw.c,
ftw.h, gc.c, gc.h, glob.c, glob.h, hash.c, hash.h, jmp.S,
lib.c, lib.h, lisplib.c, lisplib.h, match.c, match.h,
parser.c, parser.h, parser.l, parser.y, rand.c, rand.h,
regex.c, regex.h, signal.c, signal.h, stream.c, stream.h,
struct.c, struct.h, sysif.c, sysif.h, syslog.c, syslog.h,
termios.c, termios.h, txr.1, txr.c, txr.h, unwind.c, unwind.h,
utf8.c, utf8.h, share/txr/stdlib/awk.tl,
share/txr/stdlib/build.tl, share/txr/stdlib/cadr.tl,
share/txr/stdlib/conv.tl, share/txr/stdlib/except.tl,
share/txr/stdlib/getopts.tl, share/txr/stdlib/getput.tl,
share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl,
share/txr/stdlib/package.tl, share/txr/stdlib/path-test.tl,
share/txr/stdlib/place.tl, share/txr/stdlib/socket.tl,
share/txr/stdlib/struct.tl, share/txr/stdlib/tagbody.tl,
share/txr/stdlib/termios.tl, share/txr/stdlib/txr-case.tl,
share/txr/stdlib/type.tl, share/txr/stdlib/with-resources.tl,
share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl:
Add 2017 to all copyright headers and strings.
|
|
|
|
|
| |
* sock.c, sock.h: This module was not introduced in 2010,
but in 2016.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are following an incorrect expansion order for parameters
and bodies in the face of parameter macros. We are expanding
the body first, using the raw, untransformed parameters,
which is wrong. Secondly, we then neglect to expand the
body which emerges from param expansion. The fix is to pass
the unexpanded body to expand_params. Then expand the body
which emerges.
This also fixes another bug: the macro env passed to param
expanders is documented as excluding the parameters. This
is now actually true.
* eval.c (expand_macrolet, expand_tree_cases,
expand_catch_clause): Rearrange expansion logic surrounding
call to expand_params.
(do_expand): Likewise, and also introduce expansion for the
sys:with-dyn-rebinds operator. This is now needed because
under the new order, with-dyn-rebinds is now introduced into
unexpanded code. If it isn't expanded, then it then wrongly
protects its enclosed forms from expansion.
|
|
|
|
|
|
|
| |
* eval.c (expand_var_mods): New static function.
(expand_quasi): Use expand_var_mods to expand variable
modifies, rather than expand_forms. The new expand_var_mods
avoids expanding the argument of the :filter keyword.
|
|
|
|
|
|
|
| |
* match.c (v_load): Re-bind the *package* variable in the
new dynamic scope to its current value, so that any
modifications to it by the loaded code are thrown away,
just like in the Lisp load function.
|
|
|
|
|
|
| |
* match.c (v_load): Bind *load-recursive* to t around
the loading, and dump deferred warnings afterward if
the previous value of *load-recursive* is nil.
|
|
|
|
|
| |
* parser.y (o_var): fix expand wrongly being called on
a list of forms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change, Lisp expansion-time warnings are no longer
suppressed during the parsing of the TXR pattern language.
Embedded Lisp expressions can refer to TXR pattern variables,
which generates spurious warnings that must be suppressed.
Since TXR pattern variables are dynamically introduced in a
very flexible way, it's hard to do an exact job of this. We
take the crude approach that warnings are suppressed for all
pattern variables that appear anywhere in the TXR code. To do
that, we identify, at parse time, all directives which can
bind new variables, and register those variables as if they
were tentative global defs, purging all pending warnings for
them.
* match.c (binding_directive_table): New static hash table.
(match_reg_var, match_reg_params, match_reg_elem): New
functions.
(match_reg_var_rec): New static function.
(dir_tables_init): gc-protect binding_directive_table,
and populate its entries.
* match.h (into_k, named_k): Declared.
(match_reg_var, match_reg_params, match_reg_elem): Declared.
* parser.y (process_catch_exprs): New static function.
(elem): Call match_reg_elem for each basic directive,
to process the variables in that directive according to
its operator symbol. Do this for each compound form elem
and variable elem. Te horizontal @(define) eleme has
its own grammar production here, and we handle its
parameter list in that rule.
(define_clause): Handle the parameters of a vertical
@(define). It binds pattern variables, and so we must
suppress unbound warnings for those.
(catch_clauses_opt): Process the parameters bound by
@(catch) clauses.
(output_clause): Suppress warnings for the variables
nominated by any :into or :named argument.
(expand_repeat_rep_args): Suppress warnings for :counter
variable, and for :vars variables.
(parse_once): Remove the warning-muffling handler
frame set up around the yyparse call.
* txr.c (txr_main): Suppress warnings for TXR variables
defined using -D syntax on the command line. Dump
deferred warnings after parsing a .txr file.
|
|
|
|
|
|
|
| |
* parser.y (expand_repeat_rep_args): Correctly handle
situation when :counter or :vars appears as an argument
to another keyword. (A warning might be generated here,
since this situation is wrong.)
|
|
|
|
|
|
|
|
|
| |
* tests/008/filtenv.txr (f): Don't just copy the input
to the output but transform it by upcase-str. Otherwise
the test will pass even if the :filter syntax is not
processed at all!
* tests/08/filtenv.expected: Updated.
|
|
|
|
|
| |
* txr.c (txr_main): Reduce three repetitions of the
same call to intern to one call.
|
|
|
|
| |
* txr.1: "when they empty" -> "when they are empty".
|
|
|
|
|
| |
txr.1: the @(next) directive has a :var argument which was
added in 2011 but never documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the last round of changes on this topic, bringing
proper macro expansion to the arguments to @(skip),
@(fuzz), @(next), @(call), @(cat), @(load) and @(close).
* match.c (match_expand_keyword_args): Only process the
keyword arguments if they are followed by an argument.
Process @(next) arguments here too: :list and :string
take a Lisp expression, but :tlist and :var take an
argument which is not a Lisp expression and must be
handled properly. Also, expand any non-keyword expression.
This handles the <source> argument of @(next).
(match_expand_elem): New function.
* match.h (match_expand_elem): Declared.
* parser.h (expand_meta): Declared.
* parser.y (expand_meta): Static function becomes external.
(elem): Expand elem other than require or do using
match_expand_elem. We don't fold require and do into this
because match_expand_elem has a backward compat switch
in it that doesn't apply to these.
|
|
|
|
|
| |
* parser.y (expand_form_ver): New inline function.
(output_clause): If exprs are present, expand first one.
|
|
|
|
|
|
|
|
|
|
| |
* match.c (sem_error): Add noreturn attribute to function.
(tx_lookup_var_ubc): New static function.
(dest_set, v_next, v_flatten, v_cat, v_filter): Use new
function to for checked variable lookup.
(v_set): Pass first_spec to dest_set, since tx_lookup_var_ubc
needs to extract the directive symbol from the context
from.
|
|
|
|
|
|
| |
* parser.y (expand_forms_ver): New function.
(repeat_parts_opt, rep_parts_opt): Expand the exprs_opt that
follow MOD or MODLAST.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the argument lists of @(collect)/@(repeat), @(coll)/@(rep)
and @(gather), Lisp expressions can appear as arguments
to keywords or for supplying default values for variables.
These are not being macro-expanded.
* match.c (match_expand_vars): New static function.
(match_expand_keyword_args): New function.
* match.h (match_expand_keyword_args): Declared.
* parser.y (gather_clause, collect_clause, elem): Use new
function in match.c to expand the argument lists.
|
|
|
|
| |
* tests/012/quasi.tl: New tests added.
|
|
|
|
|
| |
* eval.c (me_op): Install handler to intercept warnings
and route them to uw_muffle_warning.
|
|
|
|
|
|
| |
* eval.c (expand_quasi): Add all-important missing
case which expands compound forms. This looks
like a txr-160 regression.
|
|
|
|
|
|
|
|
| |
* txr.1: New section Static Error Diagnosis describing error
handling and warnings. Documented functions
tentative-def-exists, register-tentative-def,
purge-deferred-warning, compile-defr-warning, compile-error
and compile-warning
|
|
|
|
|
|
| |
* struct.c (make_struct_type): Fix test of incorrect variable
which renders the supertype test useless, causing the type
to be created with no supertype.
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): Making
nonexistent base type a deferrable warning.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (sys:bad-slot-syntax): Takes form
argument. Uses compile-error function.
(defstruct): Use modified form of sys:bad-slot-syntax
and compile-error instead of throw.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (sys:defmeth): Removing checks
from here.
(defmeth): Add checks here with new functions which provide
location info and warning deferral/supression.
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): Register the struct
ame as a tentative definition.
|
|
|
|
|
|
| |
* eval.c (do_expand): When walking a defun or defvarl,
register them as tentative defs. Thus warnings are nicely
supressed in code like (progn (defun foo ()) (foo)).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tentative defs record the fact that some definition has been
seen at expansion time, even though that definition has not
been put into effect. They suppress warnings.
* unwind.c (tentative_defs): New static variable.
(uw_defer_warning): Throw away the warning if
it matches a tentative def.
(uw_register_tentative_def, uw_tentative_def_exists): New
functions.
(uw_dump_deferred_warnings): Purge the tag from the list of
deferred defs also.
(uw_init): gc-protect tentative_defs.
Register intrinsics register-tentative-def and
tentative-def-exists.
* unwind.h (uw_register_tentative_def,
uw_tentative_def_exists): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_intrinsic): Dump deferred warnings after
expansion, unless in the middle of a load.
* parser.c (read_eval_ret_last): Bind *load-recursive* around
all evaluations to t, then dump warnings if prior value
of *load-recursive* is nil. Thus the repl's :read feature
behaves like load.
(repl_warning): We can now unconditionally defer deferrable
warnings here now, whether or not in a load.
|
|
|
|
|
| |
* parser.c (repl): Create a new dynamic env and
rebind *stderr* variable to the repl's output stream.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register sys:ctx-form and sys:ctx-name
intrinsics.
* lisplib.c (error_set_entries, error_instantiate): New static
functions.
(lisplib_init): Register autoloading of error.tl via
new functions.
* share/txr/stdlib/error.tl: New file.
* struct.c (make_struct_type): Purge deferred warnings.
* unwind.c (uw_late_init): Register purge-deferred-warning
intrinsic.
|