diff --git a/src/lisp/maplist.lisp b/src/lisp/maplist.lisp index 149df07..4fe1e39 100644 --- a/src/lisp/maplist.lisp +++ b/src/lisp/maplist.lisp @@ -8,7 +8,7 @@ (lambda (l fn) (cond ((null l) nil) - (T (cons (fn l) (maplist (cdr l) fn))) + (t (cons (fn l) (maplist (cdr l) fn))) ) ) ) diff --git a/src/lisp/s-expr.pla b/src/lisp/s-expr.pla index 49b77fe..2e84b26 100644 --- a/src/lisp/s-expr.pla +++ b/src/lisp/s-expr.pla @@ -519,19 +519,25 @@ end export def eval_expr(expr)#1 if expr if expr->type == CONS_TYPE + // + // List - first element better be a function + // if expr=>car->type & TYPE_MASK == SYM_TYPE - if expr=>car=>natv + if expr=>car=>natv // Native function return expr=>car=>natv(expr=>cdr) - elsif expr=>car=>lambda + elsif expr=>car=>lambda // DEFINEd lambda S-expression return eval_lambda(expr=>car=>lambda, expr=>cdr) - else + else // Symbol associated with lambda return eval_lambda(assoc(expr=>car)=>cdr, expr=>cdr) fin elsif expr=>car->type == CONS_TYPE and expr=>car=>car == sym_lambda return eval_lambda(expr=>car, expr=>cdr) fin else - return eval_atom(expr) + // + // Atom + // + return expr->type & TYPE_MASK == SYM_TYPE ?? assoc(expr)=>cdr :: expr fin fin return NULL