-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreadme.txt
161 lines (116 loc) · 3.42 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
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.
1. LICENSE
See the 'license.txt' file in the same folder as this readme.txt
2. COMPILING
To compile the library, use the following commands:
cd src
make
To compile the examples, use following:
cd examples
make
To run the test suite, from main directory
example\runlisp tests\tests.lsp
3. 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.
4. INTRINSIC FUNCTIONS
Following is a list of the built-in functions available from the library.
(~ <number>)
(* <number> number...)
(+ <number> number...)
(- <number> number...)
(/ <number> number...)
(/= <atom> atom...)
(< <atom> atom...)
(<= <atom> atom...)
(= <atom> atom...)
(> <atom> atom...)
(>= <atom> atom...)
(1+ <number>)
(1- <number>)
(abs <number>)
(and <expr>...)
(append <expr>...)
(apply function [list])
(atom <expr>)
(car <list>)
(car <cons>)
(cdr <list>)
(cdr <cons>)
(cond (<expr1> expr2)...)
(cons <expr1> expr2)
(consp <expr>)
(defun <sym> (arglist) <expr>...)
(elt <list> <index>)
(eq <expr1> <expr2>)
(eql <expr1> <expr2>)
(equal <expr1> <expr2>)
(equalp <expr1> <expr2>)
(eval <expr>)
(garbage-collect)
(gc)
(if <expr> <then-expr> else-expr...)
(integerp <expr>)
(lambda expr...)
(last <list>)
(length <list>)
(list expr...)
(listp <expr>)
(load <filename>)
(mapcar <function> <list1...listn>)
(not <expr>)
(nth <index> <list>)
(null <expr>)
(numberp <expr>)
(or <expr>...)
(princ <expr>...)
(progn <expr>... )
(quote <expr>)
(set <expr1> <expr2>)
(setf <sym1> <expr1> [<sym2> <expr2>]...)
(setq <sym1> <expr1> [<sym2> <expr2>]...)
(stringp <expr>)
(unless <expr> else-expr...)
(when <expr> then-expr...)
(while <expr> expr...)
(zerop <expr>)
5. EXAMPLE USAGE IN FREEBASIC
#include "lisp.bi"
using LISP
DIM lsp AS LispModule, expr AS STRING
expr = "(lisp expression)"
lsp.eval( expr )
6. 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.
7. OBTAINING THE ORIGINAL SOURCE
https://github.com/jayrm/fb-lisp
and sometimes http://www.coderjeff.ca
8. 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