Menu

#2569 translate rat(1,x) and rat([1]) incorrect

None
closed
nobody
6
2013-05-24
2013-04-20
No

f():=rat(x,x)$ translate(f)$
Maxima encountered a Lisp error:
LEFTOVER-MFORMAT-ARGS?: extra mformat args (NIL $F error: failed to translate.~%)

f():=rat([1])$

?print(f())$ =>
((MLIST SIMP) ((MRAT SIMP NIL (#:X34094)) 1 . 1)) <<< a list of CREs, correct

translate(f)$ ?print(f())$ =>
((MRAT SIMP (((MLIST) 1)) (#:X34094)) (#:X34094 1 1) . 1)
<<< a CRE with main variable = [1] !!!! WRONG

Discussion

  • Stavros Macrakis

    Simplest fix to this is simply to delete the def%tr for $rat in transl.lisp. Translating rat as an ordinary function will work just fine, with some tiny reduction in efficiency. In fact, I doubt it's worth actually changing def%tr of $rat to be correct. There are many more important optimizations....

     
  • Robert Dodier

    Robert Dodier - 2013-05-24
    • labels: --> Lisp Core - Translator
     
  • Robert Dodier

    Robert Dodier - 2013-05-24
    • status: open --> closed
     
  • Robert Dodier

    Robert Dodier - 2013-05-24

    Fixed by commit 29f9239. Removed the translation property for $RAT as suggested.

     

Log in to post a comment.