[m-rev.] for review: refactor mlds_to_il.m

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jul 11 19:16:28 AEST 2001


On 10-Jul-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> On Tue, Jul 10, 2001 at 02:46:18AM +1000, Fergus Henderson wrote:
> > I suggest you treat "default" as "assembly" (and document this in mlds.m).
> > 
> > (For some reason ilasm.m doesn't include "assembly" as one of the valid
> > "classattrs", only as a "methodattr" and a "fieldattr", but I think that
> > is a bug -- the docs on MSDN say that the "assembly" attribute is allowed
> > on classes.)
>
> Not according to the docs I have.  There is nested assembly but not
> assembly.  Section 9.1.1 of Partition II: Metadata.

OK, I had a look at the documentation there.  Now I understand it a bit better.
For top-level types, the attribute which means that the type is accessable only
to other types in the same assembly is spelt "private".

Why did you say it needed to be public?

<checks mail archive>

 |        On the IL backend the mercury code is placed in a seperate class to
 |        the environment data, so the env_type decls must be public so as to
 |        be accessible from the code.

Hmm, that's bogus, since the mercury_code class will be able to access the
env_type even if it is "private", since they are in the same assembly.

 |    If the above is not understandable here is the code that we generate.
 | 
 |    .class mercury_code {
 |        .method f(...)
 |        {
 |            ldfld env::commit // reference to field in another class.
 |        }
 |    }
 | 
 |    .class env {
 |        .field commit // Must be public so that the field is accesible for
 |                        // the mercury_code class.
 |    }

The *field* needs to have accessability "assembly".
The *type* should remain private.

But anyway as per my other comments, there is no need to even include
the commit fields in the environment class at all.  So once that is fixed,
this problem will go away.

-- 
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