[m-users.] Global Variables in Mercury

Julien Fischer jfischer at opturion.com
Wed Nov 6 19:39:32 AEDT 2013


Hi,

On Wed, Nov 6, 2013 at 7:24 PM, John Adams <jpadams78 at gmail.com> wrote:

> Is there a way I can declare mutable global variables in Mercury?
> I don't plan to use C/C++ interface, but (impure) mercury code.
>

Yes, see the ``Module-local mutable variables'' section of the reference
manual.

Alternatively, if you want a mutable location on the heap, then have a look
at the store
module instead.  (There's also an undocumented impure variant of that
called mutvar
in the standard library.)

Cheers,
Julien.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20131106/ed6de885/attachment.html>


More information about the users mailing list