Nasser Abbasi wrote:
> 
> 
> On Oct 20, 8:44 am, finotti <[email protected]> wrote:
>> Sorry...  My fault.  I had a "max=20", which made "max?" give me:
>>
> 
> This is really bad that one can redefine a system function just like
> this.
> 


I don't think that's bad.  Suppose I want an enhanced "max" that works 
for Sage symbolic functions too (like the Sage-enhanced floor and ceil 
functions).

If you ever want the real system max, just do:


sage: import __builtin__
sage: __builtin__.max([1,2,3])

Of course, I think you can redefine it even there.  However, you 
probably won't accidentally do so.


> In Mathematica, one thing I like about it, is that all its functions
> and symbols are protected by default (and they all start with
> Uppercase), so one can not do such a trivial mistake.


I used to miss that in Mathematica--symbols have a consistent naming 
convention which makes it easy to separate system things from user 
things.  Sage (and python) accomplish this in a much, much more flexible 
way, though, using namespaces.  For example:

sage.all.pi # Sage's pi
sage.all.solve # Sage's solve

import sage.all as s

s.pi # Sage's pi
s.solve # Sage's solve

There is no notion of "Protected" symbols, though.

Thanks,

Jason


--~--~---------~--~----~------------~-------~--~----~
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-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to