[mercury-users] Re: State variable problem

Nicholas Nethercote njn at csse.unimelb.edu.au
Wed May 31 00:18:57 AEST 2006


On Wed, 31 May 2006, Nicholas Nethercote wrote:

>  type_of(app(Name, Args), app(Name, NArgs), Pos, GSyms, LSyms, !Errs) = T :-
>      T = type_of_app(call, Name, Args, NArgs, Pos, GSyms, LSyms, !Errs).
>
> I get this error message about it:
>
>  typecheck.m:918: In clause for function `typecheck.type_of/7':
>  typecheck.m:918:   warning: variable `Errs' occurs only once in this scope.
>
> I don't see what the problem is.  But if I replace the "!Errs" in the call 
> with "!.Errs, !:Errs", viz:
>
>  type_of(app(Name, Args), app(Name, NArgs), Pos, GSyms, LSyms, !Errs) = T :-
>    T = type_of_app(call, Name, Args, NArgs, Pos, GSyms, LSyms, !.Errs, 
> !:Errs).
>
> I don't get the error.

Oh, I see:  you're not allowed to use !Errs in a function application.

Nick
--------------------------------------------------------------------------
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