HELP: Translated files, particularly ode2.lisp



David.Billinghurst@riotinto.com writes:

> 2. When I translate ode2.mac the generated ode2.LISP the following lines of
>    text are appended
> 
>   ;;The following functions declaration should ;;go at the front of your macsyma file 
>   ;;EVAL_WHEN(TRANSLATE,
> 	  DECLARE_TRANSLATED(BOUNDTEST,NOTEQN,NLXY,NLY,NLX,XCC2,BESSEL2,
> 			     EULER2,PTTEST,EXACT2,CC2,GENHOM,SOLVEBERNOULLI,
> 			     SOLVEHOM,INTEGFACTOR,EXACT,SEPARABLE,SOLVELNR,
> 			     SOLVE1,LINEAR2,REDUCE,HOM2,PR2,VARP,DESIMP,
> 			     FAILURE,ODE1A,FTEST,ODE2A))
> 
>    and I have to remove them manually.  It would be nice to turn them of, or
>    have them added as comments.  The manual indicates this can be controlled
>    by one of the TR_* flags.  I haven't worked it out yet.


With DECLARE_TRANSLATED(FOO) the translator knows (even without having
an explicit definition for FOO) that $FOO can be called as lisp
function and that MFUNCTION-CALL is not needed.  But I think that this
doesn't work currently (note that a DECLARE_TRANSLATED form is already
at the beginning of ode2.mac).  So I suggest to comment out this part
in ode2.mac.

> 3. The translated lisp code (using clisp-2.28/cygwin) is wrong.  I compared it
>    with the original lisp file.  The attched changes to the freshly translated file,
>    get it working and passing the testsuite.

[...]
> @@ -45,7 +45,7 @@
>        ((MFUNCTION-CALL $FREEOF
>          (SIMPLIFY
>           `((%DERIVATIVE)
> -           (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X) 2)))
> +           ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X) 2))

Could be a bug in Clisp. It can be easily isolated:

Translating

'diff(y,x);

gives

(SIMPLIFY
 `((%DERIVATIVE)
   (SYSTEM::UNQUOTE (TRD-MSYMEVAL |$y| '|$y|) (TRD-MSYMEVAL |$x| '|$x|))))

in Clisp, but

(SIMPLIFY
 `((%DERIVATIVE) ,(TRD-MSYMEVAL |$y| '|$y|) ,(TRD-MSYMEVAL |$x| '|$x|)))

with SBCL.

Wolfgang