On Sep 12, 1:30 pm, Robert Bradshaw <[EMAIL PROTECTED]>
wrote:
> On Sep 12, 2007, at 1:06 PM, William Stein wrote:
> >>> I have a few design questions that I would like to discuss and they
> >>> are relevant to both SymPy and SAGE, so I am posting to both
> >>> mailinglists.
>
> > Thanks.   I want to preface my comments below by remarking that the
> > design constraints in SAGE and SymPy are different so the best answers
> > in each case may be different.
>
> >>> We are currently redesigning the class hierarchy in SymPy so that:
> >>> 1)
> >>>   Add(sin, cos)
> >>> and
> >>>   Add(sin(1),cos(1))
>
> >>> are valid constructions. Here (Add(sin, cos))(1) will produce
> >>> Add(sin(1), cos(1)). So that we can use both applied (sin(x)) and
> >>> unapplied (sin) functions.
>
> > In SAGE the following happens.  Maybe this  is a design mistake in
> > SAGE:
>
> > sage: f = sin + cos; f
> > sin + cos
> > sage: f(1)
> > sin + cos         # design mistake?  should it be sin(1) + cos(1)?
> > sage: sin(1)
> > sin(1)
>
> > It definitely seems wrong from one point of view.  What's happening
> > above is that f(1) does substitution on the variables in f, of which
> > there are none.  In contrast sin(1) evaluates the function sin at 1.
>
> > If somebody agrees that the above should be considered a bug
> > in SAGE, it should be added to trac.
>
> Seehttp://www.sagemath.org:9002/sage_trac/ticket/644

Is this really a good thing?  It seems like it might get a little
confusing, especially when you get into some more complicated cases.

Assume that sin and cos are 1-argument functions, and pow and atan2
are 2-argument functions.  What do the following mean?

(sin+cos)(1)
(sin+1)(1)
(pow+atan2)(1, 2)
(sin+cos)(1, 2)
(pow+atan2)(1)
(pow+sin)(1)
(pow+sin)(1, 2)
(pow+sin+1)(1)

Carl


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