[m-users.] Metaprogramming in Mercury

Zoltan Somogyi zoltan.somogyi at runbox.com
Wed Feb 10 02:01:42 AEDT 2016

On Tue, 9 Feb 2016 14:37:05 +0000, Mark Green <mgreen at brookes.ac.uk> wrote:

> I'm not sure this meets the usual definition of metaprogramming. While it's
> possible to write a Mercury program that is compiled and then inputs and
> works on another Mercury program, it doesn't seem to be possible to write a
> program or part of a program that is executed during compilation to
> manipulate its own code. Or is it?

During compilation, the only code that is executed is the Mercury compiler itself;
there is no mechanism to execute user code during this process.

And no: the ability to extend the compiler is not what most people think of
when they hear "metaprogramming".


More information about the users mailing list