Directions for P-Lisp additions -------------------------------(02-Jul-2008) The P-Lisp system is only able to save and load an environment, meaning all the functions, etc, currently defined. Unfortunately, it uses an S type file for this which means the environment files cannot be transferred to ProDOS with the system utilities program. Also, P-Lisp seems unable to load from source code so I created a base environment (cleverly named "BASE") which contains code to read Lisp expressions from disk using standard DOS 3.3 text file commands. So, to start Lisp and be ready to load from source: ]BRUN LISP :(LOAD BASE) Then you will be able to load expressions from text files. The load continues until there is no more to read. Then an END OF DATA message will be given. Use () alone to get back to the : prompt. For example, :(LOADFILE '"RATIONAL.LSP") END OF DATA +() : Note that the file name is quoted (it is an atom) and that I put " around it. The function LOADFILE is defined in the file LOADFILE.LSP which you can view in the editor. The P-Lisp editor is primitive, to say the least. So, since we can now load source code from text files I made a simple line editor in Applesoft. Run LED on the disk to start it. Run LED.HELP for the commands. It is pretty basic and limited to 1000 lines which should be plenty. If not, use multiple files. Once you have an environment with your application in it, use (SAVE ...) to store it and skip loading from source in the future. The file RATIONAL.LSP contains functions for rational arithmetic (ie, with fractions). The are functions for reducing fractions and finding the greatest common divisor. Fractions themselves are represented as lists: (1 2) = 1/2 (22 7) = 22/7 Mixed numbers are allowed if wrapped by (MIXED ...) So, (3 1 7) = 3-1/7 The symbols + - * and / have been set up for rationals: (* '(1 2) '(3 4)) -> (3 8) All answers are properly reduced. To reduce a fraction: (REDUCE '(6 8)) -> (3 4) To print as a fraction: (PP '(3 4)) -> 3 / 4 To work with a mixed number: (+ '(1 7)) (MIXED 3 1 7)) -> (23 7) To make a mixed number from an improper fraction: (TO-MIXED '(22 7)) -> (3 1 7) To find the greatest-common-divisor (GCD): (GCD 1029 1071) -> 21