    THIS SET OF DOCUMENTS, PROGRAMS AND SCRIPTS IS DISTRIBUTED FREE ON
AN 'AS-IS AS-SEEN' BASIS. THERE IS NO FITNESS OF PURPOSE GUARANTEE.
SOURCE CODE SHOULD BE PART OF THE DISTRIBUTION.

 (C) Tony Goddard, Sheffield 2002

 NEW !!! Industry standard tarfile distribution format.

     http://d4maths.lowtech.org
     http://d4maths.lowtech.org/mirage/install.htm
     Infoline: +44(0)7944 764312

                 D4: AN ARRAY PROCESSING LANGUAGE

    The programs in this package offer the user access to a glorified
calculator which is capable of dealing with advanced mathematics
techniques such as RSA encryption, continued fractions, and polynomial
multiplication. Ordinary statistical techniques are made easy by the
extension of the four operators plus (+), minus(-), times(*) and
divide(%) to vectors and tables. An editor is provided so that
calculations on tables of data can be moved around in blocks of text
via cut and paste operations. The syntax of expressions is based on the
type of algebra still taught in some schools. D4 is a keyboard
intensive application.

   The distribution includes the text of a pamphlet called 'A Rough
Guide to Numbers and Algebra'. Expect pot-holed roads and excessive
speed. There is also a time travel package to 1960s style UNIX
computing with a simplified version of a UNIX shell, the 'dsh'. This in
itself can be used as a gentle introduction to LINUX.

                       INSTALLATION GUIDE

    Installation is done via scripts. Many system administrators do not
expect users to run scripts. For LINUX it is necessary to use a shell
interface. Users of Windows 95/98 or WINDOWS-NT need to use a command
window, also known as a DOS box. Floppy disk distributions come with an
install file with a name such as D4TOHD.BAT

    Sometimes there are restrictions on creating new directories. In
this case it is normally possible to install a working set in a
temporary directory such as /tmp in LINUX, or c:\tmp on Windows.
The 16-bit version may be easily installed on a ramdisk.

    For WINDOWS users it is often possible to install from a batch file.
An installation batch file will normally create a directory, copy files
to this directory, unzip any necessary files and extract a set of
scripts and documentation files, then run the D-shell.

    DOS and WINDOWS distributions may also contain the files namtok.exe
and namtok.c. Namtok.exe is a digital art program which will give a
shell window if the user presses CTRL-Z while it is running. Namtok.exe
can be run by clicking its icon from WINDOWS.

                        LINUX INSTALLATION

    You need two files: this README file, and d4linux.tgz. These can
normally be obtained from the ftp site, web pages, or on 1.4Mb floppy.
Use gzip, the GNU project compression / decompression utility to make
the file d4linux.tar. Create a directory d4, then install math2545.tgz
and run tar.

    The Linux distribution comes without the binaries. You must compile
the source files. There is not a single makefile, but a collection of
.mf files.

    mkdir d4
    mv math2545.tgz d4
    cd d4
    tar -xzf math2545.tgz
    cd cp
    make -f lek.mf

    Now test the ascii animation:-

    d4x test.afn x=animate#sail
    d4x test.afn x=animate#walk

    (Thanks to jgs, jmoon).

    CAUTION !!! The make files (.mf) contain hardcoded path names which
tell the compiler where to find the files. It may be necessary to edit
the .mf files to get the make process to work correctly if the files
are located anywhere else.

                       DOS INSTALLATION

    Scripts and documentation are distributed as industry standard
gzipped tar (.tgz) files which may be unbundled with either WINZIP or
d4t.exe/d4x.exe and tar.d4f. If the tarfile is prefixed with a certain
d4 script, then it may be unpacked by the interpretor itself. The file
'base.tgz' is set this way.

                        FAST INSTALL

    The worldwide web site http://d4maths.lowtech.org contains a single
