[m-rev.] more .NET fixes/work-arounds (not committed)

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Feb 14 16:55:36 AEDT 2003


On 13-Feb-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> compiler/stack_layout.m:
> 	Implement concat_strings in Mercury.
> 	(XXX FIXME Why was this ever implemented in C anyway?

Because the result of that operation is not really a Mercury string. It has
embedded null characters, and you can't figure out how long the byte array
is from its contents if you don't already know.

If I were writing that code now, I would make the result a foreign type
instead of string, but that wasn't an option then.

> +% This version is only used if there is no matching foreign_proc version.
> +% XXX why is this implemented in C anyway?  Why not just use Mercury?
> +concat_string_list(StringsList, _Len, String) :-
> +	String = string__append_list(StringsList).

This Mercury implementation therefore has a very subtle bug.

Stack_layout.m is used only with debugging and/or native-gc grades.
Since native gc is not an option on .net and any debugging on .net
will be totally different from the existing debugging infrastructure,
the proper Mercury implementation should just abort with an error message.

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