| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (warning_continue): Static function removed.
(no_warn_expand): Use uw_muffle_warning instead of
removed function.
* parser.y (warning_continue): Static function removed.
(parse_once): Use uw_muffle_warning instead of
removed function.
* unwind.c (uw_muffle_warning): New function.
* unwind.h (uw_muffle_warning): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than fix this in the awk macro, let's
just have sys:expand block warnings.
* eval.c (warning_continue, no_warn_expand): New static
function.
(eval_init): Change registration of sys:expand to point
to no_warn_expand.
* share/txr/stdlib/place.tl (call-update-expander,
call-clobber-expander, call-delete-expander, sys:placelet-1):
Remove ignwarn wrapping from sys:expand calls.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
| |
* txr.1: The example illustrating a module with
private and public symbols is altered to show a
superior practice: use a no-fallback package for
the public symbols, and be in the private package
when defining the module.
|
|
|
|
|
| |
* txr.1: Document that circular notation works with
eql-based hash tables, but not equal-based.
|
|
|
|
|
| |
* txr.1: eliminate 'large enough to "covers"' with
rewording.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (do_expand): If a compound form doesn't expand into
anything, then let us check whether it calls an unbound
function, and issue a warning.
* share/txr/stdlib/place.tl (sys:pl-expand): Move function
definition ahead of first use to suppress unbound function
warning. Eventually we will have a relaxed model of deferred
warning about this.
(sys:placelet-1): Suppress warnings around call to sys:expand
because we are expanding a body into which we inserted
function calls without inserting their definitions.
|
|
|
|
|
|
|
|
|
| |
* eval.c (do_expand): When expanding the body of a defun
we must create a function shadowing environment which
indicates that the function's name is in scope.
This must not be done for defmacro; a defmacro doesn't
introduce a function binding, and a macros's body doesn't
have that macro in scope.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We do not have perfect read/print consistency for
quasiliterals. Programs can construct quasiliterals which
cause the printer to throw exceptions, or which don't
print such that the same object is read back.
However, at least we can handle some trivial cases.
In particular, the object (sys:quasi . #<function>)
occurs in the system, as the top-level binding of
the quasi operator. With this change, we can print that
instead of throwing.
* lib.c (obj_print_impl): Check that a quasiliteral or
quasi-list-literal is a list with at least one argument.
Don't print (sys:quasi) or (sys:quasi . non-nil-atom) in the
notation.
|
|
|
|
|
|
|
|
| |
* lib.c (obj_print_impl): Only print (sys:expr x . rest) as @x
if rest is nil, and x is a cons. Otherwise we create
read-print problems: (sys:expr x y) prints as @x, concealing y.
And (sys:expr sym) prints as @sym which reads as
(sys:var sym).
|
|
|
|
|
| |
* txr.1: References to EXCEPTIONS corrected to the
correct Exceptions section title.
|
|
|
|
|
|
|
|
|
|
| |
* uwind.c (exception_subtype_map): New static function.
(uw_late_init): Register exception-subtype-map intrinsic
function.
* txr.1: Exception types are described in more detail.
A complete diagram of the existing hierarchyis given,
and the exception-subtype-map funtion is documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_exception): New static function.
(eval_error): Reduced to wrapper around eval_exception.
(eval_warn): New function.
(me_op): Bind the rest symbol in a shadowing env to suppress
watnings about unbound rest.
(do_expand): Throw a warning when a bindable symbol is
traversed that has no binding.
(expand): Don't install atoms as last_form_expanded.
* lib.c (warning_s, restart_s, continue_s): New symbol
variables.
(obj_init): Initialize new symbol variables.
* lib.h (warning_s, restart_s, continue_s): Declared.
* lisplib.c (except_set_entries): New entries for
ignwarn and macro-time-ignwarn.
* parser.c (repl_warning): New static function.
(repl): Use repl_warning function as a handler for
warning exceptions: to print their message and then
continue by throwing a continue exception.
* parser.y (warning_continue): New static function.
(parse_once): Use warning_continue to ignore warnings.
In other words, we suppress warnings from Lisp that is
mixed into TXR pattern language code, because this
produces too many false positives.
* share/txr/stdlib/except.tl (ignwarn, macro-time-ignwarn):
New macros.
* share/txr/stdlib/place.tl (call-update-expander,
call-clobber-expander, call-delete-expander): Ignore warnings
around calls to sys:expand, because of some gensym-related
false positives (we expand code into which we inserted some
gensyms, without having inserted the constructs which
bind them.
* tests/011/macros-2.txr: Suppress unbound variable
warnings from a test case.
* tests/012/ifa.tl: Bind unbound x y variables in one
test case.
* tests/012/struct.tl: Suppress unbound variable
warnings in some test cases.
* uwind.c (uw_throw): If a warning is unhandled, then
print its message with a "warning" prefix and then
throw a continue exception.
(uw_register_subtype): Eliminate the check for sub
already being a subtype of sup. This allows us to
officially register new types against t.
(uw_late_init): Register continue exception type as a
subtype of the restart type.
Formally register warning type.
* txr.1: Documented ignwarn.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch commit I'm addressing the issue introduced in
part 1 that expressions in @(output) blocks are still using
(sys:expr ...) wrapping, but are passed down to an evaluator
which now expects unwrapped expressions now.
As part of this change, I'm changing the representation of
@expr from (sys:expr . expr) to (sys:expr expr).
* eval.c (format_field): Adjust access to sys:expr
expression based on new representation.
(transform_op): Likewise.
* lib.c (obj_print_impl): Likewise.
* match.c (dest_bind): Likewise.
(do_txeval): Likewise.
(do_output_line): Likewise, in some compat code. Here is the
fix for the issue: when calling tx_subst_vars, we pass a list
of one element containing the expression, not wrapped in
sys:expr. Previously, we passed a one-element list containing
the sys:expr.
* parser.y (o_elem): If a list occurs in the syntax, represent
it as (sys:expr list) rather than (sys:expr . list).
(list): Do the same for @ n_expr syntax.
(expand_meta, make_expr): Harmonize with the representation
change.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The bug is that `@@@a` prints as `@@a` which
reads as a different object.
In this patch we simplify how quasiliterals are represented.
Embedded expressions are no longer (sys:expr E), just E.
Meta-numbers N and variables V are still (sys:var N).
However `@@a` and `@a` remain equivalent.
* eval.c (subst_vars): No need to look for expr_s;
just evaluate a compound form. The recursive nested
case is unnecessary and is removed.
(expand_quasi): Do nothandle expr_s; it is not
part of the quasi syntax any more.
* lib.c (out_quasi_str): Do not look for expr_s in the
quasi syntax; just print any expression with a @
the fallback case.
* match.c (tx_subst_vars): Analogous changes to those
done in subst_vars in eval.c.
* parser.y (quasi_meta_helper): Static function removed.
This was responsible for the issue due to stripping a
level of meta from expressions already having a meta
on them.
(quasi_item): In the `@` n_expr syntax case, no longer
call quasi_meta_helper. The remaining logic is simple
enough to put in line. Symbols and integers get wrapped
with (sys:var ...); other expressions are integrated
into the syntax as-is.
|
|
|
|
|
|
|
|
| |
* eval.c (do_expand): When a dohash special form is
expanded, a macro shadowing environment must be
created for the two variables that it binds and the
body must be expanded in that environment, to
protect the variables from symbol macros.
|
|
|
|
|
|
| |
* eval.c (do_expand): Do not expand into (sys:expr ...)
expressins, the same way (sys:var ...) expressions are
avoided. They are not forms.
|
|
|
|
|
|
| |
* share/txr/stdlib/socket.tl (sys:str-inaddr-net-impl):
Use let* so that calculation of we can see dependent w
variable.
|
|
|
|
|
|
|
|
|
|
| |
The test case is (op list . @rest) and similar, which were
expanding to a syntax containing an incorrect form like
[sys:apply list sys:var rest #:rest-0123] where the
sys:var rest are superfluous.
* eval.c (transform_op): Missing case: the code which handles
metas in the dot position must handle @rest not only @<number>.
|
|
|
|
|
|
| |
* eval.c (do_expand): If the form is (sys:var ...)
then skip it without expanding. Of course, that does
not preclude it form being a macro.
|
|
|
|
|
|
| |
* eval.c (me_op): When the operator is op, the arguments
must be expanded as Lisp-1 with expand_forms_lisp1, not
with the regular expand_forms.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (do_expand): When expanding the macro-time
form, do not macro-expand it entirely and then evaluate.
Rather, expand each argument form and evaluate.
This way earlier forms can make global definitions
which are used while macro-expanding later definitions.
* txr.1: Behavior documented.
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (test-inc): Expander
refers to unbound variable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The syntax of mac-param-bind forms isn't recognized at all in
the expander, causing these forms to be incorrectly expanded
as if they were function calls.
* eval.c (mac_param_bind_s): New symbol variable.
(do_expand): Handle mac_param_bind_s with the same block of
code as tree_bind_s, adjusted to account for the small
syntactic difference.
(eval_init): Initialize mac_param_bind_s with interned symbol.
Register operator using mac_param_bind_s to avoid redundant
intern call.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the function bodies of macrolets are themselves
being macro-expanded, this is incorrectly being done in
the original macro environment without taking into account
the macrolet parameters which those bodies have in scope.
Hence the parameters are not able to shadow symbol macros.
* eval.c (make_var_shadowing_env): Moved above expand_macrolet
so we can avoid adding a forward declaration. Otherwise
unchanged.
(expand_macrolet): For each macrolet function, create
a shadowing environment which contains its parameters,
and use that for expanding the body.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is about those Boolean parameters which indicate
whether their associated optional parameters are present: in
(lambda (: (opt-parm 42 opt-parm-p))), such a parameter is
opt-parm-p. When parameter lists are walked by the macro
expander, these parameters are not being included as shadow
entries in macro-time parameter lists. Thus if opt-parm-p
happens to shadow an outer symbol macro, that symbol macro
will be expanded anyway.
* eval.c (get_opt_param_syms): Function now lists those
additional parameters.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The backpatching of literal hash objects containing
circular notation labels is incorrect, because it
directly mutates the hash keys, without regard for
the fact that this alters their hash values.
This change makes the test case #1=#H(() (#1# #1#))
work properly: a hash which contains itself as a key
and corresponding value. When this object is constructed by
the reader, we can do a gethash call on it, using itself as
the key, and it emerges as the value. Before this fix,
nil would be returned indicating that the key is not found,
although it is listed in the table (corrupt hash).
* parser.c (circ_backpatch): When traversing a hash, local
list of the cells. Then clear the hash, iterate the list of
old cells, and re-insert the key-value pairs.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is needed for an upcoming bugfix, so why not expose it as
an intrinsic.
* hash.c (clearhash): New function.
(hash_init): clearhash intrinsic registered.
* hash.h (clearhash): Declared.
* txr.1: Documented clearhash.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (reg_mac): Static function changed to extern.
(me_defex, register_exception_subtypes): Static function
removed here; relocated into unwind.c.
(eval_init): Registrations of defex, throw, throwf, error,
register-exception-subtypes and exception-subtype-p removed.
* eval.h (reg_mac): Declared.
* unwind.c (me_defex, register_exception_subtypes): Static
function moved here.
(uw_late_init): Registrations of defex, throw, throwf, error,
register-exception-subtypes and exception-subtype-p moved
here.
|
|
|
|
| |
* txr.1: Mention support for OOP.
|
|
|
|
|
|
| |
* txr.1: Fix text saying that symbol-function retrieves
only functions; that is true for symbols, not for the
compound syntax.
|
|
|
|
|
|
| |
* txr.1: Grammar: to occurs -> to occur. Also any subforms
of a tagbody form may be go, not just one one form as the text
seems to be saying.
|
|
|
|
| |
* txr.1: Fix bad inline expression splitting.
|
|
|
|
|
|
|
|
|
| |
* configure (lexname, lexname_given, lex_given):
New variables.
(lex): interpolate lexname (in make syntax).
Inform about lexname in help text.
(gen_config_make): Generate lexname make var.
New lex test.
|
|
|
|
|
| |
* txr.1: Fix two instances of clause parameter being
typeset as .code rather than .meta.
|
|
|
|
| |
* txr.1: Missing article: *the* sys:capture-cont function.
|
|
|
|
|
| |
* txr.1: Fix .code *package* embedded in paragraph. Remove
stray words in code comment in package example.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* Makefile (conftest.darwin): New phony target.
* configure: Always do Darwin check via make conftest.darwin.
|
|
|
|
|
|
|
|
| |
* txr.c (txr_main): Implement -b option that takes an
argument. Ensure that -b produces an error if clumped with
other options.
* txr.1: Documented -b var=val.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TXR's build should use the values of standard make variables:
use the existing $(CC), $(CFLAGS), $(YACC), $(LDFLAGS) and
such.
* Makefile (TXR_CFLAGS): New variable. Initialized with the
value of $(CFLAGS) and then customized. Used everywhere
in place of CFLAGS.
(CFLAGS): Now used only as the initial value of TXR_CFLAGS; no
longer clobbered with the := assignment. Thus if a
distribution of free software builds everything with certain
CFLAGS, we incorporate those CFLAGS that it wants us to use.
(TXR_LDFLAGS): New variable, initialized from $(LDFLAGS).
Used in place of LDFLAGS.
(LDFLAGS): Use only, do not modify.
(NM): Replaced with TXR_NM.
(YACC): Replaced with TXR_YACC.
* configure (ccname): Default to $(CC) rather than gcc.
(lex): Default name portion $(LEX) rather than flex; keep
the optional prefixes.
(gen_config_make): Generate TXR_CC, TXR_LEX, TXR_YACC and
TXR_NM variables, rather than clobbering the standard ones
CC, LEX and YACC.
Also, in the rule that finds yacc, we now try '$(YACC)'
first.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/trace.tl (sys:trace): If symbol-function
returns nil, throw exception.
* txr.1: Document the behavior, along with return values
of trace and untrace, and the tolerance of untrace to
bad arguments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch we allow (symbol-function '(macro sym)),
(defun (macro sym) (form env) ...), and
(trace (macro sym)).
* eval.c (macro_s): New symbol variable.
(lookup_fun, func_get_name, op_defun): Support (macro sym)
syntax.
(builtin_reject_test): Pass through (macro sym) syntax.
(eval_init); Initialize macro_s.
* share/txr/stdlib/place.tl (sys:get-fun-getter-setter):
Support macro place.
* txr.1: Documented verything.
|
|
|
|
|
| |
* share/txr/stdlib/trace.tl (sys:*trace-hash*): Hash must be
equal-based to correctly support compound places.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All macros are function bindings now.
* eval.c (me_interp_macro): New function. Body is
a copy of block from expand_macro.
(op_defmacro): Hoist the me_interp_macro function into
the object domain, installing the macro material as the
environment. This function is the expander.
(expand_macro): Assume that the binding is a function
and call it. The cons case is gone.
(expand_macrolet): Similar change to the one in
op_defmacro: a macrolet is also a function.
* txr.1: Documentation under symbol-macro updated.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (mefun_t): Typedef removed.
(expand_macro): Test whether the binding is a function, rather
than C object, and call it with funcall2.
(reg_mac): Take a val argument for the expander function,
rather than a C function pointer, and just store that value
into the binding unconverted.
(eval_init): Insert a func_n2(...) call into all reg_mac calls
to hoist the C functions into the object domain.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_forms_ss): New static function:
like eval_forms but preserves shared substructure
along the spine of the list.
(expand_list_of_form_lists): Use expand_forms_ss
instead of expand_forms, taking the required hash
via a new parameter.
(expand_switch): Instantiate the required hash table
and pass down to expand_list_of_form_lists.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was exposed by causing an issue in the multi-pass
expansion strategy used in tagbody which shields macro forms
from a global macro using a local macro.
* eval.c (expand_progn): When calling constantp,
pass the macro environment, as required, rather than nil.
This was causing (go ...) forms in tagbody to be expanded
in the global environment using the global go macro
which unconditionally throws an error about an undefined
label, rather than using the harmless local go macrolet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a "disciplined goto" feature of Common Lisp.
This uses a new sys:switch operator, which could
also be used for optimizing case and cond forms.
* eval.c (switch_s): New symbol variable.
(op_switch, expand_list_of_form_lists, expand_switch):
New static functions.
(do_expand): Hook in the expansion of the sys:switch
operator.
(eval_init): Initialize switch_s special variable to
sys:switch symbol. Register sys:switch special op.
* lisplib.c (tagbody_set_entries, tagbody_instantiate): New
static functions.
(lisplib_init): Register autoloading of tagbody module
via new functions.
* share/txr/stdlib/tagbody.tl: New file.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (find_symbol): New function.
(symbol_present): Search the fallback list also to
determine whether the symbol is visible.
* lib.h (find_symbol): Declared.
* parser.y (sym_helper): Implement a new behavior for
qualified symbols. Interning new symbols is only allowed
for packages that have an empty fallback list.
* parser.c (get_visible_syms): New static function.
(find_matching_syms): Use get_visible_syms to get
the list of eligible symbols. This way the fallback list
of the package is included if it is the current package.
* share/txr/stdlib/package.tl (defpackage): Do not insert
a default (:use usr) if there is no :usr clause. Since
defpackage is very new, no need for backward compatibility;
the amount of code depending on this is likely zero.
* txr.1: Documented fallback list feature.
|