ZIP file for the mathematics scripts. This is called d4math.zip. Just
create a directory called math2000 on the hard disk and unzip the file
to that directory. The interpretor D4X needs to be activated via a
command line d4x test.afn.

               !!!! NEW ...... ULTRA FAST INSTALL

    Windows users who don't know about zip files, or those who are bold
and curious may like to try downloading iskra.exe. This is a
self-extracting auto-running partially gzipped file containing a copy
of the Gnu Public Licence plus complete C source code for creating a
fast installer for any software you may wish to distribute. The licence
claims you must pass on the same rights which you inherit to other
users. Beta testers are urgently required.

                        FULL INSTALLATION

    For full installation you need at least seven files.

    README          this file
    d4t.exe         16-bit executeable for 386 etc. Runs from floppy.
    d4x.exe         32-bit executeable.
    gzip.exe        GNU zip utility. Needed to unzip ...
    base.tgz        Documentation and scripts
    d4extra.tgz     Console fonts, source code, more documents
    d4xdemo.tgz     .xbm bitmaps and other stuff
    pkunzip.exe     PK unzip utility. Needed to unzip ...
    csdpmi3b.zip    DOS Protected Memory interface.
                    Needed to run d4x.exe.

    The files base.tgz and d4extra.tgz may have different names to those
published here. A simple minded version numbering is also used where 'base'
is replaced by a month, year code 'mmmyy' where mmm is three letters for
a month, and yy are the two digits for a year. The series starts with
'oct00'. If new releases are made everyday then the process will undoubtedly
be fully automated and the users will be bombarded with information.




    It is quite possible that the machine already has a working version
of dpmi. Games such as 'QUAKE' include this.

    (1) Create an installation directory.
    mkdir \d4

    (2) Copy, or download the files to this directory.

    (3) Unzip the .tgz files.
    gzip -d base.tgz

    (4) Unbundle the scripts and documents.
    d4t base.tar

    At this stage you should get some licence screens followed by the
dollar prompt. You may now read more of the help files using the vi
editor which is part of D4, or any other editor.

    To install the rest of the material, including the source code you
must unpack d4extra.tgz. If the first step of the installation was
correct you should see a dollar prompt '$'. Type the following
commands.

 gzip -d d4extra.tgz
 gzip -d d4xdemo.tgz
 ld tar
 pwd                       should give c:\d4
 tar x d4extra.tar
 tar x d4xdemo.tar

    To get some software working correctly it is necessary to run from a
