I am learning VIP (Visual Prolog Environment 7.5 Commercial Edition) with the help of the book VisualPrologBeginners_7.2.pdf.
Reproducing the folowing example (Chapter 10 Recursion, list and sorting) :
Code: Select all
implement main
open core
clauses
run() :-
console::init,
counter:: count(1),
_X=stdIO::readChar().
end implement main
goal
console::runUtf8(main::run).
Code: Select all
class counter
open core
predicates
count : (integer Number) procedure.
end class counter
Code: Select all
implement counter
open core
clauses
count(Number) :-
Number<11,
stdIO::write(Number),
stdIO::nl,
NextNumber = Number+1,
count(NextNumber).
count(_) :-
stdIO :: write("C'est la fin !\n"), !.
end implement counter
Error message :
Type Action Description Filename Path
e631 The predicate 'counter::count/1 (i)', which is declared as 'procedure', is actually 'multi' Counter.pro
replacing "count(_)" with "count(11) in the second clause :
Type Action Description Filename Path
e631 The predicate 'counter::count/1 (i)', which is declared as 'procedure', is actually 'nondeterm' Counter.pro
I don't understand the reason why.
Thank you in advance for help.
Jacques