Am 11.11.2013 00:08, schrieb F. B.:
In Wolfram Mathematica, + is a Plus M-expression, always. They don't have
any MatPlus, or whatever.
The behavior upon it is determined by pattern matching. [...]
I don't think pattern matching is the only way.
Actually, it is.
*Somewhere*, you need to match expression structure with what to do. The
various *Add classes are essentially just precomputed pattern matches.
The more interesting question is how to organize the patterns.
Do we do it by application domain, i.e. one set of rules for infinities,
one set for numbers, one for functions, etc.? That's weak when dealing
with the cases that span application domains.
Or do we do it by operation? That's unsure footing because operations
tend to be defined in terms of application domain so it's a bit hard to
agree what "+" actually is; also, it tends to create huge, messy
specifications as the definition for "+" must cater for all combinations
but the kitchen sink.
I'm leaning towards a mixed approach: define groups of application
domains and do it on a per-function basis inside; however, now the
question is how to define groups, and the best answer I can come up for
that is "we'd need to experiment and see what works", which is hardly
satisfactory.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.