forked from mozart/mozart2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix error message on failed unification
Sometimes, unification fails with a nonsensical error message like this. %***************************** failure ************************** %** %** Tell: [1] = [1] It appears that rebinding is not properly undone, and the two values are still aliased when producing the error message. Hence the confusing output. XXX: This fix works but I have no idea why.
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
functor | ||
import | ||
VM | ||
export | ||
Return | ||
define | ||
Return = unify([vmlist(proc {$} | ||
try | ||
{VM.list} = unit | ||
fail | ||
catch failure(debug:d(info:[eq(unit _)] ...) ...) then | ||
skip | ||
end | ||
end | ||
keys:[unify]) | ||
order(proc {$} | ||
fun {Const X} [1 2 X] end | ||
in | ||
try | ||
{Const 1} = {Const 2} | ||
fail | ||
catch failure(debug:d(info:[eq(1 2)] ...) ...) then | ||
skip | ||
end | ||
end | ||
keys:[unify]) | ||
]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters