Added ok value typeto represent success of a function, ie load.

'ok' now represents this type and can be compared to, also cannot be
used as a symbol/variable.
This commit is contained in:
2014-06-21 22:26:49 +01:00
parent 198367882e
commit f74035fcce
5 changed files with 26 additions and 10 deletions

2
main.c
View File

@@ -30,7 +30,6 @@ int main(int argc, char** argv) {
//Attempt to import/run files specified on the command line
if (argc > 1) {
for(int i = 1; i < argc; i++) {
printf("Loading File \"%s\"\n", argv[i]);
lval* loadargs = lval_add(lval_s_expr(), lval_str(argv[i]));
lval* result = builtin_load(env, loadargs);
@@ -115,6 +114,7 @@ void lval_print(lval* val) {
case LVAL_S_EXPR: lval_expr_print(val, "(", ")"); break;
case LVAL_Q_EXPR: lval_expr_print(val, "{", "}"); break;
case LVAL_EXIT: printf("exit"); break;
case LVAL_OK: printf("ok"); break;
case LVAL_FUNC: ;
lval_func* func = val->data.func;
if (func->builtin != NULL) {