pure_LISP tutorial

[ Index ] [ pure_LISP reference ] [ pure_LISP tutorial ] [ SECD collection ] [ SECD reference ]

This document describes the installation and introduction to the package SECD_Mania, especially the final part of the package - pure_LISP language and its implementation base - the virtual SECD machine.


1. Introduction.

pure_LISP is a pure LISP implementation for GNU/Linux OS, based on an advanced version of SECD virtual machine.

The language have the following properties:

The properties, omited in the language:

2. Installation.

Download the pure_LISP from here.

Mirrors:

skelet.ludost.net

skelet.hit.bg/SECD

Requirements: You must have FreePascal installed on your system.

If you use Debian Linux, simply type:

apt-get install fp-compiler binutils

If you use some other Linux, go to FreePascal home page for instructions.

Usage:

Download the package in some new directory (i prefer 'secd'), then type:

tar xzf LISP_0.6.tar.gz

Now you have the package sources in subdirectory Base_3.

Type:

cd Base_3
./make_all

After this, SECD virtual machine will be compiled and started. (read the make_all shell script for details). The machine loads and executes the SECD code from the file miniOS.sec. This code defines a small miniOS program.

The following lines appear on the console:

Reading code init.sec  ...
Executing code ...
SEC>
Now type at the prompt:
(add 2 5)
miniOS will respond to you:
SEC>(add 2 5)
(#ldc 2 #ldc 5 #add)

7
SEC>
The first line of the response - list (#ldc 2 #ldc 5 #add) is a SECD code, compiled version of your command (add 2 5). This code is then executed and the result - integer number 7 in this examle is printed on the conslole.

Try a more complex expression:

SEC>(let (mul a a) (a add 2 3))
(#delay

(#ldc 2 #ldc 3 #add)
#trlet_1 #ld_0_0 #rec #ld_0_0 #trrec_mul)

25
SEC>
The above expression is a pure_LISP record for the mathematical notation:
Let a is the sum of 2 and 3.
Evaluate a multiplied by a and give the result.

More info about possible pure_LISP functions you may find in pure_LISP reference.


3. Files in the package.

Open a new console and go to the pure_LISP package subdirectory (in my computer this is /home/skelet/secd/Base_2).

Type:

ls -l
Computer will show you the package files and subdirectories.

These files may be arranged in some different groups:


4. pure_LISP examples.

For the most of the examples the following procedure must be used to start them correctly:

Examples in subdirectory Numbers demonstrate the usage of infinite sequences in lazy evaluations. They all uses the library numbers.lib. In this library are defined lists of all numbers, prime numbers and pitagorean triples. But in final expression only limited part of these lists may be evaluated and printed (if we try to print all numbers, some overflow will happens).

Numbers content:

Examples content:

More about problems with non-deterministic examples and their miniOS variants you may read in file ../History.txt.


(c) Skelet, Sep 2002 in terms of GNU GPL

Mail me at home or work