Hello, thanks for the link https://github.com/ContinuumIO/pyalge. The problem I met is that the examples are not commented so it is not easy to see a use of this kind of features. I'm ver new to this kind of things.
What could be a use of this in Sympy ? Sorry for this "noob" question. ;-) Christophe 2014-04-05 9:23 GMT+02:00 F. B. <[email protected]>: > > On Thursday, April 3, 2014 5:04:36 PM UTC+2, Aaron Meurer wrote: >> >> Some people on this list might be interested in this https://github.com/ >> ContinuumIO/pyalge. >> > > > Indeed, that can be very powerful to symbolic math. > > I don't really like their style of putting the string of the expression > inside the dispatching decorator, but otherwise you can't easily freeze > expressions to an unevaluated state in Python. That's a point in favor of > Julia. > > In any case, in SymPy there are wildcards types, so a possible solution: > > x = symbols('x') > w = Wild('w') > > @patterndispatch(sin(w*x), assumptions=Q.positive(w)) > def foo(a): > a**2 > > @patterndispatch(sin(w*x)) > def foo(a): > a**3 > > # there should be a mechanism that understands which one is more specific. > foo(sin(3*x)) # ==> sin(3*x)**2 > foo(sin(-2*x)) # ==> sin(3*x)**3 > > What do you think about this approach? > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/76c5493f-d6c4-49d6-b3c1-063b16245816%40googlegroups.com<https://groups.google.com/d/msgid/sympy/76c5493f-d6c4-49d6-b3c1-063b16245816%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAAb4jG%3DC%2BU2Z_ajBM-zGw2vG38SBBVU-u6aLRdiiAKd-KJpmvw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
