[m-rev.] for review: namespace changes

Tyson Dowd trd at cs.mu.OZ.AU
Thu May 3 02:29:29 AEST 2001


On 03-May-2001, Peter Ross <petdr at cs.mu.OZ.AU> wrote:
> Hi,
> 
> For Tyson to review.
> 
> ===================================================================
> 
> 
> Estimated hours taken: 2
> Branches: main
> 
> Merge the changes from the dotnet-foreign branch which deal with
> namespaces.
> 
> compiler/ilasm.m:
> compiler/ilds.m:
> compiler/mlds_to_il.m:
> compiler/mlds_to_mcpp.m:
>     For the module foo.m, place all the code in a type called
>     mercury_code in the namespace foo rather than in the type foo and no
>     namespace.  This helps avoid problems where you have a type and a
>     namespace at the top level with the same name.
> 
> library/array.m:
> library/builtin.m:
> library/private_builtin.m:
> library/std_util.m:
>     Change to using the new convention for namespaces.
> 
> 
> Index: compiler/ilasm.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/ilasm.m,v
> retrieving revision 1.8
> diff -u -r1.8 ilasm.m
> --- compiler/ilasm.m	2001/04/23 12:24:33	1.8
> +++ compiler/ilasm.m	2001/05/02 15:13:00
> @@ -318,11 +318,15 @@
>  	ilasm__write_list(Contents, "\n", output_classdecl, Info2, Info),
>  	io__write_string("\n}").
>  ilasm__output_decl(namespace(DottedName, Contents), Info0, Info) --> 
> -	io__write_string(".namespace "),
> -	output_dotted_name(DottedName),
> -	io__write_string(" {\n"),
> -	output(Contents, Info0, Info),
> -	io__write_string("}\n").
> +	( { DottedName \= [] } ->
> +		io__write_string(".namespace "),
> +		output_dotted_name(DottedName),
> +		io__write_string(" {\n"),
> +		output(Contents, Info0, Info),
> +		io__write_string("}\n")
> +	;
> +		output(Contents, Info0, Info)
> +	).
>  ilasm__output_decl(method(MethodHead, MethodDecls), Info0, Info) --> 
>  	io__write_string(".method "),
>  	output_methodhead(MethodHead, Info0, Info1),

This is actually just a miscellaneous fix, you should mention in
separately in the log message.

Otherwise this change is fine.

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