Re: Unacceptable bug in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg93547] Re: Unacceptable bug in Mathematica
- From: John Doty <jpd at whispertel.LoseTheH.net>
- Date: Thu, 13 Nov 2008 21:09:34 -0500 (EST)
- References: <gfgqf2$dj0$1@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. But it *is* correct syntax. An empty expression with Exp as its head. > I expected more > from Mathematica... You didn't expect enough. You see, while Mathematica doesn't define this, you can: In[1]:= Unprotect[Exp] Out[1]= {Exp} In[2]:= Exp[]=E Out[2]= E In[3]:= Exp[] Out[3]= E A consequence, if you like, of the consistent, simple syntax at Mathematica's foundation. -- John Doty, Noqsi Aerospace, Ltd. http://www.noqsi.com/ -- The axiomatic method of mathematics is one of the great achievements of our culture. However, it is only a method. Whereas the facts of mathematics once discovered will never change, the method by which these facts are verified has changed many times in the past, and it would be foolhardy to expect that changes will not occur again at some future date. - Gian-Carlo Rota