                                   ANNEXES


      Visage front-end for j on NeXT
      Graphics for J under X11
      j-mode.el
      j-interaction-mode for gnu emacs
      Eliza in J, revised


*========================================
# Visage front-end for j on NeXT

+------------------
| Tom Affinito
| <1970@rosie.NeXT.COM> 4 Oct 91


I have put two NeXT packages on the archive sites for purdue and
oregon state (nova.cc.purdue.edu, cs.orst.edu).

j.pkg.tar is a package file format of j version 3.2; this is just the
same as the waterloo distribution, but NeXT .pkg files automatically
unthaw their stuff into the right hierarchy positions in /usr/local.

More interesting is Visage.pkg.tar, which is a multi-document text
editor, command streamer front-end to the j interpreter. This is
similar to the Yap environment for PostScript programming on the
NeXT, or the MacScheme environment on the Macintosh. The greatest
benefit is a window which turns j output strings which begin with
flag characters into actual PS graphics; ie, j functions can produce
ASCII PS code and stream it to the window to look at it.

Feel free to download these programs, or upload them onto other
sites. Visage is free, but requires a j interpreter in
/usr/local/bin, the status file saved as /usr/local/doc/j/status.doc
(for the Help system).

j.pkg.tar is equivalent to the waterloo/ISI v3.2 system, configged
for the NeXT, and is under the ISI policy found in the packaged
information.



*========================================
# Graphics for J under X11

+------------------
| Sam Sirlin
| <1991Apr24.183906.14541@jato.jpl.nasa.gov>

Here's a translation of some code I use for graphs on PC's using
STSC's APL's. It's intended for workstations running X11. You can
do graphics using either xterm, or by remote login using PC Kermit
(which can automatically emulate a tektronix 4010). Under xterm, the
tektronix window opens up automatically, but doesn't close after
you leave J (sigh!). I don't claim that the code is the best that could
be done. I tried as simple a translation as I could.

I noticed that comments in functions are tricky in J, requiring large
quantities of quotes, especially for contractions within comments. I
prefer lamp. The hardest part, however, was changes for the scoping
and indexing.


+------------------
| Raul Rockwell
| <24APR91.20363659@uc780.umd.edu>

Samuel Sirlin writes:
>I noticed that comments in functions are tricky in J, requiring large
>quantities of quotes, especially for contractions within comments. I
>prefer lamp.

You can get around some of those quotes with a construct like:

+------------------------------
]$.=.start
]
]  comments
]
]start)
]


