[m-rev.] diff: accept special names in foreign_type pragmas

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Feb 17 18:26:38 AEDT 2002


On 15-Feb-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> 
> compiler/prog_io_pragma.m:
>     Accept the special names for the builtin IL types.
...
> +++ compiler/prog_io_pragma.m	15 Feb 2002 14:44:22 -0000
> @@ -232,6 +232,91 @@
>  
>  parse_il_type_name(String0, ErrorTerm, ForeignType) :-
>  	( 
> +		String0 = "bool"
> +	->
> +		ForeignType = ok(il(value, "mscorlib",
> +			qualified(unqualified("System"), "Boolean")))
> +	;
> +		String0 = "char"
> +	->
> +		ForeignType = ok(il(value, "mscorlib",
> +			qualified(unqualified("System"), "Char")))
> +	;
> +		String0 = "object"
> +	->
> +		ForeignType = ok(il(value, "mscorlib",
> +			qualified(unqualified("System"), "Object")))
> +	;
> +		String0 = "string"
> +	->
> +		ForeignType = ok(il(value, "mscorlib",
> +			qualified(unqualified("System"), "String")))

`string' is not a value type in IL.

Also it would be better (more readable, and also more efficient) to use a
separate semidet predicate with a switch (multiple clauses), rather than an
if-then-else.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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