[m-rev.] For review: add reference in "Promising purity" section

Mark Brown mark at csse.unimelb.edu.au
Fri May 25 12:53:09 AEST 2007


On 25-May-2007, Ralph Becket <rafe at csse.unimelb.edu.au> wrote:
> Estimated time taken: 0.1
> Branches: main
> 
> doc/reference_manual.texi:
> 	Add a reference to the promise_purity scopes described in
> 	the `Goals' section of the reference manual, from the
> 	`Promising purity' section.
> 
> Index: reference_manual.texi
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
> retrieving revision 1.390
> diff -u -r1.390 reference_manual.texi
> --- reference_manual.texi	4 Apr 2007 04:38:49 -0000	1.390
> +++ reference_manual.texi	25 May 2007 02:35:16 -0000
> @@ -9139,12 +9139,16 @@
>  Programmers should be very careful about mixing code that is promised
>  pure with impure predicates or functions that may manipulate the
>  same hidden state (for example, the impure predicates used to implement 
> -a predicate that is promised pure); the @samp{promise pure} declaration
> +a predicate that is promised pure); the @samp{promise_pure} declaration
>  is supposed to promise that impure code cannot change the declarative
>  semantics of pure code.  The module system can be used to minimize the
>  possibility of making errors with such code, by keeping impure
>  predicates or functions behind the interface where code is promised
>  pure.
> +
> +Note that @code{promise_purity} pragmas are largely redundant due to 
> +the @samp{promise_pure}, @samp{promise_semipure}, and @samp{promise_impure}
> +casts described in @ref{Goals}.

It is misleading to suggest they are redundant.  The casts can't cover
headvar unifications, so the pragmas are the only way to reach these at the
moment.

Cheers,
Mark.

--------------------------------------------------------------------------
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