diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/digests/tugboat/tb0apl.tex |
Initial commit
Diffstat (limited to 'info/digests/tugboat/tb0apl.tex')
-rw-r--r-- | info/digests/tugboat/tb0apl.tex | 591 |
1 files changed, 591 insertions, 0 deletions
diff --git a/info/digests/tugboat/tb0apl.tex b/info/digests/tugboat/tb0apl.tex new file mode 100644 index 0000000000..e7b639f764 --- /dev/null +++ b/info/digests/tugboat/tb0apl.tex @@ -0,0 +1,591 @@ +% tb19apl.tex + +%======================================================================== +% A TeX file for the paper announcing our work on an APL font +% +% A.Hohti/O.Kanerva (University of Helsinki) April 1987 +%======================================================================== + +% VERSION AT 21.40 ON 11.5 87 +% +% This paper was published in TUGboat 8#3, November 1987. +% Some modifications made for this purpose by the editor are so marked: +% % added or changed by bb + +\font\sltt=cmsltt10 % for file contents inside text +\begingroup % isolate special definitions +% % added by bb + +%======================================================================== +\input aplstyle % the file containing the APL definitions +% note: this inputs verbatim.tex and apldef.tex +%======================================================================== + +%\magnification=\magstep1 % for weak eyes! + +%======================================================================== +%\font\bigbf=ambx10 % scaled \magstep1 % for titles +%\font\sltt=amsltt10 % for file contents inside text +%\font\manual=manfnt at 10pt % for major METAFONT logo +%\font\minual=manfnt at 9pt % for minor METAFONT logo +%\input ninesize % abstract, references +% removed by bb, definition of \ninepoint nearly identical to TUGboat +%======================================================================== + +% changed by bb to \MF in text +%\def\METAFONT{{\manual METAFONT}} +%\def\metafont{{\minual METAFONT}} + +%======================================================================== +% stylistic definitions +% replaced in text by \beginsection; bb +%\def\section#1{\vskip0pt plus .1\vsize +% \penalty-250\vskip0pt plus-.1\vsize\bigskip +% \noindent{\bf #1.\ }\nobreak\message{#1}} +% redefined by bb to conform to TUGboat page dimensions +%\def\abstract#1{\bigskip\centerline{\hbox{ +% \vbox{\hsize=4.75truein{\ninepoint \noindent ABSTRACT.\enspace#1}}}}} +\def\abstract#1{{\leftskip=\parindent \rightskip=\leftskip + \interlinepenalty=10000 + \ninepoint \noindent ABSTRACT.\enspace#1\endgraf}} +\def\APL{{\sl APL}} +% this definition is from the TeXbook, Ex. 21.3 : +\def\boxit#1{\vbox{\hrule \hbox{\vrule \kern2pt + \vbox{\kern2pt#1\kern2pt}\kern2pt\vrule}\hrule}} +% A macro for making references and blocks. +% +\newdimen\refindent\newdimen\plusindent +\newdimen\refskip\newdimen\tempindent +\newdimen\extraindent +\newcount\refcount +% +% \refskip has to be set by the user! Otherwise \parindent is +% used, in accordance with \item. +% +\refcount=0 +\def\ref#1:#2.-#3\par{\ninepoint % switch to nine point fonts + \advance\refcount by 1 + \setbox0=\hbox{[\number\refcount]}\refindent=\wd0 + \plusindent=\refskip\extraindent=\refskip + \advance\plusindent by -\refindent\tempindent=\parindent % + \parindent=0pt\par\hangindent\extraindent % + [\number\refcount]\hskip\plusindent #1:{\sl#2},#3\endgraf + \parindent=\tempindent} +% +\refskip=\parindent +% +%======================================================================== + % HEADER +\title Generating an \APL\ Font +\\Aarno Hohti and Okko Kanerva\cr + University of Helsinki +\endx + +\pagexref{hohti} + +\abstract{The \APL\ language is well known for its peculiar + symbols which have inhibited the use of this language + in many programming environments. Making \APL\ + documents of good quality has been difficult and + expensive. We describe here a simple way how to + use \MF\ to generate an \APL\ font for \TeX\ + by using existing font definitions as far as possible.} +%\vskip.5truecm +%======================================================================== + +\beginsection Introduction + +This note describes an interesting exercise in using +\MF\ to produce new typefaces by combining letters +from standard fonts. As we know, the \APL\ language [6] of +Kenneth Iverson has never gained the popularity it deserves +largely because of its strange symbol set. Indeed, +true \APL\ users require a special keyboard to support +the nonstandard but powerful operator symbols. Moreover, +putting \APL\ into print has always been a problem, and +modern low cost computerized typesetting programs do +not usually support \APL\ style. \TeX\ can be used to +produce high quality printouts for technical text, +and it would be desirable to have a possibility to +mix in \APL\ code. The companion program of \TeX\Dash +\MF\Dash provides a full means for a simple generation +of an \APL\ font for \TeX, and the purpose of this +note is to inform other people about the result we +have obtained at the University of Helsinki. Let us note +that there are at least three other \APL\ fonts available +for small computer environments. Indeed, the newsletter +{\sl APL Quote Quad}\footnote{*}{{\ninepoint Newsletter of SIGAPL, +the Special Interest Group for \APL\null. Quote Quad has the same +status in the world of \APL\ as \TUB\ in \TeX{nical} world.}} +is produced by using Troff, and there +exists a PostScript \APL\ font for the Apple LaserWriter [5] and +another font for the TEXT typesetting system~[2]. + +Consider the following usual kind of function definition in \APL: +\choosett{apl} +\begintt + @DL~S_SUMSQ N;I + [1] S_I_0 + [2] @GO(N<I_I+1)/0 + [3] S_S+I*2 + [4] @GO~2 + [5] @DL +\endtt +\choosett{sltt}% +How to write in this code, providing that we have a suitable +font? The \APL\ font should represent the screen +output style of \APL\ code and obey the same laws of spacing. +Hence, it should be a typewriter-like typeface with fixed +spacing; the same approach for representing \TeX\ input was +adopted by Knuth in the {\TeX}book. +The {\it verbatim\/} macros have often been used for importing +screen or paper outputs into \TeX\ documents; some people +misuse them for an easy construction of tables etc. In +{\sltt verbatim}, the typewriter mode is entered by the control +sequence @\begintt@\Dash that mode is ended by +@\endtt@. In the same vein, we could enter +the \APL\ mode by the control sequence @\beginapl@, +and to end it by @\endapl@. However, it is more convenient to +augment {\sltt verbatim} with {\sltt aplstyle} so that +it can be used with several different typewriter-like fonts. +(The {\it verbatim\/} macros can be found in the {\TeX}book, +p.\ 421.) Since {\sltt\char'100} +(the {\it at sign\/}) is used as the escape character inside {\it verbatim\/} +mode, our \TeX\ code might (and in fact does) look as follows: +\def\endsym{\char'134{endtt}} % just for using \endtt after \begintt + % without actually ending anything +\choosett{tentt} +\begintt + \choosett{apl} + \begintt + @@DL~S_SUMSQ N;I + [1] S_I_0 + [2] @@GO(N<I_I+1)/0 + [3] S_S+I*2 + [4] @@GO~2 + [5] @@DL + @endsym +\endtt +\choosett{sltt}% +The control sequences @\DL@ and @\GO@ are not chosen arbitrarily +but follow the conventions used in Digital's VAX \APL\ interpreter [1]. +As terminals usually do not support the \APL\ character set, an +alternative representation by two-letter mnemonics is provided by the +interpreter. For the most part we have adopted these mnemonics also for our +\APL\ font. Hence, as an additional bonus the user should find it +easy to combine his or her \APL\ code with usual \TeX\ code. Thus, +it is not necessary for a VAX \APL\ user to retype the definitions +of \APL\ functions in order to be able to use them in documents. +However, the syntax of \TeX\ code for \APL\ text is somewhat different +from that of Digital \APL\null. Indeed, mnemonics must be followed by a +non-letter (a character whose {\it catcode\/} is different from 12) and +the escape character is {\sltt\char'100}, not period as in the interpreter. +Moreover, all spaces are obeyed; thus, if the user does not want a +space after an \APL\ symbol obtained from a control sequence, the +{\it tilde\/} character (here a character with zero width) must be +used as an end character. Using a macro for removing these differences +would make {\sltt aplstyle} both slower and unnecessarily complicated. +% +% +\choosett{apl}% +%============================= +\beginsection The \APL\ font table + +\APL\ symbols are divided into two classes: the primitive symbols +and those obtained by overstriking two primitive ones. The overstrikes +are traditionally obtained by typing the first symbol, by using +backspace to go back one space and then typing the second symbol +{\bf over} the first one. However, in modern \APL\ keyboards these +double symbols are assigned to non-alphanumeric keys (for example, +to keys under the {\sltt ALT} key). We decided to include only the +primitive \APL\ symbols in the font table; this enabled us to include +also the lower-case letters, following modern conventions. (The original +\APL\ letters were restricted to capitals.) The comment symbol +@"@ is the only exception since it is keyed in as a double quote. +Our font is a fixed size typeface with strongly slanted letters. +Moreover, we have followed the style of best books in \APL: +all symbols should be drawn with a thin pen to get a touch of +a typewriter. (This point is clearly witnessed, for example, in [5].) +The places of some symbols are determined by the \TeX\ font tables. +For example, the hash sign {\sltt\char'043} is used for the +multiplication sign in VAX \APL, and hence the corresponding symbol +has the the same octal code (043) as the hash sign in \TeX. +The font table has the following form: + +%======================================================================== +% table begins +%======================================================================== +% This macro comes from TUGboat (I do not remember which number), +% unsuitable parts are commented out. +% +{\baselineskip=0pt \lineskip=0pt +\newdimen\vu +% +%\output={\shipout\vbox{\unvbox255\vskip0.4in}\advancepageno} +% +\setbox9=\hbox{\sl 0} +\def\spike{\hbox to 0pt{\vbox to \ht9{}}} +\def\cell#1{\hbox to 1\vu{\hfill\char'#1\hfill}\vrule} +\def\label#1{\vbox to \ht8{\vfill\hbox to 35pt{\hfill\sl '#10\hskip1em% + }\vfill}\vrule} +% +\def\seprow{\def\m{\hskip 1\vu{}\vrule height 2pt}\hbox{\m\m\m\m\m\m\m\m}} +\def\cellrow#1{\setbox8=\vbox{\seprow\hbox{\spike% + \cell{#10}\cell{#11}\cell{#12}\cell{#13}% + \cell{#14}\cell{#15}\cell{#16}\cell{#17}\hfill% + }\seprow\hrule}\hbox{\label{#1}\box8}} +% +\def\lcol#1{\hbox to 1\vu{\hfill{\sl #1}\hfill}\hskip .4pt} +\def\chw#1{\hbox{\char'#1}} +% +\def\colw#1{\vbox{\chw{#10} + \chw{#11} + \chw{#12} + \chw{#13} + \chw{#14} + \chw{#15} + \chw{#16} + \chw{#17}}} +% +\def\setw#1{\vbox{\colw{#10} + \colw{#11} + \colw{#12} + \colw{#13} + \colw{#14} + \colw{#15} + \colw{#16} + \colw{#17}}} +% +\def\getw{\setbox0=\vbox{\setw0\setw1\hbox to \wd9{}\hbox to 1em{}}% + \vu=1.625\wd0} +% + \apl\getw\bigskip % changed from \null\vfill to \bigskip +% + \centerline{\vbox{%\hbox{\hskip35pt{\sl cmapl10}\hfill} +% \vskip20pt + \hbox{\hskip35pt\lcol0\lcol1\lcol2\lcol3\lcol4\lcol5\lcol6\lcol7} + \vskip 4pt + \hbox{\hskip35pt\vbox{\hrule width 8\vu}\vbox{\hrule width 3.6pt}} + \cellrow{00}\cellrow{01}\cellrow{02}\cellrow{03} + \cellrow{04}\cellrow{05}\cellrow{06}\cellrow{07} + \cellrow{10}\cellrow{11}\cellrow{12}\cellrow{13} + \cellrow{14}\cellrow{15}\cellrow{16}\cellrow{17}}}} % removed \vfill +% % from the end +% +%======================================================================== +% table ends +%======================================================================== +% +%======================================= + +\beginsection The necessary \MF\ files + +The whole process started when the first author had a paper +containing \APL\ symbols and was disappointed with the +quality of the symbols available on the typewriter. Moreover, +the secretary who had typed in the text had forgotten a couple +of lines in the middle of the paper, and the correction of +such mistakes seemed to be very clumsy in comparison with +modern typesetting. Then he decided (together with the second +author) to remedy the situation by creating an \APL\ font for +\TeX\ he was using for other kinds of document. Many of the +\APL\ symbols needed were contained in standard fonts; for example, +{\it diamond\/} can be found in {\it cmsy10}. For alphanumeric +characters one could use {\it cmsltt10}. The simplest try for +a solution of the problem would be to write a list of definitions +that pick symbols from appropriate fonts. However, this brute force +method does not really work since these symbols come from +very different typefaces and, moreover, do not provide a fixed +typeface. Hence, we decided to find an easy way of producing +an \APL\ font by using \MF. + +As the starting point, we took the font {\it cmtex10}. This is a +fixed typeface for an extended typewriter-like font including +some Greek characters and mathematical symbols. The \MF\ file +for this font, {\sltt cmtex10.mf} contains (as usual) a preamble +that assigns values to several global variables, and the command +{\sltt generate textset;}. Now the {\bf driver} file {\sltt textset.mf} +contains the commands {\sltt mode\_setup;font\_setup;} +(establishing the values of the variables for this font) and several +input files from which the \MF\ descriptions of the characters are to +be found. Since some of these files treat the characters by name and +since some of the definitions have to be changed (and some dropped), +we considered it advisable to discard the driver file and to collect +the separate \MF\ files, together with the preamble, to form a +large single file {\sltt cmapl10.mf}. The {\sltt .mf} character files +needed for {\sltt cmapl10.mf} are the following: +% +% +$$\vbox{\halign{{\sltt#}\hfil && \quad #\hfil\cr +% + greekl & (rho,omega,alpha) \cr + italms & (iota) \cr + romand & (roman digits) \cr + punct & (punctuation symbols) \cr + romanp & \cr + symbol & (math symbols) \cr + sym & \cr + romanu & (upper case letters) \cr + romanl & (lower case letters) \cr +% +}}$$ +% +%===================== + +\beginsection Definitions + +%\choosett{tentt}% +%The first thing to do is to put {\sltt font\_identifier:="CMAPL";} +%and to set {\sltt slant:=0;} in the preamble. Many definitions can +%be copied verbatim from the {\sltt .mf} files, but some of them +%need changes. The Greek {\it iota}, as given in {\sltt greekl.mf}, +%is strange to \APL\ style; we use instead the {\it dotless i\/} +%from {\sltt italms.mf}. Moreover, we used the symbol {\it elt\/} +%(element) from {\sltt sym.mf} instead of the Greek epsilon. +%The symbols {\it del\/} and {\it delta\/} are +%taken from {\sltt symbol.mf} (where their names are {\it large triangle\/} +%and {\it large inverted triangle\/}). However, they are too sturdy +%and too short to be placed in a proper \APL\ font. Further, {\it del\/} +%must be lifted up so that it is vertically aligned with other +%symbols. The modifications are very easy to do, and the modified +%definition is shown below. +\choosett{sltt}% +First, put @font_identifier:="CMAPL";@ +and set @slant:=0;@ in the preamble. Many definitions can +be copied verbatim from the @.mf@ files, but some of them +need changes. The Greek {\it iota}, as given in @greekl.mf@, +is strange to \APL\ style; we use instead the {\it dotless i\/} +from @italms.mf@. Moreover, we used the symbol {\it elt\/} +(element) from @sym.mf@ instead of the Greek epsilon. +The symbols {\it del\/} and {\it delta\/} are +taken from @symbol.mf@ (where their names are {\it large triangle\/} +and {\it large inverted triangle\/}). However, they are too sturdy +and too short to be placed in a proper \APL\ font. Further, {\it del\/} +must be lifted up so that it is vertically aligned with other +symbols. The modifications are very easy to do, and the modified +definition is shown below. +% +% +\choosett{tentt} +%\begintt +% % sqrt48 was changed to 6.25 since the del symbol in APL has +% % a narrower top than the original reversed triangle symbol +% % rule.nib has been changed to light_rule.nib +% % bot y3=-d-o has been changed to y3=0 +% % top y1=h-d has been changed to top y1=h+2o +% @null +% cmchar "Del"; +% beginchar(oct"002",16u#,asc_height#,0); +% adjust_fit(0,0); pickup light_rule.nib; +% top y1=h+2o; y2=y1; bot y3=0; +% .5[x1,x2]=x3=good.x .5w; w:=r:=2x3; lft x1=hround(.5w-u*6.25); +% draw z1--z2--z3--cycle; % stroke +% labels(1,2,3); endchar; +%\endtt +\begintt + % sqrt48 was changed to 6.25 since the + % Del symbol in APL has a narrower top + % than the original reversed triangle + % symbol + % rule.nib has been changed to + % light_rule.nib + % bot y3=-d-o has been changed to y3=0 + % top y1=h-d has been changed to + % top y1=h+2o + @null + cmchar "Del"; + beginchar(oct"002",16u#,asc_height#,0); + adjust_fit(0,0); pickup light_rule.nib; + top y1=h+2o; y2=y1; bot y3=0; + .5[x1,x2]=x3=good.x .5w; w:=r:=2x3; + lft x1=hround(.5w-u*6.25); + draw z1--z2--z3--cycle; % stroke + labels(1,2,3); endchar; +\endtt +As can be seen from this example, the pen strokes were made thinner. +Actually only one symbol was directly missing\Dash this is the {\it quad +box}. However, it can be obtained from the above by adding one control point: +\begintt + cmchar "Quad"; + beginchar(oct"001",16u#,body_height#,0); + adjust_fit(0,0); pickup light_rule.nib; + bot y1=0; y2=y1; top y3=h+2o; y4=y3; + .5[x1,x2]=x5=good.x .5w; w:=r:=2x5; + % The quad box is slightly wider than Del + lft x1=hround(.5w-u*7); + x3=x1; x4=x2; + draw z1--z2--z4--z3--cycle; % box + labels(1,2,3,4); endchar; +\endtt +\choosett{sltt}% +After taking care of the special symbols, the letters can be treated +by finding a suitable value for {\it tilt ratio\/} (slant). Indeed, +\APL\ letters are {\bf very} slanted. We suggest the value 1/5 for +this font (the font {\it cmsl10\/} uses 1/6). One should remember to +%give the command {\sltt font\_setup;} after setting {\sltt slant} to 1/5. +give the command @font_setup;@ after setting @slant@ to 1/5. +Finally, one has to make the {\it verbatim\/} macros +suitable for \APL\ style. Since {\it verbatim\/} might be +used for several different fonts in one document, we decided +to include a control sequence @\choosett@. + +\choosett{tentt} + +\begintt + \def\ifundefined#1{\expandafter + \ifx\csname#1\endcsname\relax} + \outer\def\choosett#1{\ifundefined{#1} + \message{Undefined font(?), + replaced with cmtt10} + \let\tt=\tentt + \else + \def\tt{\expandafter + \csname#1\endcsname}\fi} +\endtt +\choosett{sltt}% +(The control sequence @\ifundefined@ comes from the \TeX{book}, p.\ 308.) +With the help of @\choosett@, the standard @verbatim@ macro can be used +without changes. + +The \APL\ symbols not in the font table are obtained\Dash as usual\Dash by +overstriking two table symbols. +\choosett{tentt}% +\begintt + \newskip\charwidth + \def\overstrike#1#2{\setbox0=\hbox{#1}% + \charwidth=\wd0 #1\hskip-\charwidth#2} +\endtt +\choosett{apl}% +For example, the {\it grade up\/} and {\it grade down\/} symbols +\GU\ and \GD\ are obtained by striking the {\it stile\/} symbol +% @|@ over \DL\ and \LD, respectively. % | is usual TUGboat verbatim character +\vrt\ over \DL\ and \LD, respectively. +\choosett{tentt}% +\begintt + \def\GU{\overstrike{\DL}{\AB}} % grade up + \def\GD{\overstrike{\LD}{\AB}} % grade down +\endtt +Now let us take another example of \APL\null. %The input +Figure~1 shows some input and the resulting output. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% removed to end of file for single-column presentation. bb +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%======================= +% +\beginsection User extension + +A modern user of a computerized typesetting facility will probably +ask if it is possible to extend or modify fonts coming with the +system. As with [5], where the font has an {\it analytic\/} and a +{\it bitmapped\/} variant, we can distinguish between the need of modifying +{\it cmapl10\/} via \MF\ and modification of the pixel files. +\APL\ symbols of various ``blackness'' or ``thickness'' may be desirable. +Indeed, in [3] the user input is written with boldface \APL\ symbols +and the answers from the interpreter with thin ones. Furthermore, +certain screen previewers use specific small size pixel files, and +do not support the \APL\ font. + +The modification of the font by changing the values of some global +variables in the preamble of the \MF\ file is easy and can be +done by following how it is done in standard fonts such as +{\it cmbx10\/} etc. This is the recommended way, too. However, if +\MF\ is not available, then one must attack the pixel files. +For direct hand editing, we use a program that converts a pixel +file into a (bitmapped) text file acceptable to any standard screen +editor, and another program reading the edited file back into +a \TeX\ pixel file. Scaling fonts down to a desired size can be +done in a similar (but automatic) manner; this facility is needed +by a previewer (written by the first author) not using runtime +scaling. + + +%=================== +\beginsection References + +{ +\ref Digital Equipment Corporation: VAX-11 \APL\ Reference Manual.- + 1983. + +\ref Feldberg, Ian: TEXT: Publication-Quality Characters Come + To \APL\ Graphics.- Proceedings of the 1986 \APL\ Conference, + SIGAPL, pp.\ 306 -- 313. + +\ref Gilman, Leonard, and Allen J.\ Rose: \APL, An Interactive + Approach.- John Wiley \& Sons, Inc., 1984. + +\ref Grenander, Ulf: Mathematical Experiments on the Computer.- + Academic Press, 1982. + +\ref Howland, John E.: Typesetting \APL\ using a Macintosh.- + Proceedings of the 1986 \APL\ Conference, SIGAPL, pp.\ 301 -- 305. + +\ref Iverson, Kenneth: A Programming Language.- Wiley, New York, 1962. + + } + +%==================== +\beginsection The address + +\parindent=\normalparindent +\TextAddr University of Helsinki + Department of Mathematics + Hallituskatu 15 + SF--00100 HELSINKI + FINLAND< + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newpage\onemedium +\global\advance\pageno by-1 + +\beginsection Figure 1. An \APL\ example + +The input +% \setbox0=\vbox{\hsize=5.7truein +\begintt + \choosett{apl} + \setbox0=\vbox{\hsize=5.5truein + \begintt + [0] Z_A1 PROD A2;A;I;V + [1] "RETURNS THE PRODUCT OF THE POLYNOMIALS A1 AND A2 + [2] "THE ARGUMENTS ARE GIVEN AS COEFFICIENT ARRAYS + [3] I_@@RO~A1 + [4] Z_A1@@SO.#A2 + [5] LOOP:V_@@RO~Z @@DM V[(@@RO~I)+1]-1 + [6] V_@@RO~Z_Z,[(@@RO~I)+1]V@@RO0 + [7] A_(1+-@@IO~V[1])@@SO.#((@@NT(@@IO@@RO~V)@@EP(1,(@@RO~I)+1))/V)@@RO1 + [8] Z_+/[1]A@@RV[(@@RO~I)+1]Z + [9] ((@@RO@@RO~Z)>@@RO~I)/LOOP + @endsym + } + $$\boxit{\boxit{\box0}}$$ + \centerline{\sevenrm An APL function for polynomial multiplication} +\endtt +gives the output +\smallskip +\choosett{apl} +\setbox0=\vbox{\hsize=5.5truein +\begintt + [0] Z_A1 PROD A2;A;I;V + [1] "RETURNS THE PRODUCT OF THE POLYNOMIALS A1 AND A2 + [2] "THE ARGUMENTS ARE GIVEN AS COEFFICIENT ARRAYS + [3] I_@RO~A1 + [4] Z_A1@SO.#A2 + [5] LOOP:V_@RO~Z @DM V[(@RO~I)+1]-1 + [6] V_@RO~Z_Z,[(@RO~I)+1]V@RO0 + [7] A_(1+-@IO~V[1])@SO.#((@NT(@IO@RO~V)@EP(1,(@RO~I)+1))/V)@RO1 + [8] Z_+/[1]A@RV[(@RO~I)+1]Z + [9] ((@RO@RO~Z)>@RO~I)/LOOP +\endtt + } +$$\boxit{\boxit{\box0}}$$ +\centerline{\sevenrm An APL function for polynomial multiplication} + +\endgroup % end isolation of this article + +\newpage +\twocol + +\endinput |