[mercury-users] `.m' extension (was: scope resolution operator)

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Oct 5 00:47:34 AEST 1999


On 04-Oct-1999, Michael Day <mikeday at corplink.com.au> wrote:
> 
> Incidentally a .m extension creates unending strife when GNU
> tools "recognize" it as being an Objective-C file, but no doubt that's not
> exactly news.

No, that's the first we (or at least I) have heard of it.
Which GNU tools exactly?

If those tools do not work with Mercury, then please send
the authors or maintainers of those tools bug reports.
Also, please tell the authors or maintainers of those
tools to register whatever file extensions they use via the
NIST Identifier Collaboration Service <http://pitch.nist.gov/nics/>.

> Is there a way for mmc to be persuaded into accepting
> filenames with arbitrary extensions? At present it assumes that foo.bar is
> a module name and tacks on .m regardless...

Currently no.

Fixing this would be a fairly tedious but straight-forward task.
This is the sort of thing that could be done fairly easily by
someone outside of the Mercury group.  If anyone wants to have
a go at this, that would be nice.  I've outlined below what
would need to be done.

Cheers,
	Fergus.

----------

A new string-value option, called say `--source-extension',
would need to be added in compiler/options.m, together with
a predicate to look up the value of this option in the options
table.

The commands

	fgrep '".m"' compiler/*.m
	fgrep ".m'" compiler/*.m

show all the places in the compiler that would need to be changed
to call this new predicate.

In addition, scripts/Mmake.rules contains lots of occurrences
of `.m' that would need to change.  The best way to do it
would be to define a variable called say MERCURY_SOURCE_EXTENSION
in scripts/Mmake.vars.in and then replace all the occurrences
of `.m' in scripts/Mmake.rules with $(MERCURY_SOURCE_EXTENSION).
For extra credit you could introduce a new option called say
`--source-extension' in scripts/mmake.in, which would set that
variable.

I think that is all, but it is possible that I may have missed
some other places that might need to be changed.
If anyone does want to have a go at this, make sure you start
with a relatively recent release-of-the-day release, to minimize
difficulty in merging your changes with our latest development
version.

-- 
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-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list