Added basic string support.

Added comments beginning with a semi-colon.
Added load function to load lisp from a file.
Arguments passed to klisp will be read and evaluated as lisp files.
This commit is contained in:
2014-05-31 16:48:58 +01:00
parent 396bf65a84
commit cb8fa74fe7
14 changed files with 245 additions and 60 deletions

10
lang.h
View File

@@ -16,6 +16,7 @@ extern "C" {
#include "lval.h"
#include "lenv.h"
#include "functions.h"
#include "shared.h"
#define LASSERT(val, cond, errnum, errdetail, ...) \
if (!(cond)) { \
@@ -34,14 +35,13 @@ extern "C" {
LASSERT(val, subject->cell_count >= expectedNum, \
LERR_SYNTAX, "%s Expected %ld or more arguments got %ld", name, expectedNum, subject->cell_count )
mpc_ast_t* tokenize(char *input);
void setup_parsers();
void cleanup_parsers();
lval* parse(mpc_ast_t *t);
lval* eval_builtin_op(lval* val, char* op);
lval* eval_s_expr(lenv* env, lval* val);
lval* parse_read_string(mpc_ast_t* t);
lval* eval(lenv* env, lval* val);
lval* eval_s_expr(lenv* env, lval* val);
#ifdef __cplusplus
}