In this example (exercise 6, p. 108 of the CTM):
-------------------
proc {Test X}
case X of f(a Y c) then {Browse 'case'(1)}
else {Browse 'case'(2)} end
end
-------------------
This suspends until X is bound:
-------------------
declare X Y {Test f(X Y d)}
-------------------
Why would this be, when it is clear that the 'd' in the input argument will not match the 'c' in the "Test" procedure, and thus the pattern-match will fail?
Why does pattern matching not "look ahead" like entailment?
That is, entailment "looks ahead" and does not suspend.
declare X Y
if f(X Y d) == f(a Y c) then {Browse 'case'(1)}
else {Browse 'case'(2)} end
TIA
-- Harmon
_________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
