From 55036ad9bb517d3f00dd9d049dd9fb0926d66bb3 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 17 May 2009 10:58:21 -0700 Subject: [PATCH] check if argument to when is bound (obs from Ulrich Neumerkel). --- pl/corout.yap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pl/corout.yap b/pl/corout.yap index 8a3a11839..3adca2255 100644 --- a/pl/corout.yap +++ b/pl/corout.yap @@ -315,6 +315,8 @@ when(_,Goal) :- % $when/5 and $when_suspend succeds when there is need to suspend a goal % % +'$when'(V, G, Done, LG0, LGF) :- var(V), !, + '$do_error'(instantiation_error,when(V,G)). '$when'(nonvar(V), G, Done, LG0, LGF) :- '$when_suspend'(nonvar(V), G, Done, LG0, LGF). '$when'(?=(X,Y), G, Done, LG0, LGF) :-