subdirectory of d4. This is normally d4\cp. Make this directory if
necessary, and move all the files from d4 down one level to d4\cp.
After you have done this run the interpretor from d4\cp. The following
commands will do this.

    pwd           ( print working directory; should be c:/d4 )
    md cp
    cp *.* cp     ( Caution: don't try this on linux )
    rm *.*
    cd cp

    If DPMI is not installed on the DOS machine then d4x.exe will not
run. It will fail with the rather cryptic message 'No dpmi'. In that
case use PKUNZIP to unzip csdpmi3b.zip and read the instructions.

                   WINDOWS INSTALLATION

    Because I am spending most of my time writing about the mathematical
aspects of array processing languages I have not had the time to work
out a drag and drop method of installing on any Windows system. This is
particularly difficult when people are trying to run windows on a
machine where the display is not large enough to show all of the
windows dialogue boxes so that users must click invisible buttons off
the edge of the screen.

    Create a DOS-SHELL or command.com window, and proceed as for DOS.
Normally you should not need so many files. This is because gzip and
pkunzip are usually available as part of WINZIP. Also Windows gives a
valid DPMI for the 32-bit version.

    There are three essential files.

    README                      This readme file
    d4t.exe or d4x.exe          An executeable
    base.tgz                    scripts and plaintext.

    (1) Install these files in a subdirectory whose full pathname does
not contain blanks. If you cannot create a directory, then install them
in any existing temporary directory such as c:\temp or c:\tmp.
    -------------------------------------------------------------
    (2) You may extract files using  WINZIP.
    To start the application for the first time type the command:-

    d4x licence.afn
    --------------------------------------------------------------
    Alternatively use gzip and one of the binaries.

    gzip -d *.tar
    d4t base.tar       16-bit
    d4x base.tar       32-bit

    Next you can put a link to d4x on the Windows desktop. Use any
windows file manager to find d4x.exe, drag the icon to the desktop,
then click the right mouse button to get the icon menu. Select
properties and switch to programs. Fill in the boxes:-

    Cmd line:   C:\D4\CP\D4X.EXE test.afn v=14
    Working:    C:\D4\X

    Check the 'Close on exit' box.

    Now select the 'Change Icon' box and select a suitable icon. Two
icons were selected during development. These were the dice pair, and a
keyboard icon.

    If you wish to compile the sources on DOS then you need to get a
version of Borland TurboC, or DJGPP. The file TC.D4F contains a
variable called TURBOC.CFG. This must be written to \tc\bin\turboc.cfg.
This may be accomplished by D4-SHELL commands:-

 ld tc
 #sed"X$TURBOC.CFG;:w/tc/bin/turboc.cfg"
 cp d4t.exe d4s.exe
 ! mai

    mai.bat contains a 'cd' instruction. This may need to be changed to
give a 'cd' to the current installation directory.  Eventually you
should get a new .exe file, called d4t.exe.

    Compiling with DJGPP is rather like LINUX. \d4\gc contains make
files with an .mf extension. The file DJGPP.D4F contains a script for
moving the C-compiler around on four floppy disks. When you look at the
size of SPLIT.EXE and MERGE.EXE in the DJGPP distribution then you
should realise the advantages to be gained by using the post-card size
ASCII scripts available with D4.

    DJGPP is a free compiler, with handy documentation in plaintext
files. You may obtain it by anonymous FTP from

     ftp://sunsite.doc.ic.ac.uk/packages/simtelnet/gnu/djgpp

                        SETTING UP THE BROWSER

----------------------------------------------------------------------
    If you do not really love MS-WINDOWS then you may safely omit this
section. There are many ways for the procedure to go wrong, and it
seems excessively time consuming.
----------------------------------------------------------------------

    Once D4 is installed on windows the program can be used to create
plug-ins for INTERNET EXPLORER. These include right to left editing
facilities for Arabic and Hebrew. This is done by using D4 to open
files with a specified extension.

    It may be necessary to press ALT+ENTER to see the font.
    The hebrew keyboard mapping is cut from a LINUX file.

    It is necessary to create new file associations. This can be done
via the 'My_computer' option in Windows, or directly on older versions
of Internet Explorer via 'View' and 'Options'.

      File associations and startup lines for 'Open'.

 Arabic     .axt  c:\d4\x\d4t.exe v=13 c:\d4\x\test.afn vi=1 cwd=1
 Hebrew     .heb  c:\d4\x\d4t.exe v=14 \d4\x\test.afn cwd=1
x=hebrew#vheb
 D4 Script  .d4i  c:\d4\x\d4t.exe \d4\x\iex.afn v=10

    I only know how to configure these file associations by hand.
    (1) Go to the Options section of the View Button.
    (2) Go to Programs, then click on 'file types' in the Viewers Box.
    (3) Select 'New Type'.  Fill in the form.
        Description          d4 header
        Content type         text
        Default Extension    .d4i

    (4) Select New in the 'Actions' panel.
        Call the first action 'open' then fill in the form.

        Action                  open
        Application used ..     c:\d4\x\d4t.exe c:\d4\x\iex.afn v=10

        Confirm by clicking OK.

    (5) Close the options windows

    (6) Test all this by using INTERNET EXPLORER to view a .d4i file.

     Useful links:

     http://mathworld.wolfram.com/PrimeSpiral.html
     ftp://sunsite.doc.ic.ac.uk/packages/simtelnet/gnu/djgpp/
