<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<small><small><font face="sans-serif"><big>Dear experienced ones,<br>
<br>
<br>
in aim to provide a handy "one arg per config" interface to Tk
configuration for the mercury_tk interface, I have a question:<br>
<br>
First, here is some surrounding code:<br>
<br>
:-type data ---><br>
forename(string);<br>
surname(string);<br>
...<br>
:-inst forenameG ---> forename(ground).<br>
:-inst surnameG ---> surname(ground).<br>
:-inst forenameF ---> forename(free).<br>
:-inst surnameF ---> surname(free).<br>
<br>
:-pred isForename(<a class="moz-txt-link-freetext" href="data::(forenameF">data::(forenameF</a> >> forenameG), io::di, io::uo)
is det.<br>
isForename(forename("F"), !IO).<br>
:-pred isSurname(<a class="moz-txt-link-freetext" href="data::(surnameF">data::(surnameF</a> >> surnameG), io::di, io::uo) is
det.<br>
isSurname(surname("S"), !IO).<br>
<br>
<br>
The attached code sample runs fine as long as there is only a single
mode, <br>
<br>
:-pred isName(data, io, io).<br>
:-mode isName((forenameF >> forenameG), di, uo) is det.<br>
isName(F::(forenameF >> forenameG), I::di, O::uo) :-<br>
isForename(F, I, O).<br>
<br>
i.e. there are no compiler complaints.<br>
<br>
But once I use more modes, <br>
<br>
:-pred isName(data, io, io).<br>
:-mode isName((forenameF >> forenameG), di, uo) is det.<br>
:-mode isName((surnameF >> surnameG), di, uo) is det.<br>
:-pragma promise_pure( isName/3).<br>
isName(S::(surnameF >> surnameG), I::di, O::uo) :-<br>
isSurname(S, I, O).<br>
isName(F::(forenameF >> forenameG), I::di, O::uo) :-<br>
isForename(F, I, O).<br>
<br>
I reveive the following error message:<br>
<br>
configMode.m:029: In clause for `isName(((configMode.forenameF) >><br>
configMode.m:029: (configMode.forenameG)), di, uo)':<br>
configMode.m:029: in argument 1 of call to predicate<br>
configMode.m:029: `configMode.isForename/3':<br>
configMode.m:029: mode error: variable `F' has instantiatedness
`free',<br>
configMode.m:029: expected instantiatedness was<br>
configMode.m:029: `bound(configMode.forename(free))'.<br>
configMode.m:026: In clause for `isName(((configMode.surnameF) >><br>
configMode.m:026: (configMode.surnameG)), di, uo)':<br>
configMode.m:026: in argument 1 of call to predicate<br>
configMode.m:026: `configMode.isSurname/3':<br>
configMode.m:026: mode error: variable `S' has instantiatedness
`free',<br>
configMode.m:026: expected instantiatedness was<br>
configMode.m:026: `bound(configMode.surname(free))'.<br>
<br>
Is there anybody to explain me this message and - even better ;-) -
tell me a way to get this problem solved? This would mean I could begin
finishing mercury_tk, as such an interface to Tk configurations,<br>
<br>
configName(free) >> configName(ground),<br>
<br>
would appear quite satisfying to me.<br>
<br>
<br>
Thank you in advance,<br>
<br>
Nick<br>
<br>
<br>
<br>
<br>
<br>
<br>
</big></font></small></small>
</body>
</html>