3. Entering Expressions
Using Menus:
ReplaceWithMatrix:
Replaces the primary selection with a matrix expression.
The dimensions for the matrix are chosen from pop-up menus.
(note: MEDDLE can support arbitrarily big matrices, but the current user interface restricts
the maximum dimension to be 10 x 10.)
The matrix is initialized by setting all elements = 0.
This is useful when entering sparse matrices, and isn't really a hindarance when
you aren't.
ReplaceWithVector:
Replaces the primary selection with a vector expression.
The type (row or column) and dimension for the vector are chosen from pop-up menus.
(note: MEDDLE can support arbitrarily big vectors, but the current user interface restricts
the maximum dimension to be 10.)
The vector is initialized by setting all elements = 0.
Vectors are really just special cases of matrices, but for some applications (e.g. CaminoReal)
it is desireable to maintain a distinction between vectors and matrices.
ReplaceWithExpr:
Replaces the primary selection with a template for a compound expression.
The template (operation) is chosen from a pop-up menu.
ReplaceWithAtom:
Replaces the primary selection with an atomic expression.
The type of atom is chosen from a pop-up menu. Depending on the type of atom
selected, the atom value is either obtained from additional pop-up menus or from
a Tioga viewer selection. For example, "ReplaceWithAtom Integer" tries to get an
integer from an active text selection, and "ReplceWithAtom GreekVariable" provides
a pop-up menu of choices for the variable.
WrapWithExpr:
Wraps a template around the primary selection. In other words, the primary selection
is used to fill in a placeholder in the template. This placeholder is usually the first
(e.g. "a" in "a + b") or most important (e.g. integrand in integration) argument to the
template. (Yes, of course the "hot" argument should be highlighted in the pop-up menu, but unfortunately
the pop-up menus package can't switch fonts between chars or even selections. Other alternatives
looked bad.) The template (operation) is chosen from a pop-up menu.
Using the keyboard:
MEDDLE allows keyboard input for the most common atoms and compound types.
Integer, Real, and Variable atoms can be typed directly into a selected expression.
As mentioned in the section on selections, the active keyboard selection will be selected
and highlighted using horizontal gray lines. This selection is terminated as soon as
a primary selection is made or any editing function is invoked (you can always select
outside of an expression to get rid of the selection).
Typing operator characters into a selected expression performs a template wrap around
the currently active keyboard or primary selection. Currently supported keys include
+, -, *, &, |, ~, #, =, >, <, /, etc. This allows what I call "pseudo-infix" input
instead of the prefix type input required when using menus. For example, to enter
"a + b", simply select a placeholder, then type "a", "+", "b". What is really going on
is that the operation "+" is wrapped around the expression "a", and the placeholder for
the augend is auto-selected. Typing the "b" fills in the augend placeholder. The
ctrl-P "select parent" operation is very useful for keyboard input to avoid switching
beteen the keyboard and the mouse. For example, to (correctly) enter "x^2 + 1 = 0",
use the keystrokes "x", "^", "2", ctrl—P, "+", "1", ctrl-P, "=", "0".
(Note: This method is far from ideal. The user should be able to type "soft" parentheses
which would elminate the need for most ctrl-P's. This also opens up the can of worms
called "operator precedences" and "automatic parentheses generation" which should be
considered for any future systems such as MEDDLE).