| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The hash bang mechanism is handled in one place,
and disentangled from all parsing logic.
It is also endowed with special powers.
* eval.c (load): Pass one less argument to read_eval_stream.
* match.c (v_load): Likewise.
* parser.c (read_eval_stream): hash_bang_support Boolean
argument removed. Hash bang logic removed.
(load_rcfile): Pass only two arguments to read_eval_stream.
* parser.h (read_eval_stream): Declaration updated.
* txr.c (remove_hash_bang_line): Function removed.
(check_hash_bang): New static function.
(txr_main): Recognize the script file name while still
inside the argument processing loop. Open the file,
and check for a hash bang line, doing the special
processing which can generate more arguments from material
after a null byte in the hash bang line. The parse_stream
variable is now initialized to nil and doubles as a Boolean
indicating whether a stream has been opened. After the
loop, we remove the script file from the arguments, if we
have an open stream and the spec_file_str matches.
read_eval_stream is called only with two arguments.
* txr.1: Revised existing documentation and described
new features.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The --eargs mechanism won't perform a blind substring
replacement of {} with the following argument. Only
arguments which match {} exactly are replaced.
* eval.c (retf): Static function becomes extern.
* eval.h (retf): Declared.
* txr.c (txr_main): Replace the filtering logic on the
split eargs argument list to just look for items
equal to the string "{}" and replace with the following
argument.
* txr.1: Updated --eargs documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CPTR shares representation and a lot of implementation with
COBJ. The COBJ class symbol is the CPTR type tag. There is no
hierarchy among CPTR tags. The nil tag is used for a modicum
of type looseness, so that we don't straitjacket ourselves
too much into this tag-based typing scheme.
All existing cptr objects are becoming CPTR, and all
get a nil tag, except for dlopen library handles, and
dlsym symbols, which are tagged as dlhandle and dlsym.
The FFI framework will support tag-declared cptr's. This will
help with safety. For instance, suppose an API has half a
dozen different kinds of opaque handles. If they are all just
cptr on the TXR Lisp side, it's easy to mix them up, passing
the wrong one to the wrong C function.
* lib.h (enum type): New enum member, CPTR.
(cptr_print_op, cptr_typed, cptrp, cptr_type, cptr_handle):
Declared.
(cptr_addr_of): Parameters added.
* lib.c (code2type): Map CPTR type code to cptr_s.
(equal): Handle CPTR objects. They are only equal to other
CPTR objects which have the same operations, and
are equal under the equal function of those operations.
(cptr_print_op): New function.
(cptr_ops): Use cptr_print_op rather than cobj_print_op.
(cptr_typed): New function.
(cptr): Use cptr_typed to make a cptr with tag nil,
rather than using cobj.
(cptrp, cptr_handle, cptr_type): New functions.
(cptr_get): Go through cptr_handle rather than cobj_handle.
(cptr_addr_of, cptr_zap, cptr_free): Use call to cptr_handle
rather than cobj_handle for the type checking side effect.
New parameters for type and parent function name.
(obj_print_impl): Handle CPTR with same case as COBJ.
* gc.c (finalize, mark_obj): Handle CPTR cases using
common code with COBJ.
* hash.c (equal_hash): Handle CPTR just like COBJ.
* eval.c (eval_init): Register cptrp and cptr-type intrinsic
functions.
* ffi.c (ffi_cptr_put, ffi_cptr_get, ffi_cptr_alloc): Use the
potentially type-safe cptr_handle, instead of cptr_get.
However, for an untagged cptr, there is no type safety because
tft->mtypes is nil. The argument can be any kind of cptr.
* sysif.c (dlhandle_s, dlsym_s): New symbol variables.
(cptr_dl_ops): Use cptr_print_op.
(dlopen_wrap, dlclose_wrap): Use typed cptr with
dlhandle as the type.
(dlsym_wrap, dlsym_checked, dlvsym_wrap, dlvsym_checked):
Recognize only a cptr of type dlhandle for the library.
Construct a typed cptr of type dlsym.
(sysif_init): Initialize dlhandle_s and dlsym_s.
Register dlsym function using dlsym_s.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register cptr-int, ctpr-obj, cptr-zap
and cptr-free functions and cptr-null variable.
* lib.c (cptr_int, cptr_obj, cptr_zap, cptr_free): New
functions.
* lib.c (cptr_int, cptr_obj, cptr_zap, cptr_free): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These three forms are not being traversed properly by the
macro expander.
* eval.c (do_expand): Do not treat return-from,
sys:abscond-from and block* in the same case as block.
block* evaluates all of its forms and so can just be walked
as a function call in the fallback case. The other two
must be in their own case because we must not use
expand_progn on them; they do not evaluate a progn-like
list of forms. This leads to inappropriate optimizations
like (return-from x (progn a b c)) -> (return-from x a b c).
|
|
|
|
|
|
|
| |
* eval.c (builtin_reject_test): Issue warnings rather than
errors when built-in macros, functions or operators are
redefined. For now, we don't provide any way to suppress the
warning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The @{a [3]} syntax in quasiliterals and @(output) now
indexes into the original object a if it is any sequence
kind, not specifically a list. Otherwise it indexes into
its string representation.
* eval.c (format_field): Combine the elements of the
object with the separator if it is any sequence type other
than a string. Subject to compat option.
(subst_vars): Avoid converting any kind of sequence to
string, rather than just lists. After any field formatting
is applied, if the object is any sequence (not just alist),
combine the elements with a space. All subect to compat
option.
* match.c (tx_subst_vars): Same treatment as subst_vars.
* txr.1: Compatibility notes added.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register intrinsic functions
time-parse-local and time-parse-utc.
* lib.c (strptime_wrap): New static function.
(time_parse): Now implemented as by call to strptime_wrap.
(time_parse_local, time_parse_utc): New functions.
These get the time_t time from struct tm without
constructing the intermediate Lisp structure.
* lib.h (time_parse_local, time_parse_utc): Declared.
* txr.1: Documented new functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions don't conform with the documentation. For
instance [apply list "abc"] yields "abc". It is supposed to
yield (#\a #\b #\c), since the characters of "abc" must become
individual arguments to list. Part of the fix is in the
apply_frob_args logic; however, we have to clone that function
because it is used for implementing other things which
will break: we cannot, for for example, have (list* 1 "ab")
producing (1 #\a #\b).
* eval.c (apply_intrisic_frob_args): New static function.
Differs from apply_frob_args in that it calls tolist
on the final element.
(apply_intrinsic): Use apply_intrinsic_frob_args
instead of apply_frob_args.
(iapply): Invoke tolist on the value assigned to last_arg.
* txr.1: Add a clarifying note for iapply that the terminating
atom is not split into arguments if it is a sequence.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_opip): Just like dwim forms are left
untransformed, we also leave untransformed (uref ...) and
(qref ...) forms. Otherwise they get wrapped in the (do ...)
syntax and don't work right. This treatment is so
broken/useless that no compatibility switch is needed here.
* txr.1: Documentation for opip/oand updated.
|
|
|
|
|
|
| |
* eval.c (expand_lisp1): if the form is an atom that
is not a bindable symbol, just return it; don't wastefully
call into expand which has to save and restore some context.
|
|
|
|
|
|
|
|
|
|
|
| |
DWIM expressions like [a b c] are not raising expansion-time
warnings about a, b, c being unbound.
* eval.c (expand_lisp1): The problem is that here we just
return in the case that the symbol is bindable and has no
macro expansion! Before returning, we must check whether
the symbol has a binding in the variable or function space.
If not, raise a warning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register *package-alist* variable,
taking on the contents of the packages variable.
* lib.c (package_alist_s): New symbol variable.
(make_package, packagep, find_package, package_alist); Work
with dynamic package alist variable via cur_package_alist_loc
macro.
(get_current_package_alist_loc): New function.
* lib.h (cur_package_alist_loc): New macro.
(packages, package_alist_s, get_current_package_alist_loc):
Declared.
* txr.1: Documented *package-alist* along with notes about
sandboxing. Documented that the package-alist function is
now obsolescent.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.h (default_bool_arg): Inline function renamed to
default_null_arg.
* eval.c (if_fun, pad, ginterate, giterate, range_star, range,
constantp, macroexpand_1, macro_form_p, expand_with_free_refs,
do_expand, eval_intrinsic, func_get_name, make_env_intrinsic):
Follow rename.
* arith.c (lognot): Likewise.
* gc.c (gc_finalize): Likewise.
* glob.c (glob_wrap): Likewise.
* hash.c (group_reduce, gethash_n): Likewise.
* lib.c (print, multi_sort, lazy_str, vector, iff, tok_str,
split_str_keep, search_str, remove_if, val): Likewise.
* match.c (match_fun): Likewise.
* parser.c (lisp_parse_impl, regex_parse): Likewise.
* rand.c (make_random_state): Likewise.
* regex.c (read_until_match, search_regex, regex_compile):
Likewise.
* socket.c (sock_accept, sock_connect): Likewise.
* stream.c (open_files_star, open_files, run, open_process,
open_tail, get_string, record_adapter): Likewise.
* struct.c (static_slot_ensure, static_slot_ens_rec,
clear_struct, make_struct_type): Likewise.
* sysif.c (exec_wrap, errno_wrap, cobj_ops_init): Likewise.
* unwind.c (uw_capture_cont, uw_find_frames_impl): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tracing module should warn when traced functions or
methods are being redefined, and stop tracing the original
methods.
* eval.c (trace_check): New function. Calls
sys:trace-redefined-check if the trace module has been
loaded, otherwise does nothing.
(op_defun, op_defmacro): Call trace_check to have a warning
issued for a redefined traced function or macro.
* eval.h (trace_check): Declared.
* lisplib.c (trace_loaded): New global variable.
(trace_instantiate): Flip trace_loaded to t.
* lisplib.h (trace_loaded): Declared.
* share/txr/stdlib/trace.tl (sys:trace-redefine-check): New
function. Checks two situations: traced function or method
is redefined (neither old nor new is traced any longer),
and traced method is overridden (base method continues to be
traced, override is not traced).
* struct.c (static_slot_ensure): Do a trace check here,
taking care of defmeth.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (trunc1, trunc, floorf, ceili):
Add missing nao terminator to uw_throwf calls.
* debug.c (debug): Missing nao terminator in format call.
* eval.c (expand_opt_params_rec, me_equot): Missing nao
terminator in eval_error call.
* lib.c (use_sym): Missing nao in uw_throw call.
* regex.c (reg_derivative): Missing nao in uw_throwf.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register starts-with and ends-with
intrinsics.
* lib.c (starts_with, ends_with): New functions.
* lib.c (starts_with, ends_with): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register rmismatch intrinsic.
* lib.c (rmismatch): New function.
* lib.h (rmismatch): Declared.
* txr.1: Documented
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Update registration of match-fun.
* match.c (match_fun): Do defaulting on third and fourth arg.
* txr.1: Documenation updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now it is possible to use a leading dot on the referencing
dot syntax. This is the is the "unbound reference dot". It
expands to the uref macro, which denotes an unbound-reference:
it produces a function which takes an object as the argument,
and curries the reference implied by the remaining arguments.
* eval.c (uref_s): New global symbol variable.
(eval_init): Intern uref symbol and init uref_s.
* eval.h (uref_s): Declared.
* lib.c (simple_qref_args_p): A qref expression is now
also not simple if it contains an embedded uref, meaning
that it cannot be rendered into the dot notation without
ambiguity.
(obj_print_impl): Support printing (uref a b c) as .a.b.c.
* lisplib.c (struct_set_entries): Add uref to the list of
autoload triggers for struct.tl.
* parser.l (DOTDOT): Consume any leading whitespace as part
of recognizing the DOTDOT token. Otherwise the new rule
for UREFDOT, which matches (mandatory) leading space
will take precedence, causing " .." to be scanned wrong.
(UREFDOT): Rule for new kind of dot token, which is
preceded by mandatory whitespace, and isn't consing
dot (which has mandatory trailing whitespace too,
matched by an earlier rule).
* parser.y (UREFDOT): New token type.
(i_dot_expr, n_dot_expr): New grammar rules.
(list): Handle a leading dot on the first element of a list as
a special case. Things are done this way because trying to
work a UREFDOT into the grammar otherwise causes intractable
conflicts.
(i_expr): The ^, ' and , punctuators are now followed by
an i_dot_expr, so that the expression can be an unbound
dot.
(n_expr): Same change as in i_expr, but using n_dot_expr.
Plus new UREFDOT n_expr production.
* share/txr/stdlib/struct.tl (uref): New macro.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (trunc_rem): Move function to below round function.
Make second argument optional, defaulting to one.
(floor_rem, ceil_rem, round_rem): New functions.
* eval.c (eval_init): Registration of trunc-rem altered for
optional argument. New registrations for floor-rem, ceil-rem,
round=rem.
* txr.1: Documented for new functions folded with trunc-rem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (trunc1): New static function.
(trunc): Detect a missing second argument and call func1.
* eval.c (eval_init): Update registration of trunc
intrinsic to make second arg optional.
* txr.1: Describe optional argument of trunc. Trunc documentation
is merged with the floor, ceil and round section.
The mod and trunc-rem functions are split off into their own
sections, leaving the / function described by itself.
The documentation of / is substantially revised.
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (round1): New static function.
(roundiv): New function.
* configure: New test for C99 round function.
* eval.c (eval_init): Register round intrinsic.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also, with one argument, these functions handle
ranges.
* arith.c (floordiv, ceildiv): New functions.
(floorf, ceili): Handle ranges.
* eval.c (eval_init): Register floor and ceil
to new functions.
* lib.h (floordiv, ceildiv): Declared.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register rassoc and rassql intrinsics.
* lib.c (rassoc, rassql): New functions.
* lib.h (rassoc, rassql): Declared.
* txr.1: Documented rassoc and rassql, with small fixes
to assql and assoc.
|
|
|
|
|
|
|
| |
* eval.c (make_env, copy_env): Assign to vbindings, then to
fbindings. The members are in that order and elsewhere,
wherever we treat both bindings, we treat the variables
first.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Deferrable warnings now get their own subtype, defr-warning.
The tag is a regular argument: no funny dotted argument list.
* eval.c (eval_defr_warn): Throw new style deferrable warning.
(me_op, no_warn_expand): Catch defr-warning rather than
warning. Use uw_muffle_warning to suppress it.
(gather_free_refs): Parse new representation of deferrable
warning.
(expand_with_free_refs): Catch defr-warning rather than
warning.
* lib.c (defr_warning_s): New symbol variable defined.
(obj_init): Initialize defr_warning_s.
* lib.h (defr_warning_s): Declared.
* share/txr/stdlib/error.tl (compile-defr-warning): Throw
new-style deferrable warning.
* unwind.c (uw_muffle_deferrable_warning): Function removed.
(uw_throw): Bugfix: handle warnings by checking by subtype
rather than exactly for the warning type. Distinguish
deferrable warnings by subtype rather than argument list
shape.
(uw_defer_warning): Take the new style args and reconstruct
the (msg . tag) representation for a deferred warning, so
the other functions don't have to change.
(uw_late_init): Register defr-warning as exception subtype
of warning.
* unwind.h (uw_muffle_deferrable_warning): Decl removed.
* txr.1: Adjusted all documentation touching on the subject
of the representation of deferrable warnings.
|
|
|
|
|
| |
* eval.c (expand_with_free_refs): Properly handle
defaulting of the two optional arguments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We should be re-throwing deferred warnings as ordinary
warnings, not dumping them to a stream.
* eval.c (eval_exception): Use uw_release_deferred_warnings
instead of uw_dupm_deferred_warnings.
(load): Likewise.
* parser.c (read_eval_ret_last): Likewise.
* txr.c (txr_main): Likewise.
* unwind.c (uw_release_deferred_warnings): New function.
* unwind.h (uw_release_deferred_warnings): Declared.
* txr.1: Documented release-deferred-warnings and updated
documentation for dump-deferred-warnings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function's return list now has two additional elements.
The first two elements give, respectively, the free variables
and functions which occur in the form: variables and functions
which have no lexical binding. As before, these lists omit the
variables which do have bindings in the specified environment
that is passed as an argument.
The two new elements give, respectively, all variable and
function references emanating out of the form, regardless of
whether they have bindings in the form's surrounding lexical
environment or whether they are free.
The function also takes a new argument: an additional
environment beyond which the erasure of bindings doesn't take
place.
* eval.c (squash_menv_deleting_range): New static
function.
(gather_free_refs): Do not intercept non-deferrable warnings.
(gather_free_refs_nw): New static function.
(expand_with_free_refs): Expand the form twice, the second
time with a collapsed environment which has been stripped
of all macros and of all var shadowing entries in a specified
range, using the squash_menv_deleting_range function.
The second pass yields the extra variables and functions.
Also take a second env argument for this purpose.
(eval_init): Register sys:expand-with-free-refs as a three
argument function with one optional argument.
|
|
|
|
|
|
|
|
| |
* eval.c (do_expand): The previous commit exposes this
false warning. Basically, the (sys:var <sym>) place
expander generates a (sys:setq (sys:var <sym>) <val>)
form. That is valid, and the expander shoud not warn
that sys:var form is an unbound variable.
|
|
|
|
|
| |
* eval.c (me_op): Switch from uw_muffle_warning
to uw_muffle_deferrable_warning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is that if some macrology is performing its own
expansion with sys:expand, and if all warnings are muffled in
sys:expand, it means that some warnings will never be seen.
Expansion is the last chance to produce warnings issued by
macros. Once they are expanded, a redundant expansion pass
won't issue the warnings any more.
* eval.c (no_warn_expand); Use the
uw_muffle_deferrable_warning handler isntead of
uw_muffle_warnings.
* unwind.c (uw_muffle_deferrable_warning): New function.
* unwind.h (uw_muffle_deferrable_warning): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This interface to the expander returns not only the expanded
form, but also a list of the free variables and functions
occurring in that form.
This interface to the expander works by installing a handler
which intercepts and muffles warnings. When a warning occurs
indicating an unbound variable or function, the information is
retained. The expander then returns the information along
with the expanded form.
* eval.c (gather_free_refs): New static function.
(expand_with_free_refs): New function.
(eval_init): Register sys:expand-with-free-refs intrinsic.
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register rlcp-tree intrinsic.
* txr.1: Documented rlcp-tree. Also documented that rlcp
doesn't overwrite location info.
|
|
|
|
|
| |
* eval.c (error_trace): Wrong variable was checked as basis
for selecting one of two variants of diagnostic.
|
|
|
|
|
|
|
|
| |
* eval.c (eval-exception): Call uw_dump_deferred_warnings
before throwing exception. The warnings could provide valuable
clues about the cause of the error.
* share/txr/stdlib/error.tl (compile-error): Likewise.
|
|
|
|
|
|
|
| |
* eval.c (expand_setqf): New static function.
(do_expand): Handle sys:setqf via new function, which
avoids expanding the symbol, checks that it isn't
a lexical function, and warns about an unbound function.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_lisp1_setq): New static function.
(op_setqf): Check that the function binding which was
found is the global one. If not, throw an error that lexical
functions can't be mutated.
(do_expand): Handle sys:lisp1-setq operator expansion
seprately from the other setq operators, via the new function,
which enforces an expansion-time check against mutation
of lexical functions.
|
|
|
|
|
| |
* eval.c (do_expand): Throw an error if the destination
is a symbol macro which requires expanding.
|
|
|
|
|
| |
* eval.c (expand_lisp1_value): If the first argument is an
object other than a bindable symbol, throw an error.
|
|
|
|
|
|
|
| |
* eval.c (op_lisp1_setq, op_lisp1_value): If a Lisp-1 binding
is not found, this is because it is neither a function nor
variable, not because it is not a variable. The error message
now reflects this.
|
|
|
|
|
| |
* eval.c (eval_init): Register sys:expand-params intrinsic
bound to expand_params.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This issue was fixed in quasiliterals only. Because of the
implementation duplicity between output vars and quasiliteral
vars, we have to fix it in two places.
When the parser handles quasiliterals, it builds vars without
expanding the contents. The quasiliteral expander takes care
of recognzing (sys:var ...) forms and properly handles them
and their attributes, avoiding expanding the argument of
a :filter keyword.
When the parser handles an o_var that is a braced variable,
it calls expand on its contents right there, then builds the
(sys:var ...) form from the expanded contents.
Why don't we just call expand_quasi in the o_var rule to have
a single (sys:var ...) form expanded exactly how it is
done in quasiliterals.
* eval.c (expand_quasi): Change static function to external.
* eval.c (expand_quasi): Declared.
* parser.y (o_var): Construct an unexpanded (sys:var ...)
form, and then wrap it in a one-element list. This is a
de-facto quasi-items list, which can be expanded by
expand_quasi. Then we pull the car of the expansion to
get our expanded var.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register plist-to-alist and
improper-plist-to-alist intrinsics.
* txr.1: Documented improper plist concept and new
functions.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|