Here is the documentation for keyed file and miscellaneous
verbs which will appear in the version of J which will be
put at watserv1. The implementation is complete. I am
working on the makefiles.
Also, here is a list of things going on with J.
1. David Steinberg has completed his tree structure
verbs and will be introducing his enhanced version
of J at APL93. My understanding is that he uses these
verbs for the computerized musical composing and he
is entertaining the idea of going commercial with
his product.
2. Joey Tuttle will be introducing a version of J which
understands English at APL93.
3. David Gurr has several projects in mind but is currently
working on getting J to use the MEM package for memory
memory allocation. MEM is a stand alone part of the
kant package which includes the mathematical language
Platform.
4. Mike Justenson is working on an improved session manager
for J on the PC.
5. Eric Iverson has completed the de{*filter*} which is currently
being beta tested for the MAC and PC.
Ira Ekhaus and Cary Hollander may be contributors as later as well.
-emmett
#!/bin/sh
# This is a shell archive (produced by shar 3.50)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
# Source directory /usr/cp2/emclean/src/newdoc
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 1593 -rwx------ keyed.files/doc.key
# 553 -rwx------ keyed.files/readme
# 466 -rwxr--r-- misc/doc.comb
# 1302 -rwxr--r-- misc/doc.frac
#
# ============= keyed.files/doc.key ==============
if test ! -d 'keyed.files'; then
echo 'x - creating directory keyed.files'
mkdir 'keyed.files'
fi
if test -f 'keyed.files/doc.key' -a X"$1" != X"-c"; then
echo 'x - skipping keyed.files/doc.key (File already exists)'
else
echo 'x - extracting keyed.files/doc.key (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'keyed.files/doc.key' &&
X
X 50!:0 (CREATE) (monad) (0)
X
X 50!:0 y
X
X Creates a file for keyed file operations where y is a
X boxed file name. Returns 1 upon successful file creation.
X
X
X 50!:1 (GET) (dyad) (_ 0)
X
X x 50!:1 y
X
X Returns the value associated with key where y is a boxed file
X name and x is a valid key.
X
X
X 50!:2 (PUT) (dyad) (1 0)
X
X x 50!:2 y
X
X Inserts a key and a noun specified by x into a keyed file specified
X by y. x must consist of 2 linked items, (0{x) is the key and (1{x) is
X the noun. Y is a boxed file name.
X
X For example, the following would put (i. 2 2) into the keyed file
X called file1 with key jones
X ('jones';i.2 2) 50!:2 <'file1'
X
X The following are all usable distinct keys:
X 'abcd'
X <'abcd'
X 1 4$'abcd'
X i.4 10
X 6.7j8
X
X
X 50!:3 (DIR) (monad) (0)
X
X Returns a list of keys of the file specified by y where y is a
X boxed file name.
X
X For example the following would test if a key 'abc' is already present;
X (<'abc')e. 50!:3 y
X
X
X
X 50!:4 (COPY) (dyad) (0 0)
X
X x 50!:4 y
X
X Copies the contents of the file specified by x to the file specified
X by y where x and y are boxed file names. Creates the destination file,
X eliminates wasted space, and returns one upon successful copying.
X
X For example, the following would copy the contents of file1 to file2 :
X (<'file1') 50!:4 <'file2'
X
X
X
X 50!:5 (DELETE) (dyad) (_ 0)
X
X x 50!:5 y
X
X Removes key specified by x from the list of keys in the file y where
X x and y are boxed file names.
X
X Returns boolean (1=deleted, 0=not deleted).
X
X
X
X 50!:55 (ERASE) (monad) (0)
X
X 50!:5 y
X
X Erases a file.
SHAR_EOF
chmod 0700 keyed.files/doc.key ||
echo 'restore of keyed.files/doc.key failed'
Wc_c="`wc -c < 'keyed.files/doc.key'`"
test 1593 -eq "$Wc_c" ||
echo 'keyed.files/doc.key: original size 1593, current size' "$Wc_c"
fi
# ============= keyed.files/readme ==============
if test -f 'keyed.files/readme' -a X"$1" != X"-c"; then
echo 'x - skipping keyed.files/readme (File already exists)'
else
echo 'x - extracting keyed.files/readme (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'keyed.files/readme' &&
X
X KEYED FILES.
X
X
X Special thanks to Mike Powell for writting the original J
X verbs which I translated into C.
X
X This package provides implements keyed file operations as primitive
X operators.
X
X All values are stored in 5!:5 format. Values retrieved from the file
X are recreated with the Do verb, ". .
X
X A domain error occurs if a filename is not composed of contigous spaces.
X
X Create =. 50!:0
X Get =. 50!:1
X Put =. 50!:2
X Dir =. 50!:3
X Copy =. 50!:4
X Delete =. 50!:5
X Erase =. 50!:55
X
SHAR_EOF
chmod 0700 keyed.files/readme ||
echo 'restore of keyed.files/readme failed'
Wc_c="`wc -c < 'keyed.files/readme'`"
test 553 -eq "$Wc_c" ||
echo 'keyed.files/readme: original size 553, current size' "$Wc_c"
fi
# ============= misc/doc.comb ==============
if test ! -d 'misc'; then
echo 'x - creating directory misc'
mkdir 'misc'
fi
if test -f 'misc/doc.comb' -a X"$1" != X"-c"; then
echo 'x - skipping misc/doc.comb (File already exists)'
else
echo 'x - extracting misc/doc.comb (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'misc/doc.comb' &&
X
X 77!:2 (COMB) (dyad) (0 0)
X
X (x 77!:2 y) computes the ordered table of all combinations of length
X x of i. n.
X
X For example :
X
X 3 (77!:0) 4
X 0 1 2
X 0 1 3
X 0 2 3
X 1 2 3
X
X This verb is implemented with Robert J. Craig's combinations
X at AT&T Bell Labs (312)-979-1822.
X
X reference: Berztiss, A. T., "Data Structures, Theory and
X Practice," 1971, Academic Press, pp. 36.
X
SHAR_EOF
chmod 0744 misc/doc.comb ||
echo 'restore of misc/doc.comb failed'
Wc_c="`wc -c < 'misc/doc.comb'`"
test 466 -eq "$Wc_c" ||
echo 'misc/doc.comb: original size 466, current size' "$Wc_c"
fi
# ============= misc/doc.frac ==============
if test -f 'misc/doc.frac' -a X"$1" != X"-c"; then
echo 'x - skipping misc/doc.frac (File already exists)'
else
echo 'x - extracting misc/doc.frac (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'misc/doc.frac' &&
X
X 77!:1 (FRAC) (monad) (_)
X
X (77!:1 y) If the storage type of y is boolean, integer, or double,
X 77!:1 y is the fractional representation of y such that
X
X
X For example :
X
X 77!:1 (17 % 217)
+------+
|17 217|
+------+
X
X This verb is implemented with Bob Craig's frac program which
X is available at research.att.com in netlib/c/frac.Z. Mr. Craig
X
X reference: Jerome Spanier and Keith B. Oldham, "An Atlas
X of Functions," Springer-Verlag, 1987, pp. 665-7.
X
X 77!:1 is (1e_6) 77!:1 y
X
X
X 77!:1 (FRAC) (dyad) (0 _)
X
X (x 77!:1 y) If the storage type of y is boolean, integer, or double,
X x 77!:1 y is the fractional representation of y such that
X
X
X For example :
X
+----+----+----+----+-------+-------+-------+-------+------------+------------+
|22 7|22 7|22 7|22 7|355 113|355 113|355 113|355 113|104348 33215|104348 33215|
+----+----+----+----+-------+-------+-------+-------+------------+------------+
X
X x can be any boolean, integer, or double value, but for a logical
X and efficient implementation, if x > 1e_2 or if x <1e_9 then default
X values of 1e_2 and 1e_9 are used.
X
SHAR_EOF
chmod 0744 misc/doc.frac ||
echo 'restore of misc/doc.frac failed'
Wc_c="`wc -c < 'misc/doc.frac'`"
test 1302 -eq "$Wc_c" ||
echo 'misc/doc.frac: original size 1302, current size' "$Wc_c"
fi
exit 0