[mercury-users] Meta programming on exported module items?

doug.auclair at logicaltypes.com doug.auclair at logicaltypes.com
Wed Feb 1 05:26:36 AEDT 2006


Dear all,

I'm wondering if Mercury allows metaprogramming or reasoning on exported module items, such as exported predicates/functions.  I see (but do not yet comprehend) the type_desc module (but I am working on understanding this, as there's an interesting paper on the automatic generation of random test data from any arbitrary type in Isabelle (HOL): http://www4.in.tum.de/~nipkow/pubs/sefm04.html -- an useful enhancement to QuickCheck).  But I do not believe the type_desc module, gives, e.g. iteration over all exported items of a module.

I ask because I've created a unit-test-case-generator in Prolog for Prolog programs.  It uses the predicate predicate_property/2 to capture the exported predicates, then it writes test skeletons for all those predicates based on mode analysis.  I would like to do the same thing for the Mercury systems I build -- these skeletons save quite a bit of time in the construction of unit test cases, and it appears that qcheck does not support this (I am speaking out of turn here as I have neither used Haskell's QuickCheck nor Mercury's qcheck ... I'm looking forward to using this system).

I would prefer to rely on a metaprogramming system, NOT a source parsing system.  The latter breaks from release to release as syntax/semantics change and is prone to bitrot from eventual disuse and neglect.  

Any tips/starting points/tutorials on metaprogramming, particularly for exported module items?

Sincerely,
Doug Auclair

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