[m-rev.] for review: finalisers and exceptions
Peter Wang
wangp at students.csse.unimelb.edu.au
Sun Feb 11 10:09:37 AEDT 2007
On 2007-02-09, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>
> Estimated hours taken: 1
> Branches: main
>
> Specify the behaviour of finalisers and mutable initial value expressions
> w.r.t to exceptions.
...
> Index: doc/reference_manual.texi
> ===================================================================
> RCS file:
> /home/mercury/mercury1/repository/mercury/doc/reference_manual.texi,v
> retrieving revision 1.381
> diff -u -r1.381 reference_manual.texi
> --- doc/reference_manual.texi 8 Feb 2007 01:08:10 -0000 1.381
> +++ doc/reference_manual.texi 9 Feb 2007 08:12:06 -0000
> @@ -4886,6 +4891,23 @@
> It is an error for a @samp{mutable} directive to appear in the
> interface section of a module. The usual visibility rules for sub-modules
> apply to the mutable variable access predicates.
> +
> +For the purposes of determining when mutables are assigned their inital
> +values, the expression @samp{inital_value} behaves as though it were
inital and inital_value -> initial
> +a predicate specified in an @samp{initialise} directive.
> +
> + at example
> + :- initialise foo/2.
> + :- mutable(bar, int, 561, ground, [untrailed]).
> + :- initialise baz/2.
> + at end example
> +
> +In the above example @samp{foo/2} is invoked first, then the initial
> +value of @samp{bar} is set to 561 and then @samp{baz/2} is invoked.
I suggest, "then @samp{bar} is set with an initial value of 561".
> Index: tests/hard_coded/mutable_excp.m
> ===================================================================
> RCS file: tests/hard_coded/mutable_excp.m
> diff -N tests/hard_coded/mutable_excp.m
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ tests/hard_coded/mutable_excp.m 9 Feb 2007 08:12:06 -0000
> @@ -0,0 +1,70 @@
> +% Test mutables whose inital value expressions throw exceptions.
initial
Peter
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list