Questions on PAR001.poc
31-Aug-94 01:58:00
Sb: #120872-Questions on PAR001.poc
Fm: Ed Kellerman 71532,3255
To: Dennis Conklin 75020,2746
Ed,
<C is a very powerful language, but it is also very easy to write very cryptic
code.>
My programming style is the result of years using APL. I became accustommed to
having all the code visible at once. One of the first programs I wrote in APL
was "An Adaptive Query System," a program that learned by holding conversations
with users. It maintained a data base containing what it knew. It was able to
recognize phrases that were similar to those in the data base. It was done (by
a beginner) in about 40 lines.
With APL,
< re-write from scratch >
is the accepted practice. The programmer, however, must provide comments that
formally describe what a routine does. I am looking at a 5 line APL program
right now. The output from this routine is computed on a line containing 24
characters. I'll try to give you an idea of what that line looks like:
R<1 "drop" (Z "or" 1 "rotate about the first dimension" Z < V "not eq" ' ')/V<'
',V
"<" is assigment (arrow pointing left), used 3 times
There are no blanks, except between single quote marks
"rotate about the first dimension" is a circle with a vertical line through it
"not eq" is an equal sign with a slash through it
"or" looks like a small V
"drop" is an arrow pointing down
The comments describe this routine as:
Deleting extra blanks from a character vector (the input is "V", the output is
"R")
where extra blanks are:
– any blanks following another blank,
– any blanks preceeding the first non-blank character
– any blanks following the last non-blank character
The other four lines are comments and code to check that the input is a vector
containing character data.
<"a write-only language">
Good one!
<Assuming that your question in particles_orbiting of why does G==1 work is NOT
rhetorical>
Boy, you are really digging in. That was a reminder that I still had to check
that my guess, G==1, was correct.
Thanks for saving me time!
Ed K.