We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6fa9b87 commit 3c8e62aCopy full SHA for 3c8e62a
scrapscript.py
@@ -1282,9 +1282,11 @@ def eval_exp(env: Env, exp: Object) -> Object:
1282
elif isinstance(callee.func, MatchFunction):
1283
arg = eval_exp(env, exp.arg)
1284
for case in callee.func.cases:
1285
- m = match(arg, case.pattern, env, case.guard)
+ m = match(arg, case.pattern)
1286
if m is None:
1287
continue
1288
+ if case.guard is not None and eval_exp({**env, **m}, case.guard) != Symbol("true"):
1289
+ continue
1290
return eval_exp({**callee.env, **m}, case.body)
1291
raise MatchError("no matching cases")
1292
else:
0 commit comments