summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* * tests/011/macros-2.txr: Added test for labels shadowing macro,Kaz Kylheku2014-07-104-138/+160
| | | | | | | | and let shadowing symacro. * tests/011/macros-2.expected: Regenerated * txr.vim: Regenerated.
* Implementing local function binding constructs.Kaz Kylheku2014-07-103-3/+185
| | | | | | | | | | | | | | | | * eval.c (fbind_s, lbind_s, flet_s, labels_s): New symbol globals. (env_fb_to_fb): New static function. (lookup_mac): Implement the same shadow check for function macros that is done for symbol macros, because we now have local functions that can shadow local macros. (fbindings_helper, op_fbind, make_fun_shadowing_env, expand_fbind_vars, me_flet_labels): New static functions. (expand): Add cases for fbind and lbind. (eval_init): Intern the four new symbols. Register sys:fbind and sys:lbind operators. Register flet and labels macros. * txr.1: Documented flet and labels.
* * eval.c: Comment spelling.Kaz Kylheku2014-07-101-1/+1
|
* * eval.c (bindings_helper): New parameter to indicate thatKaz Kylheku2014-07-082-6/+18
| | | | | | | | the caller needs the return value, so the function can avoid consing up a list that will be thrown away. (op_let): Pass nil argument to new parameter of bindings_helper. (op_each, op_for): Pass t to indicate that the return value is needed.
* * LICENSE: Adding copyright for MPI Library.Kaz Kylheku2014-07-083-1/+24
| | | | * METALICENSE: Adding notes about MPI.
* * Makefile: install the LICENSE and METALICENSE files into the dataKaz Kylheku2014-07-075-0/+60
| | | | | | | | | | | | directory. * txr.c (help): Help text updated to document --license option. (license): New function. (txr_main): Implement --license option. * unwind.h (uw_catch): Add cast to suppress warning about unused symbol. * txr.1: Document --license option.
* * lib.c (replace_list, sel): fix use of unused variable.Kaz Kylheku2014-07-072-2/+6
|
* * LICENSE: Small wording change. Add pointer to METALICENSE.Kaz Kylheku2014-07-073-2/+45
| | | | * METALICENSE: New file.
* * LICENSE: Switching to simplified two-clause BSD license,Kaz Kylheku2014-07-072-7/+18
| | | | | | | | | but with modifications. Adding back the no-liability part of the disclaimer, but with abbreviated text. Also, rewriting the initial paragraph to make it clear that the two conditions cover redistribution, and that use of the software is tantamount to agreeing with the disclaimer.
* * txr.1: Spell check.Kaz Kylheku2014-07-072-102/+106
|
* * txr.1: Corrections from Roman MishinKaz Kylheku2014-07-062-49/+56
|
* * eval.c (apf_s, ipf_s): New symbol variables.Kaz Kylheku2014-07-033-18/+47
| | | | | | | | | | | | (me_ap, me_ip): Generate a much simpler macro-expansion: a call to apf or ipf, rather than lambda syntax. (me_ado, me_ido): New static functions. (eval_init): Initialize apf_s and ipf_s variables. Use them in the registration calls for apf and ipf. Register ado and ido macros. * txr.1: Streamlined documentation for ap and ip, and added ado and ido.
* * eval.c (apf, ipf): Bugfix: do_apf and do_ipfKaz Kylheku2014-07-032-2/+7
| | | | should be registered as variadic functions.
* Typo.Kaz Kylheku2014-07-031-1/+1
|
* Version 91.txr-91Kaz Kylheku2014-07-025-122/+200
|
* * Makefile: use $(EXE) in install: recipe.Kaz Kylheku2014-07-023-2/+18
| | | | * configure: set up EXE variable in config.make, not exe.
* * txr.1: Documented usleep.Kaz Kylheku2014-07-022-0/+25
|
* Reconstruct missing ChangeLog entry from git log.Kaz Kylheku2014-07-021-0/+20
| | | | This entry shows when usleep was added to TXR.
* * eval.c (dwim_loc): Support indexing using a list of positions,Kaz Kylheku2014-07-024-90/+193
| | | | | | | | | | | | | | | such as obtained by the where function. * lib.c (replace_list, replace_str, replace_vec): Allow the from argument to be a list of index positions, possibly empty. * txr.1: Condensed syntactic descriptions under dwim operator. Range Indexing section no longer says that the value nil can be used as either endpoint of a range. This will not work any longer since a "from" value of nil looks like an empty list of indexes. Documented new behavior under replace, and shortened documentation for replace-list, replace-str and replace-vec.
* * lib.c (sel): Bugfix: not implemented correctly for sequencesKaz Kylheku2014-06-302-4/+7
| | | | which are lists.
* * arith.c (bit): New function.Kaz Kylheku2014-06-286-4/+110
| | | | | | | | | | * eval.c (eval_init): Register bit as intrinsic. * lib.h (bit): Declared. * mpi-patches/add-bitops (mp_bit): New function. * txr.1: Documented bit
* * mpi-patches/add-bitops (mp_and, mp_or, mp_xor, mp_shift): Plug memoryKaz Kylheku2014-06-282-38/+43
| | | | | | | leaks caused by wrongly initializing the temporary destination operand for mp2_comp with a size, which mp2_comp then clobbers by doing the same thing. Also plug memory leaks that happen in in out-of-memory return case.
* * lib.c (where, sel): Extend into hashes.Kaz Kylheku2014-06-273-20/+65
| | | | * txr.1: document hash support for select and where.
* Bugfix: apply_intrinsic and iapply must not destructivelyKaz Kylheku2014-06-274-22/+48
| | | | | | | | | | | | manipulate argument lists. * eval.c (apply_frob_args): Rewrite to non-destructive one-pass version. (iapply): Likewise. * lib.c (term): New function. * lib.h (term): Declared.
* * txr.1: Fixes in quasiquote description.Kaz Kylheku2014-06-261-16/+11
|
* * txr.1: Add some section headers, rearrange.Kaz Kylheku2014-06-261-92/+94
|
* Fixes to bignum bit operations affecting pretty much all bit operationsKaz Kylheku2014-06-263-8/+23
| | | | | | | | | | | | | | when bit field operands are negative, affecting logand, logor, logxor, lognot, logtrunc, logtest and ash. In addition, logtest was found to return the logical inverse of its correct value. * arith.c (logtest): Fix broken boolean polarity of return value. * mpi-patches/add-bitops (mp_2comp): Fix incorrect treatment of negative values. (mp_and): Fix incorrectly ordered statements, which cause failure when operands are negative.
* * eval.c (iapply_s): new global variable.Kaz Kylheku2014-06-263-8/+88
| | | | | | | | | | (iapply, me_ip): new static functions. (do_apf): Bugfix: use apply_intrinsic, not apply. (do_ipf, ipf): New static functions. (eval_init): initialize iapply_s. register me_ip macro expander, and the iapply and ipf functions. * txr.1: Documented iapply, ipf and ip.
* * lib.c (last): Bugfix: reversed null test.Kaz Kylheku2014-06-262-1/+5
|
* * eval.c (eval_init): register range_regex and tok_whereKaz Kylheku2014-06-267-4/+81
| | | | | | | | | | | | | | as intrinsics. * lib.c (tok_where): New function. * lib.h (tok_where): Declared. * regex.c (range_regex): New function. * regex.h (range_regex): Declared. * txr.1: Documented tok-where and range-regex.
* * lib.c (search): Bugfix in type mismatch error message:Kaz Kylheku2014-06-262-1/+6
| | | | trying to print cons function pointer as value.
* * eval.c (mapcarv): Use mapcar_listout, so list_of_lists can beKaz Kylheku2014-06-265-4/+102
| | | | | | | | | | | | | a non-list sequence. (eval_init): Register transpose and zip as intrinsics. * lib.c (curry_12_1_v): New static function. (transpose, mapcar_listout): New functions. (mapcar): Redefined in terms of mapcar_listout. * lib.h (transpose, mapcar_listout): Declared. * txr.1: Documented transpose and zip.
* Bugfix: macros not being expanded in expansions embedded inKaz Kylheku2014-06-203-3/+52
| | | | | | | | | | | | | | quasilierals: i.e. the forms X and Y in `@{X}` and `@{X Y}`, where X and Y can be Lisp symbol macros or compound forms that is a macro call. * eval.c (expand_quasi): Handle the var forms in a quasi. * parser.y (n_exprs_opt, q_var): New grammar nonterminals. q_var is a clone of o_var, but with different construction behavior. It fixes the bug that o_var applies expand_meta to embedded Lisp forms, which is not appropriate for TXR Lisp quasiliterals. (quasi_item): Derive q_var rather than o_var.
* Optimization: add missing tail updates to some listKaz Kylheku2014-06-204-7/+19
| | | | | | | | | | | collecting loops. * lib.c (tuples_func, where, sel): Catch return value of list_collect and update tail variable. * match.c (do_txeval): Likewise. * parser.y (expand_meta): Likewise for list_collect_nconc.
* * eval.c (do_apf, apf): New functions.Kaz Kylheku2014-06-203-0/+45
| | | | | | (eval_init): Register apf as intrinsic. * txr.1: Document apf.
* Improve error reporting.Kaz Kylheku2014-06-202-8/+21
| | | | | | | * eval.c (eval_error): Use last_form_evaled if form is null. (apply): Substitute apply symbol if ctx_form is null. (apply_intrinsic): Do not pass fake (apply) context form to apply, just pass nil.
* * eval.c (identity_s): New global variable.Kaz Kylheku2014-06-193-2/+127
| | | | | | | | | (me_ret, tf, nilf, do_retf, retf): New static functions. (eval_init): Initialize identity_s, and use it for registration of identity. Register ret macro, and the retf, tf and nilf functions. * txr.1: Documentation for ret, retf, tf and nilf.
* Bugfix: dwim operator contradicts the documentationKaz Kylheku2014-06-192-1/+12
| | | | | | | | | | and intended design. * eval.c (do_eval): When calling do_eval_args to evaluate the arguments of a compound form that is a function call, do not pass down the lookup function, but substitute &lookup_var. Passing down the lookup function means tha all evaluation enclosed in (dwim ...) or [...] follows the Lisp-1 style.
* * eval.c (me_ap): New static function.Kaz Kylheku2014-06-195-11/+123
| | | | | | | | | | | | | | (eval_init): Use new list_f instead of func_n0v(identity). Register multi as intrinsic. Register me_ap as ap macro. * lib.c (list_f): New global variable. (multi): New function. (multi_sort): Use list_f in place of func_n0v(identity). (obj_init): gc-protect and initialize list_f. * lib.h (list_f, multi): Declared. * txr.1: Documented multi and ap.
* * eval.c (eval_init): Register member and member_if as intrinsics.Kaz Kylheku2014-06-186-137/+222
| | | | | | | | | | * lib.c (member, member_if): New functions. * lib.h (member, member_if): Declared. * txr.1: Documented. * txr.vim: Regenerated.
* * lib.c (generic_funcall): Bugfixes: support symbols.Kaz Kylheku2014-06-172-4/+28
| | | | | | | | Removed dubious statement which clamps nargs to the number of fixed parameters, breaking variadic calls. Test case: (mapcar 'list '(1 2)) -> ((1) (2)) Note: generic_funcall is only used when non-function objects are used as functions; variadic funcalls were not broken.
* * txr.1: Fix broken examples for some and none functions.Kaz Kylheku2014-06-172-2/+6
|
* * eval.c (not_null): New static function.Kaz Kylheku2014-06-173-5/+48
| | | | | | | | (eval_init): Use null_f in existing registration of null and not. Add registration for not_null as "true", and for null_f as "false". * txr.1: Documented true and false.
* * eval.c (eval_init): register tuples as intrinsic.Kaz Kylheku2014-06-175-0/+81
| | | | | | | | | * lib.c (tuples_func): New static function. (tuples): New function. * lib.h (tuples): Declared. * txr.1: Documented.
* * lib.c (obj_print): Render character DC00 as "pnul".Kaz Kylheku2014-06-154-5/+45
| | | | | | | | | | | | | Clean up code which chooses rendering for characters. Print C0 and C1 control characters, as well as D800-DFFF, FFFE and FFFF and characters above FFFF using hex; others are printed using the #\<char> notation. * parser.y (char_from_name): map "pnul" to DC00. * txr.1: Documented pnul, clarified character printing rules, and added a cautionary note about possible ambiguity in printing.
* * eval.c (eval_init): Register pos_max, pos_min, find_max,Kaz Kylheku2014-06-155-7/+201
| | | | | | | | | | | | | | | | | | find_min and seqp as intrinsics. * lib.c (gt_f, lt_f): New variables. (to_seq): renamed to toseq. (seqp): New function. (minmax): New static function. (replace_str, replace_vec): Follow to_seq renaming. (find_max, find_min, pos_max, pos_min): New functions. (obj_init): gc-protect and initialize gt_f and lt_f. * lib.h (gt_f, lt_f): Declared. (to_seq): Declaration updated to toseq. (seqp, find_max, find_min, pos_max, pos_min): Declared. * txr.1: Updated.
* * eval.c (eval_init): where and sel registered as intrinsicsKaz Kylheku2014-06-155-5/+141
| | | | | | | | | | | | where and select. * lib.c (generic_funcall): Support a sequence as an argument to a sequence. (where, sel): New functions. * lib.h (where, sel): Declared. * txr.1: Documented.
* Bugfix: range and range* broken when "to" argument isKaz Kylheku2014-06-152-5/+14
| | | | | | | | omitted. This was broken in version 89, by the 2014-04-08 commit. * eval.c (rangev_func, range_star_v_func): Only perform numeric tests between from and to if to is not nil.
* * Makefile: Install share/txr/stdlib/*.txr material.Kaz Kylheku2014-06-125-1/+20
| | | | | | | | | | | * match.c (do_txeval): If a variable is not in the bindings, fall back on treating it as a TXR Lisp dynamic variable. This allows us to refer to the stdlib variable from a quasistring in a @(load ...) directive. * txr.c (sysroot_init): Register new variable, *txr-version*. * share/txr/stdlib/ver.txr: New file.
* * match.c (v_load): use the abs_path_p function instead ofKaz Kylheku2014-06-126-2/+74
| | | | | | | | | | | | | checking for leading slash. * stream.c (abs_path_p): New function. (stream_init): Register abs_path_p as abs-path-p. * stream.h (abs_path_p): Declared. * txr.1: Documented abs-path-p. * dep.mk: Updated.