1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-09-07 12:54:31 +00:00

Handle errors better

This commit is contained in:
David Schmenk 2024-07-21 20:49:08 -07:00
parent 9df7eeb28e
commit d8f21f1f65

View File

@ -908,6 +908,11 @@ export def eval_expr(expr)#1
else
curl = NULL // Set-up for in-line LAMBDA
fin
if !expr_car // Make sure we don't hang
puts("Invalid function:"); print_expr(expr); putln
expr = NULL
break
fin
if expr_car->type == CONS_TYPE
if expr_car=>car == sym_funarg // FUNARG
expr = eval_funarg(expr_car, expr=>cdr)
@ -919,6 +924,10 @@ export def eval_expr(expr)#1
fin
if expr_car=>car == sym_lambda // LAMBDA
curl, expr = apply_args(curl, expr_car, expr=>cdr)
else
puts("LAMBDA expected:"); print_expr(expr); putln
expr = NULL
break
fin
fin
else