#11539: Sage incorrectly interprets factorials in equations.
-----------------------------+----------------------------------------------
       Reporter:  mhansen    |         Owner:  burcin  
           Type:  defect     |        Status:  new     
       Priority:  critical   |     Milestone:  sage-5.0
      Component:  symbolics  |    Resolution:          
       Keywords:             |   Work issues:          
Report Upstream:  N/A        |     Reviewers:          
        Authors:             |     Merged in:          
   Dependencies:             |      Stopgaps:          
-----------------------------+----------------------------------------------

Comment (by nbruin):

 Replying to [comment:7 kcrisman]:
 > I like the idea!  But this isn't working for me - am I making some
 newbie mistake?

 Indeed. This only affects `display2d:false` printing. The nicer print
 modes (including latex) will print as usual:
 {{{
 (%i1) factorial(x);
 (%o1)                                 x!
 (%i2) :lisp (defprop mfactorial nil grind)
 NIL
 (%i2) factorial(x);
 (%o2)                                 x!
 (%i3) display2d:false;
 (%o3) false
 (%i4) factorial(x);
 (%o4) factorial(x)
 }}}
 > And it doesn't work
 {{{
 sage: sage.calculus.calculus.maxima.eval(r":lisp (+ 2 2)")
 RuntimeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.
 }}}
 Yes, maxima_lib doesn't perfectly mimmick the expect interface that way.
 Apparently we're not hooking into a part of the parser that accepts
 directives. However,
 {{{
 sage: sage.calculus.calculus.maxima.lisp("(remprop 'mfactorial 'grind)")
 }}}
 and
 {{{
 sage: M=Maxima()
 sage: M.lisp("(remprop 'mfactorial 'grind)")
 '"";\r\n\r\nT\r\n<sage-display>('
 }}}
 both work, so there's a workaround.

 Note that we can use `remprop` to actually remove a property. In CL you
 have to work quite hard to see the difference between a NIL-valued
 property and a non-existent property. Most maxima symbols do not have a
 `GRIND` property, though, so perhaps removing it is the more proper thing
 to do. The `defprop` must be a Maxima macro, by the way. It's not standard
 CL. But then ... many parts of Maxima predate CL.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11539#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to