[m-rev.] for review: reimplement source package name change
Peter Ross
peter.ross at miscrit.be
Fri Jun 22 18:42:19 AEST 2001
Fergus wrote:
> 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?
>
No, that change will have to be a lot more major, it does fix the
mlds_to_gcc problem.
> > 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.
>
A name on the .NET backend is [mscorlib]System.Xml.XmlDocument, this
function will return
System.Xml.XmlDocument
I will reword the comment to
Return the sym_name representing the fully qualified name. ie For the name
System.Object residing in the source package
mscorlib it will return System.Object.
> ...
> > @@ -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.
>
Ok.
Pete
--------------------------------------------------------------------------
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