[m-rev.] for review: copy/2 implementation for il backend

Peter Ross pro at missioncriticalit.com
Wed Nov 27 22:32:51 AEDT 2002


fjh wrote:

> In general I think it is not a good idea to implement copy/2 in
> a foreign language -- it should be implemented in Mercury,
> using construct and deconstruct from std_util.m.
>
That would be the best approach, except that only a small part of
deconstruct.m is implemented for the IL backend and none of the construct
module.

> However, if you really want to...
>
So for the moment I will stick with the current implementation.

> On 26-Nov-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > +++ library/builtin.m 26 Nov 2002 12:53:52 -0000
> > @@ -415,6 +415,9 @@
> >  call_rtti_generic_compare(Res, X, Y) :-
> >  rtti_implementation__generic_compare(Res, X, Y).
> >
> > +:- pragma foreign_decl("MC++", "
> > +#using ""builtin__csharp_code.dll""
> > +").
>
> Doesn't that add a dependency which needs to be reflected
> in the Mmakefile somewhere?
>
Yes there does and it has been added.

> > @@ -462,6 +463,56 @@
> > +:- pragma foreign_decl("C#", "
> > +using System;
> > +using System.Reflection;
> > +").
>
> Please don't use "using" declarations in the Mercury implementation.
> Just fully-qualify any references you need.  That makes it easier
> for other Mercury maintainers (who are unlikely to be familiar with
> the .NET library) to figure out which entity each name refers to and
> where to find its documentation.
>
Done.

> > +
> > + // XXX We can only access the non-public fields of a fully
> > + // trusted assembly.
> > + deep_copy_fields(t.GetFields(BindingFlags.NonPublic |
> > + BindingFlags.Instance), n, o);
>
> I don't understand the XXX here.  You should be able to access the
> non-public fields of an object defined in any assembly (trusted or not)
> iff the assembly in which this code resides, i.e. the Mercury standard
> library assembly, is fully trusted.
>
Misunderstanding on my part, I have changed this comment to state that the
assembly containg this code (mercury.dll) needs to have
ReflectionPermissionfor this to run successfully.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.419 / Virus Database: 235 - Release Date: 11/19/2002

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