On Dec 15, 2:26 pm, Chris Seberino <[email protected]> wrote:
> I had it turned on but I guess it doesn't get triggered for x (x -1).

Even when you turn it on, the behavior is not uniform as the user
might expect, though there is a logic.

sage: implicit_multiplication(10)
sage: (x) (x-1)
(x - 1)*x
sage: x (x-1)
x - 1
sage: (x-1)x
(x - 1)*x
sage: x(x-1)
x - 1


> Any way to change the behavior or
> does that require a patch to Sage?
>

By the way, this is poorly documented in the sense that

implicit_multiplication?

only refers to `implicit_mul`, which however is not in the global
namespace.

But

sage: sage.misc.preparser.implicit_mul?

gives


Definition:     sage.misc.preparser.implicit_mul(code, level=5)
Docstring:
       Inserts *'s to make implicit multiplication explicit.

       INPUT:

       * ``code``  -- a string; the code with missing *'s

       * ``level`` -- an integer (default: 5); how aggressive to be in
         placing *'s

         * 0 - Do nothing

         * 1 - Numeric followed by alphanumeric

         * 2 - Closing parentheses followed by alphanumeric

         * 3 - Spaces between alphanumeric

         * 10 - Adjacent parentheses (may mangle call statements)

Perhaps it's time to add a level.

-- 
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-support
URL: http://www.sagemath.org

Reply via email to