[mercury-users] Prev code modified

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Oct 14 18:59:18 AEST 2002


On 14-Oct-2002, Noel  Pinto <cool4life at rediffmail.com> wrote:
> On Mon, 14 Oct 2002 Ralph Becket wrote :
> >numSqre/2 is a *predicate* with two arguments.
...
> >You need to rewrite numSqre/2 as a single-argument function and 
> >all will be well.
> 
> I did the change as you told me to... But I get one error now.
...
> read_int.m:012: In clause for predicate `read_int:main/2':
> read_int.m:012:   in argument 1 of call to predicate 
> `io:write_int/3':
> read_int.m:012:   type error: argument has type `(pred)',
> read_int.m:012:   expected type was `int'.

Did you read what Ralph wrote?
Rewrite numSqre/2 as a function rather than a predicate.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list