@@ -10,25 +10,30 @@ to the original program, while trying to keep the goal of simplicity and concise
1010The whole program compiles to less than 100 kb without debugging symbols and should be
1111able to run on low powered devices.
1212
13- The whole program compiles to less than 100 kb and should be able to run on low powered devices.
1413The added primitives:
15- * strings
14+ * strings and conversion
1615* predicates >, >=, <=, or, and, not,
17-
18- * functions length, reverse, progn, load.
16+ * functions atom, length, reverse, progn, load.
1917
2018This has the side effect of being much faster as well, since all these primitives are
2119compiled instead of being interpreted.
2220
23- Among the bells and whistles, I've added a REPL based on Justine Tunney (jart)'s bestline.
21+ Among the bells and whistles, I've added a Read-Eval-Print-Loop ( REPL) based on Justine Tunney (jart)'s bestline.
2422
2523In this version, instead of passing a file using pipes, you simply pass the files as command parameters :
2624./minilisp f1 f2 etc
2725
2826The files all share the same environment, so all the symbols, functions and macros defined
29- in f1 can be reused in the following files.
27+ in f1 can be reused in the following files. The REPL is summonned after execution, unless we pass the option
28+ -r to the command line, in which case the interpreted quits immediately at the end.
29+
30+ You can also pass a simple Lisp command as parameter:
31+ ./minilisp -x "(+ 1 1)"
32+
33+ The Lisp command will be evaluated and then the REPL is summonned.
34+ However we can quit immediately after execution with -r (or --no-repl).
3035
31- ## Shortcuts
36+ ## REPL Shortcuts
3237
3338```
3439CTRL-Enter CONTINUE ON NEXT LINE
@@ -83,9 +88,9 @@ This file is loaded at startup, so one can recall previous commands.
8388Known bugs:
8489* Operators "and" and "or" do not work like their typical Lisp counterpart
8590because they evaluate all their operands at the same time instead of one
86- by one.
87- * the paste function does not work very well .
88- * recall of multiline commands does not work as expected .
91+ by one. You may use the versions in the library.lisp file to correct this behavior.
92+ * recall of multiline commands does not work as expected .
93+ * this doesn't have tail call optimization, so expect crashes with sometimes with surprisingly short lists .
8994
9095Original README (completed)
9196===============
@@ -260,7 +265,8 @@ exhaustion error.
260265
261266 ( progn (print "I own ")
262267 (defun add(x y)(+ x y))
263- (println (add 3 7) " cents") ) ; -> prints "I own 10 cents"
268+ (print (add 3 7)
269+ (println " cents") ) ; -> prints "I own 10 cents"
264270
265271### Equivalence test operators
266272
@@ -405,15 +411,3 @@ than itself. Useful for writing a macro that introduces new identifiers.
405411
406412As in the traditional Lisp syntax, ` ; ` (semicolon) starts a single line comment.
407413The comment continues to the end of line.
408-
409- No GC Branch
410- ------------
411-
412- There is a MiniLisp branch from which the code for garbage collection has been
413- stripped. The accepted language is the same, but the code is simpler than the
414- master branch's one. The reader might want to read the nogc branch first, then
415- proceed to the master branch, to understand the code step by step.
416-
417- The nogc branch is available at
418- [ nogc] ( https://github.com/rui314/minilisp/tree/nogc ) . The original is available
419- at [ master] ( https://github.com/rui314/minilisp ) .
0 commit comments