diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-10-06 13:16:01 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-10-06 13:16:01 -0700 |
commit | 9776ad45285a46cacd5fc7288489d374f6480f37 (patch) | |
tree | e141aa7d91e132752654f9bba78f167f5a65990d | |
parent | b9746b4840d0f38042773bbc097286dd02857e18 (diff) | |
download | txr-9776ad45285a46cacd5fc7288489d374f6480f37.tar.gz txr-9776ad45285a46cacd5fc7288489d374f6480f37.tar.bz2 txr-9776ad45285a46cacd5fc7288489d374f6480f37.zip |
Renaming the currying combinators according to new scheme.
* lib.c (bind2): Function renamed to curry_12_2.
(bind2other): Function renamed to curry_12_1.
(do_bind_2, do_bind2other): Helpers renamed likewise.
(tree_find): Follows rename of bind2.
* match.c (match_files): deffilter code follows bind2 rename
to curry_12_2.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | lib.c | 14 | ||||
-rw-r--r-- | lib.h | 7 | ||||
-rw-r--r-- | match.c | 2 |
4 files changed, 25 insertions, 10 deletions
@@ -1,5 +1,17 @@ 2011-10-06 Kaz Kylheku <kaz@kylheku.com> + Renaming the currying combinators according to new scheme. + + * lib.c (bind2): Function renamed to curry_12_2. + (bind2other): Function renamed to curry_12_1. + (do_bind_2, do_bind2other): Helpers renamed likewise. + (tree_find): Follows rename of bind2. + + * match.c (match_files): deffilter code follows bind2 rename + to curry_12_2. + +2011-10-06 Kaz Kylheku <kaz@kylheku.com> + * lib.c (funcall3, curry_123_2): New functions. (do_curry_123_2): New static function. @@ -381,7 +381,7 @@ val tree_find(val obj, val tree) if (equal(obj, tree)) return t; else if (consp(tree)) - return some_satisfy(tree, bind2(func_n2(tree_find), obj), nil); + return some_satisfy(tree, curry_12_2(func_n2(tree_find), obj), nil); return nil; } @@ -1472,24 +1472,24 @@ val reduce_left(val fun, val list, val init, val key) return init; } -static val do_bind2(val fcons, val arg2) +static val do_curry_12_2(val fcons, val arg2) { return funcall2(car(fcons), cdr(fcons), arg2); } -val bind2(val fun2, val arg) +val curry_12_2(val fun2, val arg) { - return func_f1(cons(fun2, arg), do_bind2); + return func_f1(cons(fun2, arg), do_curry_12_2); } -static val do_bind2other(val fcons, val arg1) +static val do_curry_12_1(val fcons, val arg1) { return funcall2(car(fcons), arg1, cdr(fcons)); } -val bind2other(val fun2, val arg2) +val curry_12_1(val fun2, val arg2) { - return func_f1(cons(fun2, arg2), do_bind2other); + return func_f1(cons(fun2, arg2), do_curry_12_1); } static val do_curry_123_2(val fcons, val arg2) @@ -354,8 +354,11 @@ val funcall1(val fun, val arg); val funcall2(val fun, val arg1, val arg2); val funcall3(val fun, val arg1, val arg2, val arg3); val reduce_left(val fun, val list, val init, val key); -val bind2(val fun2, val arg); -val bind2other(val fun2, val arg2); +/* The notation curry_12_2 means take some function f(arg1, arg2) and + fix a value for argument 1 to create a g(arg2). + Other variations follow by analogy. */ +val curry_12_2(val fun2, val arg); +val curry_12_1(val fun2, val arg2); val curry_123_2(val fun3, val arg1, val arg3); val chain(val first_fun, ...); val andf(val first_fun, ...); @@ -1991,7 +1991,7 @@ repeat_spec_same_data: if (!all_satisfy(table, andf(func_n1(listp), chain(func_n1(length), - bind2(func_n2(eq), two), + curry_12_2(func_n2(eq), two), nao), chain(func_n1(first), func_n1(stringp), |