summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-08-14 20:56:54 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-08-14 20:56:54 -0700
commit725112ef78d8c6e655db4a99fc69e54d0ed1eb5a (patch)
tree89b456d55b28fb07a41483aa838555ee3035c1a5 /eval.c
parentf94ae27b4021b61eabe50d3b088b8d8917bfdfe8 (diff)
downloadtxr-725112ef78d8c6e655db4a99fc69e54d0ed1eb5a.tar.gz
txr-725112ef78d8c6e655db4a99fc69e54d0ed1eb5a.tar.bz2
txr-725112ef78d8c6e655db4a99fc69e54d0ed1eb5a.zip
math: tofloat and toint in user-defined arithmetic.
* arith.c (tofloat_s, toint_s): New symbol variables. (tofloat, toint): If the argument is a COBJ, handle it via do_unary_method. (arith_init): Initialize new symbol variables. The functions tofloat, toint, tofloatz and tointz. are now registered here, rather than eval_init. * eval.c (eval_init): Remove registrations of tofloat, toint, tofloatz and tointz. * tests/016/ud-arith.tl: New tests. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/eval.c b/eval.c
index 094ecb71..adfd6d69 100644
--- a/eval.c
+++ b/eval.c
@@ -7609,10 +7609,6 @@ void eval_init(void)
reg_fun(intern(lit("num-str"), user_package), func_n1(num_str));
reg_fun(intern(lit("int-flo"), user_package), func_n1(int_flo));
reg_fun(intern(lit("flo-int"), user_package), func_n1(flo_int));
- reg_fun(intern(lit("tofloat"), user_package), func_n1(tofloat));
- reg_fun(intern(lit("toint"), user_package), func_n2o(toint, 1));
- reg_fun(intern(lit("tofloatz"), user_package), func_n1(tofloatz));
- reg_fun(intern(lit("tointz"), user_package), func_n2o(tointz, 1));
reg_fun(intern(lit("less"), user_package), func_n1v(lessv));
reg_fun(intern(lit("greater"), user_package), func_n1v(greaterv));
reg_fun(intern(lit("lequal"), user_package), func_n1v(lequalv));