Files
mercury/tests/submodules/mutable_parent.mutable_parent_helper_1.m
Zoltan Somogyi eb6617c175 Rename X's aux modules as X_helper_N in submodules.
tests/submodules/*.m:
    Rename modules as mentioned above.

    Indent nested submodules to make them stand out.

    Group foreign_procs by what predicate they implement, not by
    their implementation language.

tests/submodules/*.m:
tests/submodules/*.err_exp:
tests/submodules/Mmakefile:
tests/submodules/Mercury.options:
    Update all references to the moved modules.
2023-06-19 22:16:36 +02:00

26 lines
810 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module mutable_parent.mutable_parent_helper_1.
:- interface.
:- pred run_child(io::di, io::uo) is det.
:- include_module mutable_parent_helper_2.
:- implementation.
:- mutable(child_global, int, 200, ground,
[untrailed, attach_to_io_state]).
run_child(!IO) :-
io.write_string("In child ...\n", !IO),
get_parent_global(ParentGlobal, !IO),
get_child_global(ChildGlobal, !IO),
io.format(" parent_global = %d\n", [i(ParentGlobal)], !IO),
io.format(" child_global = %d\n", [i(ChildGlobal)], !IO),
set_parent_global(ParentGlobal + 1, !IO),
set_child_global(ChildGlobal + 1, !IO).