This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Macros and compilation


This is about macros from a compiled module not being recognised in
another compiled module. I define macros m1 and m2 in a module called
'test:
  (module-name 'test)
  (module-static #t)

  (define-syntax m1
    (syntax-rules ()
      ((m1 E)
        (m2 E)
      )
    )
  )

  (define-syntax m2
    (syntax-rules ()
      ((m2 E)
        (format "Called m2 ~s" E)
      )
    )
  )

Then I use them in module 'test2, which requires 'test:
  (module-name 'test2)
  (module-static #t)

  (require <kb7.mm3.general.test>)

  (define (test-m1 x)
    (m1 x)
  )

  (define (test-m2 x)
    (m2 x)
  )

Then load the compiled version of 'test2 and call a procedure that
is indirectly defined in terms of m2:

  #|kawa:1|# (require <kb7.mm3.general.test2>)
  #<procedure kb7.mm3.general.test2>
  #|kawa:2|# (test-m1 'a)
  gnu.mapping.UnboundSymbol: Unbound symbol m1

So how (if at all) can I get compilation to recognise that m2 as well as
m1 is to be expanded? The reply to a posting Marco Vezzoli made on 23 Aug
2000 suggests I need to export the macros: is that so?

Jocelyn Paine
http://www.ifs.org.uk/~popx/
+44 (0)7768 534 091 




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]