On Apr 28, 2:59 am, Ronan Lamy <ronan.l...@gmail.com> wrote:
> >   * Refactor whole matching logic into a separate module, and use the
> > Basic.match function only as interface. This was also done for
> > printing and I think the pattern matching is complex enough to justify
> > this step.
>
> I don't think it works so well for printing, having to hack into the
> printers every time you create a new class is annoying.
>

But how often do you create new classes in sympy which doesn't inherit
an appropriate printing method? In my opinion it's now much easier to
get consistent printing for all classes and fix bugs bugs in the
printing code.

> This issue has been raised many times and I think nobody likes the
> current situation. However, the current behaviour is quite convenient
> when it works, and much code depends on it. I think that the best
> solution is to distinguish structural matching (like Mathematica) from
> algebraic matching (like the current implementation of subs) and to have
> separate functions/methods for each.

Like Aaron and Vincent I think this is a good idea. What do you like
better:

* Two separate methods maybe called "match_algebraic" and
"match_structural" (One of them could be the default "match" method)

* One single "match" method accepting a keyword like "matchmethod"

I slightly prefer the second way - one reason is that in subs we could
be consistently use the same keyword and use the corresponding
matching pattern.

> Some links you might find useful:
> * All the issues related to 
> matching:http://code.google.com/p/sympy/issues/list?q=label:Matching
> * My own attempts to work on 
> this:http://code.google.com/p/sympy/issues/detail?id=1736

I'm in the moment too lazy to investigate - have you done some mayor
changes that are not in sympy's main branch yet?


Sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to