tellsimp & truncate



On 9/18/07, Robert Dodier <robert.dodier at gmail.com> wrote:
>
> Dunno if tellsimp acts the same. I'm sure this confusion wasn't
> intentional. (2) SIMP-TRUNCATE which is attached to the noun
> %TRUNCATE returns a verb $TRUNCATE.


Agreed, this is a bug.

I guess (2) seems odd. Shouldn't SIMP-TRUNCATE return a noun
> if applied to %TRUNCATE ??

...

> Here's a patch to make it do that....
> A tangential bit of strangeness is that %TRUNCATE doesn't have
> the simplification properties, instead $TRUNCATE has them.
> Isn't that unlike other noun/verb pairs in Maxima?


This is bogus.  The ONLY case where there should be distinct simplifying
nouns and procedural verbs is when there is a form-changing verb (diff,
integrate, limit, ...) and also a simplifying noun ('diff, 'integrate,
'limit, ...).  The cases where there are distinct noun/verbs other than this
(sin/'sin) are either remnants of a scheme discarded about 30 years ago
(where verbs did numerical evaluation) or new bugs.  There should be no
$truncate/..., and the simplification properties belong on %truncate/....

I think what has happened here is that some functions which used to be
strictly verbs (e.g. transpose, floor) have been changed partly or fully
into simplifying functions.

Transpose, for example, has the hacky half-way solution of still being a
verb, so that 'transpose([1,2]) or subst([1,2],x,transpose(x)) doesn't go
through with the transposition the way a simplifying function would, but
instead of giving an error for transpose(x), it returns 'transpose(x), which
at least allows you to carry out the transposition of explicit arguments
after they're substituted using ev(..., transpose).  But this is the wrong
way to do things.

Truncate etc. also started as procedures (verbs), but now are full-fledged
simplifying functions. The only thing that's left is that they use verb
symbols, which causes problems such as the above.

            -s