[m-users.] Stuck trying to compile simple program
zeldangit
zeldangit at gmail.com
Wed Nov 8 13:01:15 AEDT 2017
Thank you so much Mr. Somogyi! I know I am an idiot, so thank you for
taking the time to explain everything.
On Tue, Nov 7, 2017 at 8:40 PM, Zoltan Somogyi <zoltan.somogyi at runbox.com>
wrote:
>
>
> On Tue, 7 Nov 2017 20:32:18 -0500, zeldangit <zeldangit at gmail.com> wrote:
> > I am currently making my way through Ralph Becket Mercury tutorial and I
> am
> > stuck trying to add a simple length function to my program. Here it is
> > along with the error I am having
> > <https://gist.github.com/zeldangit/9448809d80f7613d74189feb9f5529ac>.
> Any
> > help would be much appreciated.
>
> You didn't import the int module. In Mercury, the arithmetic operations
> on a type such as int or float are in scope only if you import the Mercury
> standard library module that defines those operations. (You would be
> surprised by how many modules don't do any arithmetic at all.)
>
> After you fix that error, you will get another one about the call to length
> in the second clause being ambiguous, because the list module also defines
> a function named length. You will need to either rename your function
> or add a module qualification to the call to remove the ambiguity.
>
> Zoltan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20171107/14541053/attachment.html>
More information about the users
mailing list