Input mode changes error messages

Doug Meade's picture

Maple gives different error messages to the same input depending on whether the input is done with Maple notation or 2D Math Input.

My example is to enter the following erroneous input in both Maple notation and 1D math notation:

plot( sin(x, x=0..1 );

Clearly this is missing a right parenthesis after the first x.

Here is how this section of my worksheet copies into MaplePrimes:

> plot( sin (x, x=0..1 );
Error, unable to match delimiters
 Typesetting:-mambiguous(plotlpar sin (xcomma xequals0periodperiod1 )semi, 

   Typesetting:-merror("unable to match delimiters"))
plot( sin(x, x=0..1 );
Error, `;` unexpected

My concern is that different error messages are reported. I think this has been mentioned before, but I want to reinforce the point.

Doug

two different parsers

with two different error message sets (for identical input) is a confusing situation, to say the least, from my point of view.

I wonder whether there is a switch to make show the full version of the error messages within the Standard GUI.

 

Robert Israel's picture

... and a third

Since the syntax rules for 1D and 2D are different, presumably the parsers are different, and therefore it's not surprising that the error messages may be different. There are also differences between 2D math in Standard and 2D math in Classic.  I tried your example with 2D math in Classic, and got a different error message:

Error, (in sin) expecting 1 argument, got 2

because in this case Maple changed the ";" to ")" without asking.

Doug Meade's picture

minor quibble

Robert,

Thanks for your addition to this post. I didn't think to check the Classic interface.

Just one quibble. You wrote:

I tried your example with 2D math in Classic, and got a different error message:

Error, (in sin) expecting 1 argument, got 2

because in this case Maple changed the ";" to ")" without asking.

This error message suggests to me that Maple is seeing sin( x, x=0..1 ) which is the sine function with 2 arguments. Nothing about changing a comma to a parenthesis. To me it appears to be a difference in the order in which checks are done.

While I know the parsers have to be different, shouldn't they all be implementing the same syntax. Is it really acceptable to have different output from the different input modes and interfaces?

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

 

Robert Israel's picture

Yes, Maple is seeing sin(x,

Yes, Maple is seeing sin(x, x=0..1).

plot(sin(x, x = 0 .. 1);

became

plot(sin(x, x = 0 .. 1))

Now that I look at it again, it's not really that the semicolon was changed to a parenthesis, but rather that two separate things happened:
1) a semicolon at the end of 2D input in Classic is always dropped, and
2) the missing parenthesis was added.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}