[m-dev.] [refman] Mutable variables example

doug.auclair at logicaltypes.com doug.auclair at logicaltypes.com
Mon May 29 23:54:16 AEST 2006


Dear Julien and all,

You wrote:
>On Fri, 26 May 2006 doug.auclair at logicaltypes.com wrote:
[...]
>The reference manual is not exactly exact in that respect.  It should
>say that the mutable name has to be a valid Mercury name (as defined in
>section 2.2 of the reference manual.)

So, then, it's 'kinda' exact? *smirk*  Your change sounds helpful; would it
please be added to the refman in that section?

>I think that example [snipped] is too large for the reference manual - something
>of that size would be okay in the samples directory though.

Okay; if you believe that is appropriate, then could it be added to the samples/?
I also believe that a code snippet would be illustrative in sect 9.6 in the refman itself
(something like the following to show declaration, mutation and use):

> :- mutable(mutant, int, 0, ground, []).
% ...
>       impure set_mutant(2),
% ...
>       semipure get_mutant(M1),
          Ans = M1 + 40,     % Ans is ground value 42
% ...

Sincerely,
Doug Auclair


--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list