[m-rev.] for review: add lang spec to pragma import

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 22 14:18:41 AEDT 2001


On 21-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> I haven't documented this new syntax yet, as we still accept the old
> syntax and I want to see how it works on the .NET backend before
> documenting it in the reference manual.

New language features should be documented.
If you don't want to make it part of the official documentation,
because the feature is not stable,
then document it and comment the documentation out.

In general it is best to post the documentation for review before
bothering with the code.

> Change pragma_import so that it can optionally take a language specifier.
> If the language specifier is not given we default to c.
> The new form accepted is
> 
>     :- pragma import(p(in, out), c("foo")).

For consistency with what we do for `pragma foreign_proc',
`pragma foreign_decl', etc., the language specifier should
come at the start:

	:- pragma import(c, p(in, out)).

> Index: compiler/make_hlds.m
...
> +:- func this_file = string.
> +
> +this_file = "make_hlds.m".

That function is unused.

I guess it is harmless to add it.
But if you are going to add it, I would prefer that there
be an `:- end_module declaration' immediately following it.

> Index: compiler/mercury_to_mercury.m
> +:- func this_file = string.
> +this_file = "mercury_to_mercury.m".

Likewise.

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