a pictorial format function for patterning decorated numeric displays
An extension to the APL dyadic format function is proposed, using a character vector left argument. This argument is a literal pattern having the exact length of the last dimension of the resultant array. No special markers are required to separate adjacent numeric fields, arbitrary decorations may appear within or outside of fields, negative or positive numbers can be distinguished by symbols of choice, and there is provision for accommodating the number representation practices of different countries. The extension completely covers the present functional capability of dyadic format with one minor exception (and possible improvement) in a detail of exponential presentation. In the proposed extension, format information is carried in three ways: in the structure of the pattern, in the choice of digits to denote number fields, and in a system variable. Common requirements, such as the use of commas, floating negative signs on either or both sides of a number, and optional suppression of zero values, are achieved very simply. This paper will describe the evolution of this proposal, which was first discussed at APL/73, give a rigorous formulation of the rules, and show examples of its use.
functional pattern display extensibility use character vectorization argument arrays requirements posit representation present practical exception informal structure systems variability values paper evolution rules examples