[m-rev.] for review: reimplement source package name change
Fergus Henderson
fjh at cs.mu.OZ.AU
Fri Jun 22 14:38:34 AEST 2001
On 21-Jun-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> The .NET backend requires that names are not only qualified with their
> namespace but the source package the name comes from. In this change we
> back out a previous solution to this problem and implement a much
> neater solution where we hide the package name in the abstract type
> mlds_module_name.
>
> This solution is neater because the package name shouldn't change once
> the name is defined. All that we may have to change is the qualifiers
> to the name.
Does this diff fix the problem with the environment types used for
nondet code?
> Index: compiler/mlds.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/mlds.m,v
> retrieving revision 1.54
> diff -u -r1.54 mlds.m
> --- compiler/mlds.m 2001/06/08 09:13:38 1.54
> +++ compiler/mlds.m 2001/06/21 10:11:58
> @@ -327,12 +327,16 @@
>
> % Given the name of a Mercury module, return the name of the corresponding
> % MLDS package.
> -:- func mercury_module_name_to_mlds(mercury_module_name) = mlds__package_name.
> +:- func mercury_module_name_to_mlds(mercury_module_name) = mlds_module_name.
>
> -% Given the name of a Mercury module, return the name of the corresponding
> -% MLDS package.
> +% Given the name of a Mercury module which qualifies a name, return the
> +% qualification part of the name.
> :- func mlds_module_name_to_sym_name(mlds__package_name) = sym_name.
I don't understand the comment here.
Perhaps an example might help.
If it only returns *part* of its input argument, then I think it should be
named differently; if I see a name `foo_to_bar' I expect that it will convert
all of the foo to a bar.
...
> @@ -1448,9 +1441,14 @@
> % e.g. `mercury.builtin', `mercury.io', `mercury.std_util', etc.,
> % when mapped to MLDS package names.
>
> -:- type mlds_module_name == prog_data__module_name.
> +% :- type mlds_module_name == prog_data__module_name.
> +:- type mlds_module_name
> + ---> name(
> + package_name :: prog_data__module_name,
> + module_name :: prog_data__module_name
> + ).
There should be comments here explaining what those fields mean.
Also the comment above should be modified to explain what this
type represents.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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