diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-13 21:47:02 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-13 21:47:02 -0700 |
commit | f2e197dcd31d737bf23816107343f67e2bf6dd8e (patch) | |
tree | ecdefacfe4177012fae54ae74d8c309eab336767 /eval.c | |
parent | 4b308561021d4dedd7e83e5df30534d1fdde2216 (diff) | |
download | txr-f2e197dcd31d737bf23816107343f67e2bf6dd8e.tar.gz txr-f2e197dcd31d737bf23816107343f67e2bf6dd8e.tar.bz2 txr-f2e197dcd31d737bf23816107343f67e2bf6dd8e.zip |
New function, clamp.
* eval.c (eval_init): Register clamp as intrinsic function.
* lib.c (clamp): New function.
* lib.h (clamp): Declared.
* txr.1: Documented.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -4349,6 +4349,7 @@ void eval_init(void) reg_fun(intern(lit("/="), user_package), func_n0v(numneqv)); reg_fun(intern(lit("max"), user_package), func_n1v(maxv)); reg_fun(intern(lit("min"), user_package), func_n1v(minv)); + reg_fun(intern(lit("clamp"), user_package), func_n3(clamp)); reg_fun(intern(lit("pos-max"), user_package), func_n3o(pos_max, 1)); reg_fun(intern(lit("pos-min"), user_package), func_n3o(pos_min, 1)); reg_fun(intern(lit("in"), user_package), func_n4o(in, 2)); |