summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* * 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.
* Version 90txr-90Kaz Kylheku2014-06-117-113/+182
|
* * Makefile (txr.o): Pass TXR_VER preprocessor symbol on gcc commandKaz Kylheku2014-06-115-6/+50
| | | | | | | | | | | | | | | | | | | | line. (PREINSTALL): New variable holding a step for the install recipe. (pax tar zip): New targets. * configure (txr_ver): Version now added to config.make, passed through to txr.c. (gen_config_make): bindir, datadir and mandir are established using gmake's regular macro assignment (=) rather than expanding assignment (:=). This allows us to override the prefix variable after configure time. * lib.h (wli_noex): New macro. (wli): Retarget to wli_noex, so that argument is subject to macro replacement. * txr.c (version): Use TXR_VER defined on compiler command line, rather than hard-coded string literal.
* * eval.c (eval_init): Change registration of string_cmpKaz Kylheku2014-06-105-32/+111
| | | | | | | | | | | | | | | | | | | to cmp_str. Add registrations for str_eq, str_lt, str_gt, str_le, and str_lt. * lib.c (string_cmp): Name changes to cmp_str, and the function fixed so that it actually works. The name change doesn't affect anyone because the function was too broken to use due to the incorrect type dispatch. (string_lt): Name changes to str_lt. (str_eq, str_gt, str_le, str_ge): New functions. * lib.h (string_cmp, string_lt): Declarations renamed. (str_eq, str_gt, str_le, str_ge): New declarations. * txr.1: Document string-cmp to cmp-str rename, that string-lt is deprecated, and the new str<, str>, str>=, str<= and str= functions.
* 2014-06-10 Kaz Kylheku <kaz@kylheku.com>Kaz Kylheku2014-06-104-22/+49
| | | | | | | | | | | | | | | * Makefile (PROG): Removing ./ prefix from variable name; adding it to invocations of $(PROG) in some rules. (txr.o): Pass several strings as macros on the command line: TXR_REL_PATH, EXE_SUFF and PROG_NAME. * configure (bindir, datadir, mandir): These variables become just relative paths from the prefix. * txr.c (sysroot): Use the TXR_REL_PATH, EXE_SUFF and PROG_NAME preprocessor symbols defined on the command line to avoid hard-coding strings like "bin/txr" and "bin/txr.exe" which actually should reflect the value of the bindir variable.
* * txr.c (get_self_path): Fix spelling of GetModuleFileName.Kaz Kylheku2014-06-102-3/+17
| | | | | | Add missing parentheses in expression. (sysroot_init): On Windows, filter progpath to change backslashes to forward slashes.
* * parser.l (yylex_destroy): The FLEX_ version are prefixed with YY_Kaz Kylheku2014-06-102-5/+8
| | | | in old flexes too.
* New variable stdlib, with a sysroot mechanism to computeKaz Kylheku2014-06-092-0/+89
| | | | | | | | | the path based on the "sysroot" where it is actually installed. * txr.c (progname_8u, progpath): New static variables. (get_self_path, sysroot_helper, sysroot, sysroot_init): New static functions. Sysroot creates a stdlib variable. (main): Initialize progname_u8 value, and call sysroot_init.
* * lib.c (match_str): Extended to suffix testing, with a negativeKaz Kylheku2014-06-093-13/+44
| | | | | | start argument. * txr.1: Documented.
* * Makefile: fix broken tests; numerous test cases outputKaz Kylheku2014-06-092-1/+14
| | | | | bindings, and need the -B option. One test case does not need the -l option which now implies -B.