Hi,
I see some inconsistency in the way Visual Prolog compiler traps and reports the following error: The interface 'winner{@Vacancy}' takes 1 argument(s). Consider the following code which I assumed to be valid; the compiler throws up this error at the the line marked /*1*/ , BUT NOT at the one marked /*2*/. To clear the error, I had to add an unbounded domain as illustrated by the commented statement -- which I did not like. Is there some logic to this behavior that I don't understand?
The compiler sees that Q must be an integer queue, because we insert 17 into it.
In your line /*1*/ the compiler cannot infer a value for type parameter @Vacancy from the context. However in line /*2*/ it can always determine the value of the type parameter from context (provided the context, i.e. line /*1*/, is stated syntactically correct). Thus, the type parameter cannot be ommitted in /*1*/, but can be ommitted in /*2*/.
The value for type parameter @Vacancy, which has to be supplied in /*1*/, does not need to be _. Usually the code would be something like:
Thanks Martin.
Since this issue is being brought about by the parameter in the winner interface, I have had to move the method domain from where I thought would be its most logical home to one of my existing and non-parameterized interface -- similar to your winnerDomains in the second example.