Using Color to Manipulate Expressions
Download talk material:
This paper describes a package (available as shareware) that makes it easy to specify
arbitrary operations on Mathematica expressions by coloring the part(s) of the
expressions to be manipulated. This expands greatly on what is possible using highlighting
and palette buttons because: 1) several parts of an expression can be selected
simultaneously so that, for example, two nonadjacent terms of a large sum can be selected
and subjected to an arbitrary operation, 2) coloring is implemented in such a way that it
stays in the notebook, thereby leaving an audit trail of work done, and 3) any arbitrary
rule of function (not just those already available in palettes) can be applied to
subexpressions selected by color.
Most of the paper describes the package from a user's point of view, using
FullForm to explain what a colored expression "looks
like" to Mathematica. The software is illustrated by a number of realistic
examples, and the essentially open-ended possibilities offered by coloring are emphasized.
Later sections outline the implementation of the package. It is anticipated that this
technique will be of interest to those (such as teachers) who want to use Mathematica
as an algebraic calculator without becoming embroiled in programming issues.