[mercury-users] Meta programming in Mercury

Fergus Henderson fjh at cs.mu.OZ.AU
Wed May 19 14:12:52 AEST 1999


On 18-May-1999, Luke Evans <Luke.Evans at seagatesoftware.com> wrote:
> Is there any way to submit new code to the Mercury compiler at runtime?

Yes, you can write the code out to a file and then use
io__invoke_system to invoke `mmc' to compile it.  You can then
dynamically link the compiled code into your executable using the
dynamic linking support in extras/dynamic_linking/dl.m (in the latest
development versions of the Mercury distribution).

The Mercury debugger uses this technique to support interactive queries.
See the code in browser/interactive_query.m to see exactly how this is
done.  (Again, this is only available in the latest development versions
of the Mercury distribution, not in 0.8.)

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