On Mar 11, 2009, at 8:17 PM, Jason Grout wrote:

>
> Alex Ghitza wrote:
>> On Thu, Mar 12, 2009 at 2:03 PM, Jason Grout
>> <[email protected] <mailto:[email protected]>>  
>> wrote:
>>
>>
>>     [email protected] <mailto:[email protected]> wrote:
>>> Carl
>>>
>>> Mathematica seems to have been successful with this approach.  I'm
>>> curious what were the reasons for its disapproval.  Perhaps it was
>>> feared it was error prone?
>>
>>
>>     Along with the other reasons people are giving, it may be  
>> helpful to
>>     remember that it is may be less error-prone in MMA.  For example,
>>     parentheses in Sage can denote function calling as well as  
>> grouping,
>>     while they only denote grouping in MMA.  With implicit  
>> multiplication,
>>     func (x) and func(x) are both valid in Sage, but have different
>>     meanings.

No, the wouldn't

sage: implicit_multiplication(True)
sage: sin(pi)
0
sage: sin (pi)
0

Implicit multiplication doesn't turn valid Python into different  
valid Python. I don't think "a b" being different than "ab" is  
necessarily a good thing, but being able to write

sage: x^3 + 2x^2 - 3x + 1
x^3 + 2*x^2 - 3*x + 1

is really nice. However, the "explicit is better than implicit" and  
trying to stick close to actual Python arguments are it seems the  
main points against it.

>> In MMA, they both are multiplication, like you'd expect from
>>     math.
>>
>>
>> ???  so you're saying that in Mathematica sin(x) means sin times x?
>> That's not what I'd expect from math...
>>
>> I must be misreading what you wrote.
>>
>
> Nope, you're correct.  That's a nice thing about Mathematica.

For a very different definition than "nice" than I have :). Wow!

> Function calls are always with square brackets, parentheses are  
> purely a grouping
> construct.  Curly braces are always lists, and double square brackets
> are indexing (but that's just syntactical sugar).  System functions
> always use camel-case.  I really like the consistency in  
> mathematica; it
> makes it easy to learn and predictable.
>
> So your example would be Sin[x] in MMA.

Internal consistency is good, but consistency with the vast body of  
mathematical literature out there is pretty valuable as well.

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to