Re: [m-users.] Free and Ground in the same error line?

"Zoltan Somogyi" <[email protected]> Sat, 28 Oct 2023 21:42:08 +1100 (AEDT)
Newsgroups gmane.comp.lang.mercury.general
Message-ID <[email protected]>
On 2023-10-28 21:36 +11:00 AEDT, "Volker Wysk" <[email protected]> wrote:
> You don't have an "else" for your second "if".

That is clearly the source of the error in Sean's program, but there is
another issue here. The Mercury reference manual lists if-then-else
as a DCG goal type, but does NOT list if-then without else as a DCG goal type.
On the other hand, the DCG goal parser in the compiler does accept
else-less if-then DCG goals. This seems to be either an oversight in the parser,
or, more likely, a hangover from the ancient past. Either way, it seems to be
the cause of the lack of a direct error message for situations like this.

Zoltan.
_______________________________________________
users mailing list
[email protected]
https://lists.mercurylang.org/listinfo/users