Menu

#3120 freel not checking arguments

None
closed
freel (1)
5
2016-04-12
2016-04-01
Leo Butler
No

Reported on mailing list

(%i1) sign(rat([2,3]));

Maxima encountered a Lisp error:

 The value 1 is not of type LIST.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.

This patches freel

(defmfun freel (l var)
  (cond ((and (listp l) (listp (cdr l)))
     (do ((l l (cdr l))) ((null l) t)
       (cond ((not (free (car l) var)) (return nil)))))
    (t
     t)))

Which gives

(%i2) sign(rat([2,3]));
(%o2)                                 pnz

Related

Bugs: #2576

Discussion

  • Leo Butler

    Leo Butler - 2016-04-01
    • status: open --> closed
    • assigned_to: Leo Butler
     
  • Leo Butler

    Leo Butler - 2016-04-01

    Patch applied in commit 22f4fd0.

     
  • Dan Gildea

    Dan Gildea - 2016-04-02

    This commit causes two failures in the test suite:

        taylor(rat(x*(x - 1)), x, 0, 5)
        taylor(rat(factor(1 + x)), x, 0, 1)
    
     
  • Dan Gildea

    Dan Gildea - 2016-04-03

    Fixed by [691cbc]

     

    Related

    Commit: [691cbc]


    Last edit: Dan Gildea 2016-04-03
  • Robert Dodier

    Robert Dodier - 2016-04-11
    • status: closed --> open
     
  • Robert Dodier

    Robert Dodier - 2016-04-11

    Reopening this report -- commit [22f4fd0] appears to break tests 23 and 129 in rtest_taylor by changing the return value of RATDISREP in some cases. RATDISREP is supposed to return a simple MPLUS expression but with commit 22f4, it returns an MRAT expression.

    For the record the tests are:

    taylor(rat(x*(x-1)),x,0,5);
    x^2 - x$
    
    taylor(rat(factor(1+x)),x,0,1);
    1+x$
    
     
  • Leo Butler

    Leo Butler - 2016-04-12

    Commit 691cbc resolved those testsuite errors.

    FWIW, I believe that the exit condition in that commit when l is an atom should punt to free, rather than equal. E.g.

    ~~~~
    defmfun freel (l var)
    (do ((l l (cdr l))) ((atom l) (or (null l) (free l var)))
    (unless (free (car l) var) (return nil))))
    ~~~~

     
  • Dan Gildea

    Dan Gildea - 2016-04-12
    • status: open --> closed
     
  • Dan Gildea

    Dan Gildea - 2016-04-12

    You are right, it should call free. Fixed in [09d160].
    I have applied the fix to the 5.38 branch.

     

    Related

    Commit: [09d160]


Log in to post a comment.