From fe47cba529cc8688e7073b51ee1c596d5b42bda8 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 13 Oct 2014 19:25:15 -0700 Subject: * eval.c (eval_init): Register greater function as intrinsic. * lib.c (gt_f, lt_f): Global variables removed. (greater_f): New variable. (greater): New function. (find_max, pos_max): Use greater_f as default for testfun, rather than gt_f. (find_min, pos_min): Use less_f as default for testfun, rather than lt_f. (obj_init): Remove references to gt_f and lt_f. GC-protect and initialize greater_f. * lib.h (greater_f): Declared. (gt_f, lt_f): Declarations removed. * txr.1: Documented greater, and use of less and greater in pos-min, pos-max, find-min and find-max. * txr.vim: Regenerated. --- lib.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib.h') diff --git a/lib.h b/lib.h index bb58669c..cf1a8d4f 100644 --- a/lib.h +++ b/lib.h @@ -378,8 +378,8 @@ extern val nothrow_k, args_k, colon_k, auto_k; extern val null_string; extern val null_list; /* (nil) */ -extern val identity_f, equal_f, eql_f, eq_f, gt_f, lt_f, car_f, cdr_f, null_f; -extern val list_f, less_f; +extern val identity_f, equal_f, eql_f, eq_f, car_f, cdr_f, null_f; +extern val list_f, less_f, greater_f; extern const wchar_t *progname; extern val prog_string; @@ -601,6 +601,7 @@ val num_str(val str); val int_flo(val f); val flo_int(val i); val less(val left, val right); +val greater(val left, val right); val chrp(val chr); wchar_t c_chr(val chr); val chr_isalnum(val ch); -- cgit v1.2.3