
14 Jul
2009
14 Jul
'09
10:51 p.m.
I'm trying to define a macro inside a template that generates an existing macro: --- #define hsc_test(hst,ct) \ { \ printf("#def inline int b_%s(void){return %s;}\n", hst,ct); \ printf("foreign import ccall b_%s :: CInt\n", hst); \ } --- Contrary to my expectation, the '#def' construct printed at the first 'printf' is included in the final haskell file, instead of beeing removed and replaced by a C function definition in a c header file. Is it possible to define an hsc_-like construct that generates code that is again parsed by hsc2hs? Thanks, Maurício