<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//en">

<!–Converted with LaTeX2HTML 2022 (Released January 1, 2022) –> <HTML lang="en"> <HEAD> <TITLE>Contents of Typesetting Functions</TITLE>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <META NAME="viewport" CONTENT="width=device-width, initial-scale=1.0"> <META NAME="Generator" CONTENT="LaTeX2HTML v2022">

<LINK REL="STYLESHEET" HREF="apl_tug.css">

<LINK REL="next" HREF="node7_mn.html"> <LINK REL="previous" HREF="node5_mn.html"> <LINK REL="up" HREF="node4_mn.html"> <LINK REL="next" HREF="node7_mn.html"> </HEAD>

<BODY bgcolor="#ffffff" text="#000000" link="#9944EE" vlink="#0000ff" alink="#00ff00">

<H2><A ID="SECTION00042000000000000000"> Typesetting <IMG STYLE="height: 39.24ex; vertical-align: 139.30ex; " SRC="img1.png" ALT="APL"> Functions</A> </H2>

<P> The following <I>APL</I> function is printed in del-editor style:

<P> <FONT SIZE="+2"> <BR> <IMG STYLE="" SRC="img9.png" ALT="
\begin{APLfns}
\begin{APLfnsline}{}{\APLdel}
\APLZ\APLleftarrow\APLM\APLE\APLA\A...
...\APLX
\end{APLfnsline}\begin{APLfnsline}{}{\APLdel}
\end{APLfnsline}\end{APLfns}
"> <BR></FONT>

<P> A larger font has been selected by inserting the generated code into a <code></code> environment:

<P> <PRE>
\begin{APLfns}
\begin{APLfnsline}{}{\APLdel}
\APLZ\APLleftarrow\APLM\APLE\APLA\A...
...}\begin{APLfnsline}{\APLleftbracket\APLone
\APLrightbracket}{}
...
\end{APLfns}
</PRE>

<P> The canonical representation of an <I>APL</I> function is simply a text matrix. Since older <I>APL</I> systems only provide arrays of uniform datatype and rectangular shape, padding of short lines with spaces is performed. In contrast to the del-editor style, the canonical representation is typeset like an <I>APL</I> array with fixed spacing and without line numbering. For the

canonical representation of a small typewriter type style was chosen:

<P>

<FONT SIZE="-1"><TT> <BR> <IMG STYLE="height: 8.32ex; vertical-align: 170.07ex; " SRC="img10.png" ALT="
\begin{APLcr}
\leavevmode\hbox to 1.2em{\hss\APLZ\hss}\leavevmode\hbox to 1.2em{...
...ss\APLrho\hss}\leavevmode\hbox to 1.2em{\hss\APLX\hss}
\APLspace\par
\end{APLcr}
"> <BR></TT></FONT>

<P> You notice immediately that we have used the L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X commands <code></code> and <code></code> to produce this effect:

<P> <PRE>
\begin{APLcr}
\APLmb{\APLZ}\APLmb{\APLleftarrow}
\APLmb{\APLM}\APLmb{\APLE}
\APLmb{\APLA}\APLmb{\APLN}
\APLmb{\APLspace}\APLmb{\APLX}
\APLspace\par
...
\end{APLcr}
</PRE>

<P> In addition to the del-editor representation and the canonical representation of an <I>APL</I> function we provide means for formatting direct definitions of functions, which are supported by only a few <I>APL</I> dialects, e.g. I&ndash;<I>APL</I>:

<P> <BR> <IMG STYLE="height: 2.66ex; vertical-align: 175.74ex; " SRC="img11.png" ALT="
\begin{APLline}
\APLf\APLi\APLb\APLcolon\APLspace\APLz\APLcomma\APLplus\APLslash...
...Lspace
\APLomega\APLequal\APLone\APLspace\APLcolon\APLspace\APLone
\end{APLline}
"> <BR>

<P> This direct definition of a function computing Fibonacci numbers is due to [<A HREF="node11_ct.html#Iverson87" TARGET="contents">Iverson 87</A>] and has been formatted as follows:

<P> <PRE>
\begin{APLline}
\APLf\APLi\APLb\APLcolon\APLspace\APLz
\APLcomma\APLplus\APLslash
\APLoverbar\APLtwo\APLuparrow\APLz
...
\end{APLline}
</PRE>

<P> Note, that the <TT>APLline</TT> environment allows ligatures within names.

<P>

<HR>

</BODY> </HTML>