MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Interpretation of wrog use of Operators

  • To: mathgroup at smc.vnet.net
  • Subject: [mg21351] Re: Interpretation of wrog use of Operators
  • From: Tobias Oed <tobias at physics.odu.edu>
  • Date: Tue, 28 Dec 1999 00:49:37 -0500 (EST)
  • Organization: Old Dominion University
  • References: <8471gd$n81@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Drago Ganic wrote:
> 
> Hi !!
> 
> I believe that the functions SyntaxQ and SyntaxLength shouldn't return an error message like they do when we use super-, sub-, over- or underscripts with an operator.
> 
> In[27]:= SyntaxQ [ "\!\(x\[CirclePlus]\_n y\)" ]
> 
> Syntax::"sntxi": "Incomplete expression; more input is needed.\!\(\"\"\)"
> 
> Out[27]= False
> 
> In[27]:= SyntaxLength [ "\!\(x\[CirclePlus]\_n y\)" ]
> 
> Syntax::"sntxi": "Incomplete expression; more input is needed.\!\(\"\"\)"
> 
> Out[28]=31
> 
> It seems that Mathematica has the problem to interpret the expression
> 
>     SubscriptBox["\[CirclePlus]", n_ ]
> 
> where instead of \[CirclePlus] can be any operator name.
> 
> Of course this input is syntactically incorrect, but why the error message when I  _just ask_
> if it is correct.
> 
> In the example of The Mathematica Book 2.8.13
> 
>     SyntaxLength["1 + 2 + "]
> 
> we don't get the error message. I think Mathematica is here inconsistent.
> 
> I also don't know how to interpret the return value of the SyntaxLength function because I can't see the FullForm ?
> 
> Any comments....
> 
> Greetings,
> Drago Ganic, Croatia

You can switch the message off by issuing a 

Off[SyntaxQ::sntxi]

but you are right, Mathematica's behaviour seems not to be consistent between
the two examples.

cheers Tobias


  • Prev by Date: volatility and greek values for financial options
  • Next by Date: Re: volatility and greek values for financial options
  • Previous by thread: Interpretation of wrog use of Operators
  • Next by thread: Fonts and WinNT