[m-rev.] diff: Improve the style of random.m

Julien Fischer jfischer at opturion.com
Wed May 25 16:04:00 AEST 2016



On Wed, 25 May 2016, Paul Bone wrote:

> Improve the style of random.m
>
> library/random.m:
>    As above, update documentation comments style, use state variables as
>    part of documentation comments and remove obvious module qualifications.
> ---
> library/random.m | 132 ++++++++++++++++++++++++++++---------------------------
> 1 file changed, 68 insertions(+), 64 deletions(-)
>
> diff --git a/library/random.m b/library/random.m
> index b10f0a7..2ce0150 100644
> --- a/library/random.m
> +++ b/library/random.m
> @@ -55,57 +55,61 @@
> 
> %---------------------------------------------------------------------------%
> 
> -    % The type `random.supply' represents a supply of random numbers.
> +    % The type `supply' represents a supply of random numbers.
>     %
> -:- type random.supply.
> +:- type supply.
> 
> -    % random.init(Seed, RS): creates a supply of random numbers RS
> -    % using the specified Seed.
> +    % init(Seed, RS).
>     %
> -:- pred random.init(int::in, random.supply::uo) is det.
> +    % Creates a supply of random numbers RS using the specified Seed.
> +    %
> +:- pred init(int::in, supply::uo) is det.
> +
> +    % random(Num, !RS).
> +    %
> +    % Extracts a number Num in the range 0 .. RandMax from the random number
> +    % supply !RS.
> +    %
> +:- pred random(int, supply, supply).
> +:- mode random(out, mdi, muo) is det.
> +:- mode random(out, in, out) is det.

In other library modules, we generally list the modes in "order" of
increasing uniqueness, so I would re-order those mode declarations.

Julien.


More information about the reviews mailing list