Add examples/. Install to system on `make install`
Installs examples/* to /usr/share/pebblisp A basic REPL is one of these examples, replacing the built-in C version with one actually written in PebbLisp. It can be invoked the same way: running `pl` without any arguments.
This commit is contained in:
parent
7c7a68df5f
commit
775be84f5f
|
@ -18,3 +18,6 @@ run:
|
|||
|
||||
install:
|
||||
cp ./$(exe) /usr/bin/pl
|
||||
mkdir -p /usr/share/pebblisp/
|
||||
rm /usr/share/pebblisp/*
|
||||
cp ./examples/* /usr/share/pebblisp/
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/pl
|
||||
(def repl (fn (_) (
|
||||
(prn "pebblisp::> ")
|
||||
(def input (inp 0))
|
||||
(if (= input "q") () (
|
||||
(prn (eval input))
|
||||
(pch 10)
|
||||
(repl 0)
|
||||
))
|
||||
)))
|
||||
|
||||
(repl 0)
|
|
@ -774,13 +774,7 @@ int readFile(const char *filename, struct Environment *env) {
|
|||
|
||||
void repl(struct Environment *env)
|
||||
{
|
||||
char input[200] = "";
|
||||
while(input[0] != 'q') {
|
||||
printf("pebblisp>> ");
|
||||
fgets(input, 100, stdin);
|
||||
Object obj = parseEval(input, env);
|
||||
printAndClean(&obj);
|
||||
}
|
||||
readFile("/usr/share/pebblisp/repl.pbl", env);
|
||||
}
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
|
|
Loading…
Reference in New Issue