a # 1 63 R ' mat#headings output matrix;s;i;a;`a;v;w;h;Lio '
a # a,[1] '"output - center headings over formatted columns. '
a # a,[1] '"from ''the apl handbook of techniques'' copyright 1978, ibm. '
a # a,[1] '"-headings, a character vector with blank delimiters, will be '
a # a,[1] '" centered over the appropriate columns, and unerscored to '
a # a,[1] '" the full width of those columns in the preformatted matrix. '
a # a,[1] '"-any heading too wide for its columns will be noted. '
a # a,[1] '"-any insufficient number of headings will cause length error. '
a # a,[1] '"-only the leftmost headings will be used. '
a # a,[1] '"-uses: hdma hnext`a hcntr hwidth hdlb '
a # a,[1] '"-generates a global variable, `b, which can be used to reduce '
a # a,[1] '" (then expand) the result by eliminating blank columns. '
a # a,[1] ' mat#(1URmatrix)R'' '',s#(i#~Lio#1)R`a#headings '
a # a,[1] ' w#''`b''width matrix '
a # a,[1] 'back:$((i=Rw)V0=Rh#next`a)/final '
a # a,[1] ' $(0^=Ra H s#s,a#w[i#i+1]cntr h)/back '
a # a,[1] ' $0,RL#''column width ('',(Fw),'') too narrow for '',h '
a # a,[1] 'final:mat[`b/IR`b]#s '
a # a,[1] ' mat#(mat,[0.1]`b\''-''),[1]matrix '
Lfx a