| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated.
* txr.vim: Handle : symbol properly.
* eval.c (op_defun): Bugfix: documentation says that defun supports
the same parameter list as lambda, and that is the intent. But
this was broken, since op_defun was expecting the parameter list
to be a proper list containing only bindable symbols, ruling out
the use of the consing dot for rest parameter as well as the colon
keyword symbol for optional parmeters.
|
| |
|
|
|
|
| |
and highlighting of errors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(eval_error): nostatic added to suppress a g++ warning.
(dwim_loc): Takes new value as the original unevaluated form so
it can control evaluation. Support for del operator added.
(op_modplace): Bugfixes: new value form was being unconditionally
evaluated and out of order w.r.t. other forms. Now there is
left to right order. The form is evaluated later, since for most
operators it is on the right, with the exception of push.
dwim places can now optionally control the evaluation of newform.
del operator supported in gethash case as a special case.
error case added for del: if it's not handled in gethash or
dwim_loc, it is an error.
(eval_init): del_s initialized, and del operator added to table.
* txr.vim: syntax highlighting for del.
* txr.1: Documented del.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and replace.
* lib.c (do_sort): Static function renamed to sort_list.
(swap, quicksort, sort_vec): New static functions.
(sort): Made generic over lists, vectors and strings.
(refset): New function.
* lib.h (sort): Declaration updated (parameter name change).
(refset): Declared.
* txr.1: Mention refset.
* txr.vim: Updated with refset.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* debug.c (help, show_bindings): put_string arguments reversed.
* eval.c (bind_args): Support colon notation in interpreted
function lambda lists for optional arguments. Improved error checking.
(apply): Allow optional arguments to be left out.
(dwim_loc): Reversed arguments to replace_str, replace_vec,
replace_list.
(eval_init): Numerous intrinsics now have arguments that are optional.
New function rand introduced which reverses arguments relative to
random. New intrinsic function hash introduced for alternative
construction of hashes.
* gc.c (sweep): Reversed arguments to put_char.
* hash.c (weak_keys_k, weak_vals_k, equal_based_k): New keyword
symbol variables.
(hashv): New function.
(hash_init): Intern new symbols.
* hash.h (weak_keys_k, weak_vals_k, equal_based_k, hashv): Declared.
* lib.c (colon_k): New keyword symbol variable.
(replace_list, replace_str, replace_vec): Arguments rearranged.
(tree_find): testfun becomes optional argument.
(int_str): base becomes optional argument.
(func_f0, func_f1, func_f2, func_f3, func_f4, func_n0,
func_n1, func_n2, func_n3, func_n4, func_f0v, func_f1v,
func_f2v, func_f3v, func_f4v, func_n0v, func_n1v,
func_n2v, func_n3v, func_n4v, func_interp): Initialize optargs to zero.
(func_n0o, func_n1o, func_n2o, func_n3o, func_n4o): New functions.
(cobj_print_op): Reversed arguments to put_string.
(find): testfun and keyfun become optional arguments.
(replace): Parameters rearranged and arguments rearranged in calls to
replace_list, replace_str and replace_vec.
(obj_init): colon_k initialized.
(obj_print, obj_pprint): Arguments reversed, and stream defaults
to std_output. Arguments reversed in calls to put_char and put_string.
(dump): Arguments reversed in call to put_char.
* lib.h (struct func): sizes of minparam, fixparam bitfields
adjusted. New bitfield optargs. New unnamed bitfield added so
the previous ones add up to 16 bits.
(colon_k): Declared.
(func_n0o, func_n1o, func_n2o, func_n3o, func_n4o): Declared.
(replace_list, replace_str, replace_vec, replace): Declarations updated.
* match.c (debuglf, dump_shell_string, dump_byte_string, dump_var,
do_output_line, extract): Reversed arguments to put_char and
|
|
|
|
|
|
|
|
|
|
| |
* lib.h (sub, ref, replace): Declared.
* match.c (format_field): Generic indexing using new functions.
* txr.1: Documentation stub.
* txr.vim: Highlighting for new functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (subst_vars): Treat the variable as an arbitrary
expression rather than just a symbol.
* match.c (subst_vars): Likewise.
* parser.y (o_var): Further simplification. The first item in
an output var is an expr and not an IDENT.
* txr.1: Updated.
* txr.vim: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (v_do): Store match context.
(match_fun): New function.
* match.h (match_fun): Declared.
* stream.c (streamp): New function.
* stream.h (streamp): Declared.
* txr.1: Stub section for match-fun.
* txr.vim: Highlight match-fun.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (op_catch, expand_catch_clause,
expand_catch): New static functions.
(expand): Handle catch operator.
(eval_init): Added catch operator to op_table,
and registered new functions throw, throwf and error.
* txr.1: Documented catch operator and created
stub section for throw, throwf and error.
* txr.vim: Updated.
* unwind.c (uw_throwfv, uw_errorfv): New functions.
* unwind.h (uw_throwfv, uw_errorfv): Declared.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
but the step is omitted, the step should be negative one
rather than one.
(range_star_v_func, range_star_v): New static functions.
(eval_init): New function, range*, registered.
* txr.1: Stub section for range is also for range*.
* txr.vim: Recognize range* function.
|
|
|
|
|
|
|
|
|
|
|
|
| |
in sys::var form) as variables. This allows interpretation of metanums
in quasiliterals, because these are replaced by variables in the
op expander.
* parser.l: Recognize METANUM in QSILIT state.
* parser.y (quasi_item): METANUM parsed in quasiliteral.
* txr.vim: Metanums highlighted properly.
|
|
|
|
|
|
| |
* txr.vim: Fixed mistakes in a few regex character classes,
causing upper case letters not to be recognized as part
of a variable name, and character hex constant.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(do_eval_args): Allow calls specified by improper lists
like (x y . z) where the z expression must evaluate to a list
that turns into addition arguments to be applied.
(transform_op, expand_op): New static functions.
(expand): Call expand_op.
(eval_init): Initialize rest_s and op_s. Use rest_s
to register rest function.
* lib.c (gensym): New function based on gensymv.
(gensymv): Now calls gensym.
* lib.h (gensym): Declared.
* parser.l: Parse @ followed by digits as a new kind of token,
METANUM.
* parser.y (METANUM): New token.
(meta_expr, exprs): Missing rlcp's added.
(expr): METANUM variant introduced.
(yybadtoken): Handle METANUM.
* txr.1: Documented one-symbol argument list of lambda.
Documented op. Closed some unbalanced parentheses.
* txr.vim: Highlight op.
|
|
|
|
| |
Comment are colorized properly again.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (dwim_loc): Assignments to string indices and ranges
supported. New arguments for this purpose.
(op_modplace): Use new dwim_loc interface for returned value.
(op_dwim): Support assignment to string ranges.
(eval_init): replace_str registered.
* lib.c (string_extend): If the argument is a number, let it
specify the amount by which to extend the string.
(replace_str): New function.
* lib.h (replace_str): Declared.
* txr.1: Updated.
* txr.vim: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (sub_list, replace_list, vectorp): New functions.
(sub_vec): Allow negative indices from end of array.
(replace_vec): New function.
* lib.h (sub_list, replace_list, vectorp, replace_vec): Declared.
* parser.l (DOTDOT): Scan .. as new token.
* parser.y (DOTDOT): New token.
(expr): New syntax with DOTDOT.
(yybadtoken): Handle DOTDOT.
* txr.vim: Added new functions. Also missing append* and dwim.
* txr.1: Updated.
|
|
|
|
| |
like #\newline.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(dwim_loc, op_dwim): New static functions.
(op_modplace): Support assignment to dwim forms
with the help of dwim_loc.
(expand_place): Handle dwim places.
(eval_init): Initialize dwim_s. Register dwim operator
in op_table.
* eval.h (dwim_s): Declared.
* lib.c (chr_str, chr_str_set): Allow negative indices to index
backwards from end of string.
(vecref, vecref_l): Allow negative indices to index from
rear of array.
(obj_print, obj_pprint): Render (dwim ...) forms as [...].
* parser.l: Peoduce new METABKT token type for @[,
and '[', ']' tokens.
* parser.y (METABKT): New token. %type declaration for '['.
(list): Support square-bracket style of list, translated
into dwim form.
(meta_expr): Support @[...] variant.
(yybadtoken): Handle METABKT in switch.
* txr.1: Documented [...] syntax and dwim operator.
* txr.vim: Updated.
|
|
|
|
|
|
|
|
|
|
|
| |
New symbol variables.
(op_each): New static function.
(expand): Handle the four new operators.
(eval_init): Intern new symbols, register new operators.
* txr.1: Documented each, each*, collect-each and collect-each*.
* txr.vim: Updated.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (list_str): New function.
* lib.h (list_str): Declared.
* txr.1: Doc stub section created.
* txr.vim: Updated.
|
|
|
|
|
|
|
|
| |
(eval_init): New functions registered.
* txr.1: Stub sections created.
* txr.vim: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (prog1_s, gen_s, generate_s, delay_s, promise_s): New symbol
variables.
(eval_prog1, op_prog1, expand_gen, expand_delay): New static functions.
(expand): Handle gen and delay.
(lazy_mapcar_func, lazy_mapcar, lazy_mapcarv_func, lazy_mapcarv,
lazy_mappendv): New static functions.
(rangev_func, rangev, generate_func, generate, repeat_infinite_func,
repeat_times_func, repeatv, force): New static functions.
(eval_init): New operators and functions interned.
lazy-flatten renamed to flatten*.
* lib.c (null_f): New global variable.
(ltail, lazy_appendv): New functions.
(lazy_appendv_func): New static function.
(obj_init): null_f protected and initialized.
* lib.h (null_f, ltail, lazy_appendv): Declared.
* txr.1: Documented.
* txr.vim: Updated.
|
| |
|
|
|
|
| |
* txr.vim: Updated with numerous missing symbols.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Use new symbol variable mod_s instead
of calling intern.
* match.c (mod_s, modlast_s): Symbol variables defined.
(do_output_line): mod and modlast directives implemented under rep.
(do_output): likewise under repeat.
(syms_init): Initialize new symbol variables.
* match.h (mod_s, modlast_s): Declared.
* parser.l (MOD, MODLAST): Parse new token types.
* parser.y (MOD, MODLAST): New tokens.
(repeat_parts_opt, rep_parts_opt): New syntax.
(repeat_rep_helper): Handle mod and modlast syntax.
* txr.1: Updated.
* txr.vim: Updated.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
can now be used. Within nested forms,
Lisp-compatible ; comments are suported.
* parser.l: Support @# and ; comments.
* txr.1: Documentation updated.
* txr.vim: Updated.
|
| |
|
|
|
|
| |
properly and highlighted.
|
| |
|
| |
|
|
|
|
| |
* txr.vim: More highlighting.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (op_let): Bugfix: was not evaluating var init forms.
(reg_var): New static function.
(eval_init): Registered numerous stream functions and the
three standard streams.
* lib.c (obj_print, obj_pprint): Modified to return a value.
(init): eval_init called after stream_init, because eval
needs the three standrad streams prepared.
* lib.h (obj_print, obj_pprint): Declarations updated.
* stream.c (format): Support t as a shorthand for standard output.
(formatv, open_directory, open_file, open_pipe): New functions.
(w_opendir): New static function.
* stream.h (formatv, open_directory, open_file, open_pipe):
Declared.
* txr.vim: set iskeyword such that keyword can contain special
characters. Set b:current_syntax to "lisp".
(txl_keyword): New keyword category populated with TXR Lisp keywords
defined as separate category.
(txr_list): Contains txl_keyword.
(txr_meta): Contains txl_keyword and txr_list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lisp interpreter added.
* gc.c (finalize, mark_obj): Handle ENV objects.
* hash.c (struct hash): acons_new_l_fun function
pointer order of arguments change.
(equal_hash): Handle ENV.
(make_hash, gethash_l): Use cobj_handle for
type safety. Follow change in acons_new_l.
(gethash, gethash_f, remhash, hash_count,
hash_get_userdata, hash_set_userdata, hash_next): Use cobj_handle.
(gethash_n): New function.
* hash.h (gethash_n): Declared.
* lib.c (env_s): New symbol variable.
(code2type, equal): Handle ENV. (plusv, minusv, mul, mulv, trunc, mod,
gtv, ltv, gev, lev, maxv, minv, int_str): New functions.
(rehome_sym): New static function.
(func_f0, func_f1, func_f2, func_f3, func_f4, func_n0, func_n1,
func_n2, func_n3, func_n4): Initialize new fields of struct func.
(func_f0v, func_f1v, func_f2v, func_f3v, func_f4v,
func_n0v, func_n1v, func_n2v, func_n3v, func_n4v,
func_interp): New functions.
(apply): Function removed: sanely re-implemented in new eval.c file.
(funcall, funcall1, funcall2, funcall3, funcall4): Handle
variadic and interpreted functions.
(acons, acons_new, acons_new_l, aconsq_new, aconsq_new_l): Reordered
arguments for compatibility with Common Lisp acons.
(obj_init): Special hack to prepare hash_s symbol, which is
needed for type checking inside the hash table funtions invoked
by make_package, at a time when the symbol is not yet interned.
Initialize new env_s variable.
(obj_print, obj_pprint): Handle ENV. Fix confusing rendering of
of function type.
(init): Call new function eval_init.
* lib.h (enum type): New enumeration member ENV.
(struct func): functype member changed to bitfield.
New bitfied members minparam and variadic.
New members in f union: f0v, f1v, f2v, f3v,
f4v, n0v, n1v, n2v, n3v, n4v.
(struct env): New type.
(union obj): New member e of type struct env.
(env_s): Variable declared.
(plusv, minusv, mul, mulv, trunc, mod, gtv, ltv, gev, lev, maxv, minv,
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (gather_s): New keyword variable.
(v_gather): New function.
(syms_init): gather_s initialized.
(dir_tables_init): v_gather entered into table.
* match.h (gather_s): Declared.
* parser.l: GATHER token scanning added.
* parser.y: GATHER token added. gather_clause nonterminal added.
* txr.1: New directive documented.
* txr.vim: gather keyword introduced.
|
| |
|
| |
|
|
|
|
| |
Also, highlight embedded metalists as regions.
|
| |
|
| |
|
|
* txr.vim: New file.
|