Though you do have to follow quoting and spelling rules.  (and maybe
parenthization rules -- I haven't played around with this much, yet).

You can get around the contraction problem by not using contractions,
or using backquote, can`t you?

+------------------
| Sam Sirlin
| <1991Apr25.151215.224@jato.jpl.nasa.gov>

(regarding Raul Rockwell's points [rn's not as good as xrn])
I think your branch around initial comments won't stop the parser from
looking at the comment lines at the definition phase, so I suspect
that function definition would fail without matching ''s or maybe bad
tokens, though maybe you don't need a quoted string... It might also
run faster than just running through the quotes at each invocation...
On the other hand, I think any readable programming style should use
comments sprinkled throughout a program, and this would be contorted
using branching all the time. By making it cumbersome, J seems to be
designed to discourage comments. Backquote is a good idea for
contractions.

+------------------
| Sam Sirlin
| <1991Oct22.192547.8639@csi.jpl.nasa.gov>


This script works in J using as a terminal:
1. an xterm under xwindows
2. an ibm clone  pc running kermit

It can graph a set of functions of one variable, generating 4010 move
and draw commands (which can be writen to a file for printing if you
have tek2ps or some such).

[[ NB. sws.  see separate file draw.js ]]


*========================================
# j-mode.el

+------------------
| Raul Rockwell
| <ROCKWELL.91Jul28013541@socrates.umd.edu>

This article contains a copy of my j-mode.el, which allows some of the
more sophisticated commands in gnu-emacs to work gracefully with j
scripts.   I've copylefted it because (a) it is for general use, and
(b) it is almost totally worthless without gnu-emacs.

If you've been using emacs with j, and have been finding that it
annoyingly brain-dead, you'll probably find this package useful.

If anyone has comments on things they'd like to see, let me know, and
I'll see what I can do.

Finally note that this j-mode is totally independent of the
j-interaction-mode by Michael J Berry <mjab@think.com>.  If there is
demand, I'm sure Mr. Berry or I could integrate the two packages so
that that session manager is more cognizant of j style.

+------------------
| Raul Rockwell
| <ROCKWELL.91Jul25090954@socrates.umd.edu>

Some time back, somebody posted a "j interaction mode" for gnu-emacs.
I was wondering if somebody could point me at it?

[[NB. apd. see next subject]]

I've been throwing together a mode for editting J scripts (that
respects J syntax for movement commands, and so on), and I was
wondering if I shouldn't integrate some of these features into the
interaction mode.  (I thought I saved a copy of that posting, but I
haven't been able to find it).

Thanks


+------------------
| Raul Deluth Miller-Rockwell
| 27 May 92

About emacs-lisp stuff:
 I use j-mode, occasionally.  I've not been using j-interaction mode
 (I just use shell-mode).  More work needs to be done on this, and it
 should probably be considered a separate work.  [In other words,
 don't bother including it with the rest of the J code, except for a
 few excerpts indicating the techniques used, which should also let
 people know of the existence of these things.]

 I like to think that I'm waiting for version 19 of emacs to be
 released -- that way I'm not just procrastinating on getting this
 spiffed up.

[[NB. sws.  see seperate file "rrjmode.el"]]


*========================================
# j-interaction-mode for gnu emacs

+------------------
| Michael J. A. Berry
| <MJAB.91Mar7142223@nanna.think.com>

The following code provides a session manager for J. It lets you edit J
functions, adverbs, and conjunctions in their own buffers.  In the case of
a verb, you get two buffers -- one for the monad, one for the dyad.  In a J
definition buffer each line of the buffer contains a single statement.
gmacs does all the quoting, boxing, and what have you so you just see the
unencumbered definitions.  There are also emacs commands for loading and
saving the workspace and listing the objects by name class.  You can also
execute a J expression with result going into the current buffer (great for
inserting examples into documentation).

All the editing functions assume that a J is running.  You can start one up
using run-j or run-remote-j.  These functions should be autoloaded in your
.emacs file like this:

(autoload 'run-j "j-interaction-mode" "run J on your local machine" t)
(autoload 'run-remote-j "j-interaction-mode" "run J on your local machine" t)

+------------------
| Michael J. A. Berry
| <MJAB.91Mar22145151@nanna.think.com>

The initial posting had a problem sending long lines to the J process.
On my particular unix system it was failing for lines over 255 in length.
This version works with lines up to the J line limit which in version 2.9
is around 480.  I have it on good authority that this limit will go away in
later versions of J, so the codes posted here should work for longer input
lines soon.

+------------------
| Michael J. A. Berry
| <MJAB.91Sep20134504@thoon.think.com>

A while ago, I posted a J interaction mode for gnu emacs.  Spelling changes
in J 3.2 made it stop working.  This version works with J 3.2.

This version also incorporates a J-mode contributed to comp.lang.apl by
Raul D Rockwell  <rockwell@socrates.umd.edu>.  This makes reasonable
syntax table entries for J characters and adds some functions useful
for editing J script files.

Thanks to Eythan Weg <weg@mace.cc.purdue.edu> for bringing it to my
attention that j-interaction-mode was no longer working.

This file is available for anonymous ftp from think.com in
/public/pub/j/gmacs/j-interaction-mode.el

I am more likely to update the file there than I am to repost it.

+------------------
| Michael Berry
| <9206241403.AA08698@clarence.think.com>

My J-interaction mode runs with J version 3.2.  I have not yet tried it
with any later version.  Has J 4.1 changed the syntax of defining verbs,
adverbs, and conjunctions via : ?  If not, it should still work.  I will
attempt to get ahold of 4.1 and test it.

By all means, feel free to include the J interaction mode in your
collection. Judging from mail I have received from several countries in
Europe and North America, people are actually using it. I, on the other
hand, haven't had much chance to play with J this year :-(.

[[NB. sws.  see seperate file "mbintem.el" ]]


*========================================
# Re: Eliza in J, revised

+------------------
| L.J.Dickey
| <1991Feb19.023535.3612@watmath.waterloo.edu>

This is a re-submission of a J program from Richard L.W. Brown of
York University in Toronto.  He wrote it as an exercise in learning
to program in J and he has consented to its being posted to Usenet.
You might find it instructive too.  I saved the stuff below the
line in a file called 'eliza' and gave the commands:

    J
    )script 'eliza'
    eliza ''

The command     )sscript 'eliza'    may be used
instead of  )script 'eliza'     for a less verbose startup.

Lee Dickey

[[NB. sws.  ")" commands have been removed. Now you should use
  something like:

   script=. 0!:2 &<
   sscript=. 0!:3 &<

   script 'eliza.js'
   eliza ''

NB. sws.  see separate file eliza.js]]


 