Sorry for being this late to the discussion.
On Thu, Nov 01, 2012 at 03:35:53PM -0500, Matthew Rocklin wrote:
>
> I was about to send this. Now I see that you've solved your problem. I'll
> send it anyway in case it's useful. One note. I would recomment do_one over
> chain.
>
> Are you working off of a branch I can see? Perhaps there is a
> strategy-idomatic way to get around your issue.
>
> I would normally do something like
>
> def rule1(expr):
> ...
> def rule2(expr):
> ...
>
>
> big_function = exhaust(top_down(typed({Trace: do_one(rule1, rule2, ...)})))
The fact that this idiom is often met indicates that it should be
factored out in a function; I'd oppose relying on decorators though,
because decorators really obscure a lot of stuff and remove a great
deal of flexibility. Further, if the said idiom is captured in a
function, it should make refactoring rather easy without essentially
constraining flexibility.
Of course, I may be missing some important use-cases.
Sergiu
--
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.