[m-rev.] for review: fix problem with mmc --make and .mm grades

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Jan 14 14:45:58 AEDT 2005


On 14-Jan-2005, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
> retrieving revision 1.214
> diff -u -r1.214 handle_options.m
> --- compiler/handle_options.m	7 Jan 2005 02:31:15 -0000	1.214
> +++ compiler/handle_options.m	13 Jan 2005 16:29:44 -0000
> @@ -1655,9 +1655,32 @@
>  		string__split(Grade0, PicRegIndex, LeftPart, RightPart0),
>  		string__append(".picreg", RightPart, RightPart0)
>  	->
> -		Grade = LeftPart ++ RightPart
> +		Grade1 = LeftPart ++ RightPart
>  	;
> -		Grade = Grade0
> +		Grade1 = Grade0
> +	),
> +	%
> +	% Strip out the `.mm' or `.dmm' part of the grade --
> +	% `.mm' is implied by `.mmcs' and likewise `.dmm' is
> +	% implied by `.dmmcs'.  If we don't do this then the

mmcs -> mmsc and dmmcs -> dmmsc

> +	% the resulting grade string will contain both and
> +	% we may end up looking for the library in a directory
> +	% that doesn't exist.
> +	%
> +	(
> +		string__sub_string_search(Grade0, ".mm", MM_Index),
> +		string__split(Grade1, MM_Index, MM_LeftPart, MM_RightPart0),
> +		string__append(".mm", MM_RightPart, MM_RightPart0)
> +	->
> +		Grade = MM_LeftPart ++ MM_RightPart
> +	;
> +		string__sub_string_search(Grade0, ".dmm", DMM_Index),
> +		string__split(Grade1, DMM_Index, DMM_LeftPart, DMM_RightPart0),
> +		string__append(".dmm", DMM_RightPart, DMM_RightPart0)
> +	->
> +		Grade = DMM_LeftPart ++ DMM_RightPart
> +	;
> +		Grade = Grade1
>  	).

This looks too hacky to me. The right solution would be to add a flag to
each entry in grade_component_table to say whether or not it should be used
in constructing the grade string. That would also handle picreg.

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