Ian, you did an amazing job! Thank you very much! You write about my BASIC program: "Like many amateur programs, it thoroughly mixes up input, processing and output. Even in the 1960s when BASIC was invented (Kemeny & Kurtz, 1964) this was recognised to be a bad thing". Yes, everybody knew how to criticize, but few BASIC programs were actually easy to read and understand. My excuse, apart from being such an amateur, is that I kept it down to 8 lines. It could have been worse. The input statements were INPUT;C$ which reads a textstring from the terminal, and LINE INPUT#1,A$ which reads a line from the file into a textstring. The output statements were PRINT":"; which outputs a colon without carriage return, and PRINT which outputs the carriage return - in those days the typewriter terminal had a physical carriage to return - and PRINT" ";A$; which outputs first a blank sign, then the word, and no carriage return. The statements A%=ASC(A$)-48: A$=MID$(A$,2) translates the first digit in the line number into an integer, and chops if off the string.
The database structure is flexible in that it fuses the array structure and the tree structure together into a single structure. Compare pray 0 with pray 00 and pray 000 to see the tree structure, while pray 13500 shows a 2*2 array. In extended versions of the program in FORTRAN and in Pascal I included an editor to insert, modify and delete records. (If a record was there already it was modified, otherwise it was inserted. Empty records were deleted.) Modifying a line number restructured the database. For example changing 0 to 2 ment that all line numbers in the database were prefixed by digit 2. The line numbers are ordinal fractions: "1" is the first half and "2" is the second half, "first" and "second" are ordinals and "half" is a fraction. That's why! "0" means both halfs. Ordinal fractions are like arrays except: * an array has only a finite number of dimension, while an ordinalfraction has an infinite number of dimensions. * arrays have different shapes, while all ordinalfractions have the same shape. * an array may have subarrays and elements, while an ordinalfraction has sub - ordinalfractions, but no elements. * arrayelements have values and subarrays do not have values, while ordinalfractions have values. I am fascinated by the power of ordinal fraction arithmetic, but it is far more heretical than artificial catholicism. Beware of the inquisition! - Bo >________________________________ > Fra: Ian Clark <earthspo...@gmail.com> >Til: programm...@jsoftware.com >Sendt: 3:58 torsdag den 29. november 2012 >Emne: Re: [Jprogramming] Translating BASIC into J > >Here's my take on the topic: http://www.jsoftware.com/jwiki/IanClark/credo > >There's a script at the bottom of the wiki page you can download. > >I haven't attempted to replicate BASIC's itty-bitty I/O, all mixed-up >in the processing. As well write a mini interpreter in J and get it to >run the BASIC code! > >Instead I've intuited the algorithm and done it as a J-er would. >Might. >Would. >(At least, as this J-er would). > >IanClark > >On Tue, Nov 27, 2012 at 6:31 AM, Bo Jacoby <bojac...@yahoo.dk> wrote: >> Dear J'ers. >> >> At the Norddata conference in Göteborg in the summer 1989 I gave a lecture >> (in Danish) on Ultraflexible Database Structure and Artificial Catholicism. >> >> >> It contained this 8-liner in BASIC. >> ...snipped... >---------------------------------------------------------------------- >For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm