readme.txt
November 20, 2017 ยท View on GitHub
LISP Evaluator for FreeBASIC
Copyright (c) 2007-2017 Jeffery R. Marshall.
An embedded LISP interpreter written entirely in FreeBASIC for use
with FreeBASIC applications.
0. INTRODUCTION
My main motivation for writing this is I like the idea of LISP as a
script or macro language that can be embedded in my programs. My
experience with LISP was with AutoLISP. This version of LISP is
also a single namespace variety. It certainly does not follow any
standard. None-the-less it is very LISP-like.
Using this library is probably not a good way to learn LISP. Use a
real LISP compiler or interpreter for that. But if you do know some
LISP programming, this version will be similar enough to be useful.
-
LICENSE
See the 'license.txt' file in the same folder as this readme.txt
-
COMPILING
To compile the library, use the following commands:
cd src makeTo compile the examples, use following:
cd examples makeTo run the test suite, from main directory
example\runlisp tests\tests.lsp -
INSTALLING
There is no install script. To use, either copy the library and include files to an appropriate directory, or include the paths to ./lib and ./inc as search paths.
To use the library as-is, only the following files are needed
./inc/lisp.bi ./inc/lisp_err.bi ./lib/liblisp.a
To use the library as well as extend the built-in functions, all of the include files from ./src are also needed.
-
INTRINSIC FUNCTIONS
Following is a list of the built-in functions available from the library.
(~
) (* number...) (+ number...) (- number...) (/ number...) (/= atom...) (< atom...) (<= atom...) (= atom...) (> atom...) (>= atom...) (1+ ) (1- ) (abs ) (and ...) (append ...) (apply function [list]) (atom ) (car - )
(car
) (cdr - )
(cdr
) (cond ( expr2)...) (cons expr2) (consp ) (defun (arglist) ...) (elt ) (eq ) (eql ) (equal ) (equalp ) (eval ) (garbage-collect) (gc) (if else-expr...) (integerp ) (lambda expr...) (last - )
(length
- )
(list expr...)
(listp
) (load ) (mapcar <list1...listn>) (not ) (nth - )
(null
) (numberp ) (or ...) (princ ...) (progn ... ) (quote ) (set ) (setf [ ]...) (setq [ ]...) (stringp ) (unless else-expr...) (when then-expr...) (while expr...) (zerop ) -
EXAMPLE USAGE IN FREEBASIC
#include "lisp.bi" using LISP
DIM lsp AS LispModule, expr AS STRING
expr = "(lisp expression)" lsp.eval( expr )
-
EXAMPLE PROGRAMS
The directory ./examples have a few example example programs. To compile all of the example programs, use:
cd examples make
Each example also has its own instructions for comiling and usage in the .bas source file.
-
OBTAINING THE ORIGINAL SOURCE
https://github.com/jayrm/fb-lisp
and sometimes http://www.coderjeff.ca
-
ACKNOWLEDGEMENTS
Sandro Sigala - That a C version of a simple LISP evaluator existed and was available under an Open Source license saved huge amounts time.
Thanks to Sandro for slisp-1.2.
EOF