On Jun 9, 2007, at 12:33 PM, William Stein wrote: > I have another objection. If we "use the preparser to > give constant literal implicit multiplication on the left", it > is really strange an inconsistent when the same notation > doesn't work for variables. E.g., in Mathematica putting > two things separated by a space is *always* multiplication: > > In[3]:= 2 3 > Out[3]= 6 > In[4]:= a := 2; > In[5]:= 6 a > Out[5]= 12 > In[6]:= a 6 > Out[6]= 12 > > This genuinely makes sense from a language point of view. > Your proposal to only have adjacency be multiplication in one > case, i.e., [literal][variable] is I think bad from a language point > of view, since it will lead to a lot of confusion > > sage: 2 3 > error > sage: 6 a > 6a (ok) > sage: a 6 > error > > Etc. > > And what about (2+3)a? That would also be an error.
I think there is already asymmetry in the math world. Writing "2 3" or "a 6" to mean multiplication in a math paper (without * or \cdot) would probably be unnatural and probably confusing, where as "6 a" is not ambiguous at all. The last example is more valid, but yes, it would be an error. Not letting juxtaposed variables or other more complicated constructs be multiplication is an artifact of multi- letter variable names (and much more difficult pre-parsing, and a potential confusion with function calling). I think it wold be especially useful in the toyed with units package sage: 4 meters * sin(30 degrees) 2 meters One could still use explicit multiplication wherever one wanted to. However, it seems everyone who has responded has hated the idea... > > By the way, in the next SAGE release (2.6.1), it will > be as easy as > > sage: preparse(False) > > to turn off the preparser completely, and > > sage: preparse(True) > > to turn it on. Also, "sage -ipython" will start Ipython and > "from sage.all import *" will load the sage library into Ipython > but *not* enable preparsing. Thus for people who don't > like preparsing it will be very easy to turn it off. To implement > this I had to reorganize various bits of code in sage/misc/ > preparser.py > and sage/all*. Nice, though I am always grateful for the preparser when working interactively. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---