Pablo De Napoli wrote: > 2) the current implementation treats f(x)=sin(x) as a symbolic expression > > sage: f(x)=sin(x) > sage: f > x |--> sin(x) > sage: type(f) > <type 'sage.symbolic.expression.Expression'> > > However, mathematically a function is something different: for instance it > has a domain and a range (say: this function takes one real number as > argument, and returns another real number). > > ¿is there some way to express this in Sage? (I know this might be difficult as > python is dynamically typed). > > This might be important for instance, when applying some operator to > the function. For instance: the results of one operation can be > different if the function is considered as one of a real variable, or > as one of a complex variable (say). > > I think it would be important to have some unified framework for > functions, so that users > don't see that one function acts in one way and some other in a different way.
At one point, there was a discussion about being able to state the domain and range of a function. Nicolas had some ideas about defining that, but I can't find the post in which he talked about his ideas (something about constructing domains and ranges like, say, the upper half plane as Domain(RR^2,[y>0]) ). I'd love to be able to define a function from R^n to R^m, for example, and have true vector-valued functions. I believe in 4.3 you can check the parents of something that is passed into the evaluation function, so you can do some checking of the domain and make the function respond differently depending on what type the argument is. Thanks, Jason -- Jason Grout -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org