better error handling

This commit is contained in:
Joeri Exelmans 2025-05-27 12:44:57 +02:00
parent 7edf44f107
commit 428e8cd298
8 changed files with 66 additions and 34 deletions

View file

@ -60,7 +60,7 @@ export function evalLet(s: LetInBlockState, env: DynamicEnvironment): EvalResult
const valueEnv = {
names: trie.insert(env.names)(s.name)({
recursive: true,
i: () => value,
i: () => { try { return value; } catch (e) {} },
}),
};
const value = evalExpr(s.value, valueEnv);