Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!nott!uotcsi2!news
From: cbbrowne@csi.uottawa.ca (Christopher Browne)
Subject: J Command Summary Version 2.0
Message-ID: <1993Mar29.042009.27038@csi.uottawa.ca>
Keywords: J, LaTeX
Sender: news@csi.uottawa.ca
Nntp-Posting-Host: prgb
Organization: Dept. of Computer Science, University of Ottawa
Date: Mon, 29 Mar 93 04:20:09 GMT


The handy-dandy LaTeX formatted reference card for J.

This version has a variety of improvements; it includes a bunch of
stuff that I mentioned in an earlier post (and don't feel like
enumerating right now :-().

It now requires two .sty files; fancyheadings.sty and (as before)
fullpage.sty.  I've sent copies of everything to L. Dickey, and so it
should shortly be available at the APL archives on
watserv1.waterloo.edu.

For those that don't feel like installing LaTeX just to do up two
pages of material, a PostScript version is quite available.  I'll
break it into two files of a page each, for the simple reason that
mailers tend to "barf" on it otherwise.

To those that might want an ASCII version; look in the J distribution
for a file called J.HLP.  (It may be unique to the IBM PC version.)
It's exactly 10000 bytes long.  If you add a carriage return every 80
characters (easy under Emacs or other editors that allow programmable
macros), it'll produce a nice ASCII listing that's faintly similar.

Without further ado:
------------------ Set Phasers on "Cut here" -------------------------
\documentstyle[fullpage,fancyheadings]{article}
\pagestyle{fancy}                    % Requires fancyheadings style
\begin{document}
% J Language Summary
% March 23rd, 1992 by Christopher B. Browne
% Ottawa, Ontario
% This file may be freely redistributed.
% Changes/Corrections ought to be sent to Christopher Browne
% at either: cbbrowne@csi.uottawa.ca, or aa454@freenet.carleton.ca
% \lhead, \rhead, \lfoot, \rfoot require fancyheadings.sty
% The LaTeX book describes how the headers can be set/reset, but
% does NOT have equivalent commands to do footers.  TeX allows it,
% but there aren't any appropriate commands in LATEX.TEX.  And
% hacking them in would be FAR nastier than the "hack" of requiring
% fancyheadings.sty
\lhead{J Language Reference} \rhead{Version 6.2}
\lfoot{March 23, 1993} \rfoot{by Christopher B. Browne}

\eject   % As suggested by LJ Dickey

% Short forms for common macros
\def\bs{\backslash}    % Only used once for the prefix/infix operator
\def\df{\dotfill}      % Fill space with dots
\def\na{$\not\exists$} % Unimplemented function - i.e. Does not exist
\def\pc{\df {\sf PC}}  % IBM PC only

\begin{table}[h]
\caption{Vocabulary List}
\begin{center}
\begin{tabular}{||l|c|c|c|r||} \hline \hline
OP        & OP $y$ \df $x$ OP $y$                       &  OP. $y$ \df $x$ OP. $y$          & OP: $y$ \df $x$ OP: $y$       & Page  \\ \hline
=         & $y=y^{t}$ \df $x=y$                         &  Is (Local) \df                   & Is (Global) \df               &  71   \\
$<$       & $\Box y$ \df $<$                            &  $\lfloor x\rfloor$ \df $\min{}$  & $y--$ \df $x \leq y$          &  71   \\
$>$       & Open $\Box$ \df $>$                         &  $\lceil x \rceil$ \df $\max{}$   & $y++$\df $x \geq y$           &  72   \\
\_        & $-y$ \df $\infty$                           &  Indeterminate \df \na            & $\infty$ \df                  &  72   \\
+         & $\bar{y}$ \df $x+y$                         &  Real/Imag \df GCD (Or)           & $2 y$ \df NOR                 &  73   \\
$\star$   & $sgn(y)$ \df $x \times y$                   &  Polar \df LCM (And)              & $y^2$ \df NAND                &  73   \\
$-$       & $-y$ \df $x-y$                              &  Not (1-) \df Less                & $y/2$ \df Match               &  73   \\
\%        & $\frac{1}{y}$ \df $x/y$                     &  Mat $y^{-1}$ \df Mat $x\div y$   & $\sqrt{y}$ \df $\sqrt[x]{y}$  &  74   \\
\^{}      & $e^y$ \df $x^y$                             &  $\ln{x}$ \df $\log_{x}{y}$       & \df $x^{y}(z)$ \df Chain      &  75   \\
\$        & Shape \df Shape                             &  Suite \df                        & Self-Reference \df            &  75   \\
\~{}      & Both \df Cross                              &  Nub \df                          & Nub Sieve \df Not-Equal       &  76   \\
$|$       & $|y|$ \df $y (\hbox{mod} x)$                &  Reverse \df Rotate $y$ by $x$    & $y^{T}$ \df Axis Transpose    &  77   \\
.         & $\det{y}$ \df $x \cdot y$                   &  \df Even                         & \df Odd                       &  78   \\
:         & \df Explicit Def'n                          &  \df Obverse                      & \df Adverse                   &  78   \\
,         & Ravel \df Append                            &  Ravel \df Items                  & Itemize \df Laminate          &  80   \\
;         & Raze \df Link                               &  \df Cut (;.3, ;.\_3 \na)         & Formation \df                 &  81   \\
\#        & Tally \df Copy                              &  $y_{2}$ \df $y${Base}$_{x}$      & Antibase 2 \df Antibase       &  83   \\
!         & $y!$ \df $\left( x \atop y \right)$         &  Customize \df                    & \df Foreign                   &  84   \\
/         & Insert \df Table                            &  Oblique \df Key                  & Grade Up \df Sort             &  84   \\
$\bs$     & Prefix \df Infix                            &  Suffix \df Outfix                & Grade Down \df Sort           &  86   \\
$[$       & Same \df Left                               &  Lev \df                          & Same \df                      &  87   \\
$]$       & Same \df Right                              &  Dex \df                          & Same \df                      &  87   \\
\{        & Catalog \df From                            &  Head \df Take                    & Tail \df                      &  88   \\
\}        & Amend \df                                   &  Behead \df Drop                  & Curtail \df                   &  88   \\
"         & \df Rank                                    &  Do \df Do Left If Error          & \df Format                    &  89   \\
`         & \df Gerund                                  &  \df                              & \df Evoke Gerund              &  91   \\
@         & \df Atop                                    &  \df Agenda                       & \df At                        &  91   \\
\&        & Bond \df Compose                            &  \df Under (Dual)                 & \df Appose                    &  91   \\
?         & Roll \df Deal                               &                                   &                               &  92   \\
\hline
\end{tabular}
\end{center}
\end{table}

\begin{table}[h]
\caption{Special vocabulary}
\begin{center}
\begin{tabular}{||c|l||c|l|c||l|r||} \hline \hline
OP & Description & OP & Description & OP & Description & Page \\ \hline
$)$  &  Label \df                           &  a.  &  Alphabet \df                       & A.  & Atomic Permute \df            & 92    \\
b.   &  Boolean \df                         &  c.  &  Characteristic \df \na \df         & C.  & Cycle-Direct \df Permute      & 93    \\
e.   &  Raze In \df Member (In)             &  E.  &  \df Member of Interval             & f.  & Fix              \df          & 95, 96 \\
i.   &  Integers \df Index Of               &  j.  &  Imaginary \df Complex              & NB. & Comment        \df            & 96    \\
o.   &  $\pi \times y$ \df Circular fun.    &  p.  &  Polynomial \df $P_{x}(y)$ \df \na  & r.  & Angle \df Complex             & 96, 97 \\
x.   &  Left Argument \df                   &  y.  &  Right Argument \df                 & 0:  & Zero         \df              & 97    \\
1:   &  One \df                             &  D.  &  $\frac{d^{n}F(x)}{dx^{n}}$ \df     &     &                               & 97 \\
\hline
\end{tabular}
\end{center}
\end{table}


\begin{table}[h]
\caption{Circular/Hyperbolic/Pythagorean Functions}
\begin{center}
\begin{tabular}{||r|l|r|l||} \hline
$k$ & Function  & $k$ & Function \\ \hline
0 & $\frac{1}{1 - y^{2}}$    &     9     & $ \frac{y + \bar{y}}{2}$     \\
1 & $\sin{y}$                &     10    & $ | y | $                    \\
2 & $\cos{y}$                &     11    & $ \frac{y - \bar{y}}{(0,2)} $ \\
3 & $\tan{y}$                &     12    & $ \ln{e^{y}}/(0,1)$          \\
4 & $\frac{1}{1+y^{2}}$      &     \_$k$ & $k o.^{-1} y$                \\
5 & $\sinh{y}$               &     \_1   & $ \arcsin{y} $               \\
6 & $\cosh{y}$               &     \_4   & $ \sqrt{1+y^{2}}$            \\
7 & $\tanh{y}$               &     \_9   & $y$                          \\
8 & $\sqrt{-1-y^{2}}$        &     \_10  & $\bar{y}$                    \\
\hline
\end{tabular}
\end{center}
\end{table}

Where trigonometric arguments are always in radians.\\                   
E.g: {\tt 3 o. 3.1415926 0 7.8539816} $= (\tan{\pi}, \tan{0}, \tan{      
\frac{5} {2} \pi}) = (0, 0, -\infty)$                                    

\begin{table}[h]
\caption{Foreign Conjunctions}
\begin{center}
\begin{tabular}{||r|l||r|l||r|l||}
\hline
Conj.    &    Description            &     Conj.    &      Description          &     Conj.     &     Description           \\ \hline
0!:0     &    Host                   &     2!:55    &    WS Erase Object        &      7!:2     &    Space to Execute       \\
0!:1     &    Host (No Result)       &     3!:0     &    Internal Type          &      8!:0     &    Qry CGA Mode     \pc   \\
0!:2     &    Script                 &     3!:1     &    To   Internal Rep      &      8!:1     &    Set CGA Mode     \pc   \\
0!:3     &    Silent Script          &     3!:2     &    From Internal Rep      &      8!:4     &    Qry Screen Attr  \pc   \\
0!:4     &    Lines                  &     4!:0     &    Name Class             &      8!:5     &    Set Screen Attr  \pc   \\
0!:5     &    Silent Lines           &     4!:1     &    Name List              &      8!:7     &    Refresh Screen   \pc   \\
0!:55    &    Terminate Session      &     4!:55    &    Erase                  &      8!:9     &    Edit             \pc   \\
1!:1     &    File Read              &     4!:56    &    Erase Given Name       &      9!:0     &    Qry Random Link        \\
1!:2     &    File Write             &     5!:0     &    Fix                    &      9!:1     &    Set Random Link        \\
1!:3     &    File Append            &     5!:1     &    Atomic  Rep            &      9!:2     &    Qry Display Reps       \\
1!:4     &    File Size              &     5!:2     &    Display Rep            &      9!:3     &    Set Display Reps       \\
1!:11    &    File Indexed Read      &     5!:3     &    String  Rep            &      9!:4     &    Qry Prompt             \\
1!:12    &    File Indexed Write     &     5!:4     &    Tree    Rep            &      9!:5     &    Set Prompt             \\
1!:55    &    File Erase             &     5!:5     &    Linear  Rep            &      9!:6     &    Qry Box Chars          \\
2!:0     &    WS Name Class          &     6!:0     &    Time Now               &      9!:7     &    Set Box Chars          \\
2!:1     &    WS Name List           &     6!:1     &    Time Since Start       &      9!:8     &    Qry Error Msgs         \\
2!:2     &    WS Save                &     6!:2     &    Time to Execute        &      9!:9     &    Set Error Msgs         \\
2!:3     &    WS PSave               &     6!:3     &    Delay                  &      10!:k    &    (LinkJ) C Function     \\
2!:4     &    WS Copy                &     7!:0     &    Space Now              &      128!:0   &    QR Decomposition       \\
2!:5     &    WS PCopy               &     7!:1     &    Space Since Start      &      128!:1   &    Invert matrix          \\
\hline
\end{tabular}
\end{center}
\end{table}

\begin{table}[h]
\caption{Alternative Spellings}
\begin{center}
\begin{tabular}{||c|c|c|c||c|c|c|c||}
\hline \hline
Char   &       &  .     &   :   &   Char &       &  .     &   :    \\ \hline
  @    &  AT.  &  AT1.  &  AT2. &  \#    &  NO.  &  NO1.  &  NO2.  \\
$\bs$  &  BS.  &  BS1.  &  BS2. &  $]$   &  RB.  &  RB1.  &  RB2.  \\
 \^{}  &  CA.  &  CA1.  &  CA2. &  $\}$  &  RC.  &  RC1.  &  RC2.  \\
  `    &  GR.  &  GR1.  &  GR2. &  \$    &  SH.  &  SH1.  &  SH2.  \\
 $[$   &  LB.  &  LB1.  &  LB2. &  $|$   &  ST.  &  ST1.  &  ST2.  \\
 $\{$  &  LC.  &  LC1.  &  LC2. &  \~{}  &  TI.  &  TI1.  &  TI2.  \\
\hline \hline
\end{tabular}
\end{center}
\end{table}
\end{document}

-- 
Christopher Browne                |     PGP 2.0 key available
cbbrowne@csi.uottawa.ca           |======================================
University of Ottawa              | Genius may have its limitations, but
Master of System Science Program  | stupidity is not thus handicapped.
