trgsmp.mac and translated files



(progn 'compile x y z)


has the same meaning as

(progn   x y z)

as far as I know.

Keeping some rules while killing others seems to be the
real issue for allowing these facilities to be left as
non-translated files.

As far as mfunction-call, I would assume that it is necessary
only if the function being called is not a lisp function but
a macsyma-user-defined function.  $radcan is an ordinary lisp
function, so unless someone changes its definition to a macsyma-user
function and then wants the changes to make some difference in
trigsimp or whatever, there is no advantage to mfunction-call.
(As far as I know).
RJF


Raymond Toy wrote:

> While taking a quick peek at Bug 1370433, trigsimp(sqrt(%i2)) !=
> sqrt(trigsimp(%i2)), I noticed that src/trgsmp.lisp is a translated
> file, and it seems that it was translated from
> share/trigonometry/trgsmp.mac 20 years ago.
> 
> Is there really a reason to use the translated file instead of using
> trgsmp.mac directly?  Or even just always converting trgsmp.mac to
> trgsmp.lisp during the build?  Reading trgsmp.mac is far easier than
> reading trgsmp.lisp, and any bugfixes/changes/enhancements should
> probably done on trgsmp.mac.
> 
> So, as an experiment, I ran translate_file("trgsmp").  After comparing
> the two, they seem mostly identical except for a few items.  Most of
> the places where the translation has
> 
> (progn
>   (defprop $trigsimp t translated)
>   (add2lnc '$trigsimp $props)
>   (defmtrfun ($trigsimp $any mdefine nil nil)
>        ($x)
>   ...))
> 
> (progn
>   'compile
>   (fset '$htrigrule4
>         (lambda (TR-GENSYM~79)
>   ...)))
> 
> 
> trgsmp.lisp has
> 
> (eval-when (compile eval load)
>   (defprop $trigsimp t translated)
>   (add2lnc '$trigsimp $props)
>   (defmtrfun
>       ($trigsimp $any mdefine nil nil)
>       ($x)
> 
> (eval-when (compile eval load)
>   (defun $htrigrule4
>       (|tr-gensym~24|)
>   ...))
> 
> Also, most function calls in trgsmp.lisp like ($radcan foo) are
> (mfunction-call $radcan foo).  Is that really necessary?
> 
> Does anyone know when (progn 'compile ...) means?  Should all of those
> progn's really be eval-when's?
> 
> And finally, loading trgsmp.mac seems to work, and the one test case
> in rtest3.mac passes.  But running the test suite causes that one
> failure, presumably because the functions or rules were killed.
> 
> Would it make sense to convert trgsmp.mac to trgsmp.lisp and
> compile that whenever maxima is built?
> 
> Ray
> 
> BTW, desoln, elim, invert, nusum, and ode2 also seem to be translated
> files. 
> 
> _______________________________________________
> Maxima mailing list
> Maxima@math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima