Search code examples
macrosschemechicken-scheme

How to call the "when" macro in a Chicken Scheme macro?


Chicken Scheme defines a (when) macro, equivalent to (if (begin)). However, when I try to call this from one of my own macros, it complains that the "variable" is not defined:

(define-syntax blah
 (ir-macro-transformer
  (lambda (expr inject compare)
   (when something
    (do-something)))))

Error: during expansion of (blah ...) - unbound variable: when

What can I import to make this work?


Solution

  • Same answer as your other question; just (import-for-syntax chicken) and you're all set.