Hello,
as you may know, for various mathematical functions, when the
function is verbified and the argument is a number (not necessarily
a float), then a float result is returned. For example:
sin(1);
=> sin(1)
sin(1), nouns;
=> .8414709848078965
We have discussed this before and everyone who has weighed
in has agreed it is not useful behavior. Here is a patch which
disables it so that e.g.: sin(1), nouns => sin(1)
--- src/mlisp.lisp 17 Feb 2008 01:42:49 -0000 1.63
+++ src/mlisp.lisp 31 Mar 2008 14:57:18 -0000
@@ -2295,8 +2295,7 @@
z)))
(defmfun |''MAKE-FUN| (noun-name x)
- (let (($numer t) ($float t))
- (simplifya (list (ncons noun-name) (resimplify x)) t)))
+ (simplifya (list (ncons noun-name) (resimplify x)) t))
(macrolet ((|''MAKE| (fun noun)
`(defmfun ,fun (x) (|''MAKE-FUN| ',noun x))))
>From what I can tell, this change introduces one new error in the
test suite (a case in which sin(2) used to be a float).
But that's to be expected.
I also tried removing the verb functions entirely, but that
causes many errors in the test suite.
Should I commit the patch above? Thanks for your comments.
Robert
PS. Here is the list of functions affected.
(macrolet ((|''MAKE| (fun noun)
`(defmfun ,fun (x) (|''MAKE-FUN| ',noun x))))
(|''MAKE| $log %log)
(|''MAKE| $sin %sin) (|''MAKE| $cos %cos) (|''MAKE| $tan %tan)
(|''MAKE| $cot %cot) (|''MAKE| $sec %sec) (|''MAKE| $csc %csc)
(|''MAKE| $sinh %sinh) (|''MAKE| $cosh %cosh) (|''MAKE| $tanh %tanh)
(|''MAKE| $coth %coth) (|''MAKE| $sech %sech) (|''MAKE| $csch %csch)
(|''MAKE| $asin %asin) (|''MAKE| $acos %acos) (|''MAKE| $atan %atan)
(|''MAKE| $acot %acot) (|''MAKE| $asec %asec) (|''MAKE| $acsc %acsc)
(|''MAKE| $asinh %asinh) (|''MAKE| $acosh %acosh) (|''MAKE| $atanh %atanh)
(|''MAKE| $acoth %acoth) (|''MAKE| $asech %asech) (|''MAKE| $acsch %acsch)
(|''MAKE| $round %round) (|''MAKE| $truncate %truncate) (|''MAKE| $plog %plog)
(|''MAKE| $signum %signum) (|''MAKE| $erf %erf) (|''MAKE| $gamma %gamma))