calc: Incomplete Objects
5.13 Incomplete Objects
=======================
When ‘(’ or ‘[’ is typed to begin entering a complex number or vector,
respectively, the effect is to push an “incomplete” complex number or
vector onto the stack. The ‘,’ key adds the value(s) at the top of the
stack onto the current incomplete object. The ‘)’ and ‘]’ keys “close”
the incomplete object after adding any values on the top of the stack in
front of the incomplete object.
As a result, the sequence of keystrokes ‘[ 2 , 3 <RET> 2 * , 9 ]’
pushes the vector ‘[2, 6, 9]’ onto the stack. Likewise, ‘( 1 , 2 Q )’
pushes the complex number ‘(1, 1.414)’ (approximately).
If several values lie on the stack in front of the incomplete object,
all are collected and appended to the object. Thus the ‘,’ key is
redundant: ‘[ 2 <RET> 3 <RET> 2 * 9 ]’. Some people prefer the
equivalent <SPC> key to <RET>.
As a special case, typing ‘,’ immediately after ‘(’, ‘[’, or ‘,’ adds
a zero or duplicates the preceding value in the list being formed.
Typing <DEL> during incomplete entry removes the last item from the
list.
The ‘;’ key is used in the same way as ‘,’ to create polar complex
numbers: ‘( 1 ; 2 )’. When entering a vector, ‘;’ is useful for
creating a matrix. In particular, ‘[ [ 1 , 2 ; 3 , 4 ; 5 , 6 ] ]’ is
equivalent to ‘[ [ 1 , 2 ] , [ 3 , 4 ] , [ 5 , 6 ] ]’.
Incomplete entry is also used to enter intervals. For example, ‘[ 2
.. 4 )’ enters a semi-open interval. Note that when you type the first
period, it will be interpreted as a decimal point, but when you type a
second period immediately afterward, it is re-interpreted as part of the
interval symbol. Typing ‘..’ corresponds to executing the ‘calc-dots’
command.
If you find incomplete entry distracting, you may wish to enter
vectors and complex numbers as algebraic formulas by pressing the
apostrophe key.