[mercury-users] Conditional compilation

Elmar Haneke elmar at haneke.de
Wed Aug 17 01:23:03 AEST 2005


> Is there a way of having conditionally compiled debugging code in Mercury?

I did have the question about conditional compiling solved for my own 
by using the c-proprocessor:

In a fist pass the source is preprocessed by gcc:

gcc -D... -E - <$1.m|grep "^[^#]" >/tmp/$1.m

The grep postprocessing the output is for removing the line-directives 
inserted by gcc.

The second pass is compiling the resulting file.

Elmar

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