[m-rev.] for review: svmap
Julien Fischer
juliensf at cs.mu.OZ.AU
Tue Dec 14 14:22:05 AEDT 2004
On Tue, 14 Dec 2004, Zoltan Somogyi wrote:
> library/svmap.m:
> Add this new module svmap for making it easier to work with maps in
> code that uses state variables. For every predicate in map.m that
> updates maps, svmap.m contains a predicate doing the same thing
> with an argument order conducive to the use of state variables.
>
Presumably this is a transitional device until the order of the arguments
in the map module is swapped? If so, I think the log message, NEWS file
etc should say that.
> library/library.m:
> Mention the new module.
>
> NEWS:
> Mention the new module.
>
...
> ===================================================================
> RCS file: library/svmap.m
> diff -N library/svmap.m
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ library/svmap.m 13 Dec 2004 12:36:55 -0000
> @@ -0,0 +1,132 @@
> +%---------------------------------------------------------------------------%
> +% Copyright (C) 2004 The University of Melbourne.
> +% This file may only be copied under the terms of the GNU Library General
> +% Public License - see the file COPYING.LIB in the Mercury distribution.
> +%-----------------------------------------------------------------------------%
> +%
> +% File: svmap.m.
> +% Author: zs.
> +% Stability: high.
> +%
> +% This file provides an interface to the 'map' ADT that is conducive to the
> +% use of state variable notation. The predicates here do the same thing as
> +% their counterparts in the map module; the only difference is the order of the
> +% arguments.
> +%
> +%-----------------------------------------------------------------------------%
> +%-----------------------------------------------------------------------------%
> +
> +:- module svmap.
> +:- interface.
> +:- import_module list, assoc_list, map.
> +
> +%-----------------------------------------------------------------------------%
> +
> + % Insert a new key and corresponding value into a map.
> + % Fail if the key already exists.
> +:- pred svmap__insert(K::in, V::in, map(K, V)::in, map(K, V)::out) is semidet.
Our current coding standards suggest putting an empty comment between
the predicate description and the declaration, something like:
% Insert a new key and corresponding value into a map.
% Fail if the key already exists.
%
:- pred svmap__insert(K::in, V::in, map(K, V)::in, map(K, V)::out) is semidet.
Otherwise that looks fine.
Cheers,
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list