I had this idea before. See http://code.google.com/p/sympy/issues/detail?id=2006.
I have no idea how hard it would be to implement, but my guess is that it wouldn't be easy. But if you have an idea how to do it go ahead and give it a shot. I think it would be really cool and very useful. Aaron Meurer On May 15, 2012, at 3:05 PM, "[email protected]" <[email protected]> wrote: > In another discussion on the mailing list Ronan mentioned that Lambda > should not subclass Expr. Here I was proposing just the opposite: have > Function subclass Expr in order to have callable Expr. > > (1+f)(x) returning 1+f(x) > and > (1+Lambda(a, 2*a))(x) returning 1+2*a > > Any thoughts? For precedent check "Functional Differential Geometry". > > On 12 May 2012 22:23, [email protected] > <[email protected]> wrote: >> I would like to be able to do the following: >> >>>>> f = Function('f') >>>>> expr = 2+f >>>>> expr(x) >> 2+f(x) >> >> It would be extremely useful for the vector analysis stuff on which I >> am working for gsoc. `f` is a `Field` and `x` is a `Point`. >> >> I will try to implement it. Please raise any objections if you have. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > 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/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. 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/sympy?hl=en.
