[mercury-users] hi & a feq queries

Donald Syme Donald.Syme at cl.cam.ac.uk
Tue Aug 18 10:29:47 AEST 1998


> Actually this is a case of the error message not being all it could -
> the bug is that you're binding a non-local variable inside the pred
> expression. 

Thanks for your help.  Re. this last example: the point I was making
was that the compiler has different behaviour on beta-equivalent forms,
which surprised me, given Mercury is a pure language.  The "binding
of the non-local variable" (a rather operational way to look at it)
is clearly ok. in such limited cases.  But it's no big deal.

>	:- func f(int) = string.
>	f(N) = (if N mod 2 = 0 then "foo\n" else "bar\n").

Ah.. stupid me.  However this form is not documented in the
reference manual, but of course I should have just tried the most
obvious thing!

Thanks again,
D






More information about the users mailing list