[m-dev.] For review: improve verbose warning about using "call" in an expression

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Dec 8 20:36:47 AEDT 1999


On 08-Dec-1999, Robert Ernst Johann JESCHOFNIK <rejj at cat.cs.mu.OZ.AU> wrote:
> 
> Estimated hours taken: 0.1 
> 
> compiler/typecheck.m:
>     Add a comment to the verbose message given as a warning when "call" is seen
>     in an expression, discussing what to do if the user really did mean to
>     use "call" (perhaps as a type constructor).
>     Suggestions are made to check the arity of the "call" they are using, as
>     well as to ensure that it really is defined.
> 
> Index: compiler/typecheck.m
> ===================================================================
> RCS file: /home/mercury1/repository//mercury/compiler/typecheck.m,v
> retrieving revision 1.267
> diff -u -r1.267 typecheck.m
> --- typecheck.m	1999/11/08 15:00:07	1.267
> +++ typecheck.m	1999/12/08 09:09:25
> @@ -5169,7 +5169,25 @@
>  		"  see the ""Creating higher-order terms"" section of the\n"),
>  				prog_out__write_context(Context),
>  				io__write_string(
> -		"  Mercury Language Reference Manual.\n")
> +		"  Mercury Language Reference Manual.\n"),
> +				prog_out__write_context(Context),
> +				io__write_string(
> +    "  If you really are trying to use `call' as an expression\n"),
> +        prog_out__write_context(Context),
> +        io__write_string(
> +    "  and not as an application of the predicate call/N, make\n"),

call/N is a language builtin, not a predicate, so I suggest

	s/predicate/language builtin/

Then you probably want to wrap the word `make' onto the next line.

Apart from that, your change looks great, thanks.  If you've made sure
that it compiles and you've tested it to make sure that the output
looks OK, then please commit this change.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list