[m-rev.] for review: builtin.copy

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu May 29 15:56:34 AEST 2003


On 29-May-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > -Using `pragma c_code' doesn't work, due to the lack of support for
> > -aliasing, and in particular the lack of support for `ui' modes.
> 
> Was that comment wrong?

I think so. Given that it referred to c_code and not foreign_proc,
it was certainly ancient. I tried the diff, and it bootchecked fine
in both asm_fast.gc and hlc.gc. I believe the problem with ui modes
only exists when modechecking Mercury clauses that try to unify the
ui arg with something else and thus losing uniqueness. This was a concern
when we implemented C code with a clause that used unifications between
the headvars and the vars named in the C code, but the compiler hasn't
done that in a long time.

> > +copy(_, _) :-
> > +	% XXX Fergus fixme
> > +	error("sorry: copy/2 not yet implemented").
> 
> That stub is not needed; the compiler will generate stubs like that
> automatically with --allow-stubs.  Defining the stub manually is
> harmful, because it won't get warned about with --warn-stubs.

OK, I will delete it.

> +:- pragma foreign_proc("MC++", copy(X::in, Y::uo), [], "
> +        Y = mercury::builtin__csharp_code::mercury_code::deep_copy(X);
> +").
> +:- pragma foreign_proc("MC++", copy(X::ui, Y::uo), [], "
> +        Y = mercury::builtin__csharp_code::mercury_code::deep_copy(X);
>  ").

I will also apply a patch, but will leave its testing to you. The empty
list of properties looks suspicious, though: at the least, it should have
promise_pure in it.

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