Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Unacceptable bug in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93550] Re: [mg93509] Unacceptable bug in Mathematica
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Thu, 13 Nov 2008 21:10:06 -0500 (EST)
  • References: <200811130902.EAA13922@smc.vnet.net>

psycho_dad wrote:
> The other day, a friend discovered something that may qualify as a
> major bug in Mathematica (tested in 6.0.3):
> 
> SyntaxQ["Exp[]"]
> 
> (notice that Exp has no argument) returns
> 
> True !!!!
> 
> According to the documentation:
> 
> SyntaxQ["string"] returns True if the string corresponds to
> syntactically correct input for a single Mathematica expression, and
> returns False otherwise.
> 
> At least for me Exp[] is not syntactically correct. I expected more
> from Mathematica...
> 
> Cheers

There is no room for ambiguity in this sort of thing. Either it is 
syntactically well formed, or it is not. This one is, in the sense of 
Mathematica syntax. Just like the variant below.

In[1]:= SyntaxQ["exp[]"]
Out[1]= True

Maybe you have in mind that Exp, being a built in "function" (that is, a 
symbol with DownValues attached to it), should require an "argument". 
Well and good, but that's progamming language semantics, not syntax.

On a side note, related to another recent post...if you type Exp[] in a 
version 6 front end, you will see a red arrow between the brackets, 
indicating that there seems to be something "missing". So what we refer 
to as "syntax highlighting" really knows a bit of the language semantics 
(and goes well beyond just lexical analysis).

Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: Unacceptable bug in Mathematica
  • Next by Date: Re: Analyzing sequences of fractions in Mathematica
  • Previous by thread: Unacceptable bug in Mathematica
  • Next by thread: Re: Unacceptable bug in Mathematica