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 5b98e3b commit 7ba29baCopy full SHA for 7ba29ba
scrapscript.py
@@ -1281,9 +1281,11 @@ def eval_exp(env: Env, exp: Object) -> Object:
1281
elif isinstance(callee.func, MatchFunction):
1282
arg = eval_exp(env, exp.arg)
1283
for case in callee.func.cases:
1284
- m = match(arg, case.pattern, env, case.guard)
+ m = match(arg, case.pattern)
1285
if m is None:
1286
continue
1287
+ if case.guard is not None and eval_exp({**env, **m}, case.guard) != Symbol("true"):
1288
+ continue
1289
return eval_exp({**callee.env, **m}, case.body)
1290
raise MatchError("no matching cases")
1291
else:
0 commit comments