[mercury-users] type error in argument(s) of functor `string:det_to_int/1'

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Apr 28 23:22:49 AEST 2001


On 28-Apr-2001, Robert Bossy <bossy at ccr.jussieu.fr> wrote:
> Terrence Brannon a écrit :
> > 
> > % mmc -E --infer-all divisors.m
> > divisors.m:010: In clause for predicate `divisors:main/2':
> > divisors.m:010:   in unification of variable `I'
> > divisors.m:010:   and term `string:det_to_int(W)':
> > divisors.m:010:   type error in argument(s) of functor `string:det_to_int/1'.
> > divisors.m:010:   Argument 1 (W) has type `(io:result(string))',
> > divisors.m:010:   expected type was `string'.
> 
> It is a typical type error. [...]
> 
> Remember, Mercury terms are (very) strongly typed at compile time. This
> seems to be painful but it saves a lot of debugging because once
> compiled, the code works as expected.

Yes, it is interesting to note that Terrence Brannon has asked several
questions about compiler error messages, but none about unexpected
program behaviour :->

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  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