#include <stdio.h>
+#include <stdlib.h>
#include <histedit.h>
-#include "linenoise.h"
+#include <editline/readline.h>
#include "types.h"
#include "eval.h"
+
int main(int argc, char** argv) {
Sexpr* env = init_dict();
// now do the loop, right?
char* input = NULL;
while(1) {
- input = linenoise("> ");
+ input = readline("> ");
if(input == NULL)
return 0;
- linenoiseHistoryAdd(input);
+ add_history(input);
Sexpr* in = parse(input);
if(in == NULL) {
printf("bad input\n");
Sexpr* out = eval(car(in), env);
printf(" - %s\n", sprint_sexpr(out));
}
- linenoiseFree(input);
+ free(input);
}
return 0;
}