[m-dev.] Re: user-defined operators

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Jul 10 16:20:04 AEST 1999


On 10-Jul-1999, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Fri, Jul 09, 1999 at 12:20:39PM +1000, Fergus Henderson wrote:
> > No, that wouldn't solve the problem.  If I want to write a preprocessor
> > that adds new syntax to the language, then I won't be able to use the
> > standard library operation which reads a Mercury module file and all the
> > interfaces that it depends on, because the input to my preprocessor
> > won't be a valid Mercury module, it will just be a file containing
> > Mercury terms.
> 
> Ok, that's a particularly bad example.  For that, as you say, you'll
> have to read the file an item at a time.  But I think what I'm
> suggesting would work for the most common applications that want to
> read code.

I think preprocessors of various kinds, all of which add some additional
language syntax, are probably the most commonly desired application.
What other applications are there?  Pretty printers, compilers,
program analysis tools.  But most of these kinds of things will be
supplied with the Mercury distribution anyway -- users generally won't
want to write such things themselves, IMHO.

> Anyway, this example would be better handled with cpp.

Using cpp for languages other than C is a really bad idea, for reasons which
I can explain in detail if you don't believe me.

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