Forwarding Pearu's answer on this, since it was posted to sympy list only.

---------- Forwarded message ----------
From: Pearu Peterson <[EMAIL PROTECTED]>
Date: Sep 12, 2007 7:02 PM
Subject: Re: calculus in SAGE/SymPy
To: sympy <[EMAIL PROTECTED]>



On Sep 12, 1:23 pm, "Ondrej Certik" <[EMAIL PROTECTED]> wrote:

> However, there are some longterm questions:
>
> 1) when you type sin(x), it's an instance of the class "sin". Now, all
> classes in Python should be CamelCase, so we should rather use
> "Sin(x)". Currently, SymPy/SAGE/Maple uses "sin(x)", while Mathematica
> uses "Sin[x]".
>
> What is your opinion about this? See also:
>
> http://code.google.com/p/sympy/issues/detail?id=329#c11
>
> I'd very much like to obey Python conventions, because this is what
> people expect when seeing the code for the first time.

The fact that sin is a class, is an implementation detail.
Note that sin will have dual class/function nature where the
function nature of it is dominant for end-users. So, the argument
of CamelCase is only partly valid. For an end-user sin behaves
like a function. I think there is no need to force implemenation
detail like this to end-users. So, I would prefer sin over Sin.
(btw, this will ease reimplementing sympy function support)

> 2) What is your position on this:
>
> sage: (sin(x)).taylor(x, 0, 5)
> x - x^3/6 + x^5/120
> sage: taylor(sin(x), x, 0, 5)
> x - x^3/6 + x^5/120
>
> shouldn't there be just one way how to do series expansion? In SymPy
> we also have those 2 ways - but it's kind of inconsistent, we have it
> for some methods, but not all. My own opinion is more in favor of
> removing all those module level functions (like taylor, expand), if
> there is a corresponding method. But there are other opinions as well.

Methods are more convinient for rapid development and expression
manipulations. Btw, in numpy using methods is also preferred.
However, for new users who may have background in Maple, for instance,
functions are more appropiate.
Therefore, I think we should have both ways available via functions
like

def taylor(expr, ...):
    return Basic.sympify(expr).taylor(..)

Pearu



--~--~---------~--~----~------------~-------~--~----~
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/
-~----------~----~----~----~------~----~------~--~---

Reply via email to