Re: Re: Unacceptable bug in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg93558] Re: [mg93525] Re: [mg93509] Unacceptable bug in Mathematica
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Fri, 14 Nov 2008 06:35:25 -0500 (EST)
- References: <200811130902.EAA13922@smc.vnet.net> <491C3C16.2000805@wolfram.com> <200811140205.VAA16262@smc.vnet.net>
But it does give a "valid expression". v = ToExpression["Exp[]"] Exp called with 0 arguments; 1 argument is expected. Exp[] True, you get a warning message, but after evaluation you have a valid expression v, and you can use it to build further valid expressions: In[4]:= f = Head[v] Out[4]= Exp In[5]:= f[1] Out[5]= E It's all perfectly valid. Andrzej Kozlowski On 14 Nov 2008, at 11:05, Savas Nesseris wrote: > Dear Daniel, > you say that: > "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." > > OK I accept this, however then you (Wolfram Research) should remove > the > following comment from the documentation of SyntaxQ, as it is > misleading: > "When SyntaxQ gives True, the string can be converted to an > expression:" > > And definately, > > "Exp[]" // ToExpression > > does not give *a valid expression*... > > Cheers > > PS Thanks for clarifying this point with SyntaxQ > > 2008/11/13 Daniel Lichtblau <danl at wolfram.com> > >> 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 >> > >
- References:
- Unacceptable bug in Mathematica
- From: psycho_dad <s.nesseris@gmail.com>
- Re: Unacceptable bug in Mathematica
- From: "Savas Nesseris" <s.nesseris@gmail.com>
- Unacceptable bug in Mathematica