check if argument to when is bound (obs from Ulrich Neumerkel).
This commit is contained in:
		@@ -315,6 +315,8 @@ when(_,Goal) :-
 | 
				
			|||||||
% $when/5 and $when_suspend succeds when there is need to suspend a 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'(nonvar(V), G, Done, LG0, LGF) :-
 | 
				
			||||||
	'$when_suspend'(nonvar(V), G, Done, LG0, LGF).
 | 
						'$when_suspend'(nonvar(V), G, Done, LG0, LGF).
 | 
				
			||||||
'$when'(?=(X,Y), G, Done, LG0, LGF) :-
 | 
					'$when'(?=(X,Y), G, Done, LG0, LGF) :-
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user