[mercury-users] tutorial questions

Julien Fischer juliensf at csse.unimelb.edu.au
Sat Dec 24 18:34:23 AEDT 2011


x
Hi,

On Fri, 23 Dec 2011, Michael Hendricks wrote:

> I've just finished compiling Mercury 11.07 and am starting to learn the
> language based on the Tutorial.  Some compiler messages I saw while trying
> to break the Hello World example, suggest the Tutorial may be using
> slightly outdated syntax.

Presumably, you mean the tutorial on the webpage?  Yes, the syntax
it uses is in some cases outdated (but still supported).

> Section 9.1 of the Language Reference Manual suggests that "." has replaced
> "__" for referencing predicates inside a module.  For new code, should I be
> using "."?

Both are still currently supported, but the intention is that "." should
be used.  Support for "__" will eventually be dropped.

> Section 2.11 of the Language Reference Manual suggests that state variable
> notation should be used instead of DCG notation for the Hello World
> example.  Have I understood that correctly?

Yes.  We recommend using state variables for most state threading
purposes.  The tutorial only uses DCGs because it predates the
introduction of state variables.

Julien.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list