2

How do I call built-in Chicken Scheme macros - specifically let-values in this instance - from my own macros?

(define-syntax ...
 (ir-macro-transformer
  (lambda (expr inject compare)
   (let-values (...) ...
    ...

unbound variable: let-values

Sylwester
  • 47,942
  • 4
  • 47
  • 79
Sod Almighty
  • 1,768
  • 1
  • 16
  • 29

1 Answers1

2

This is a bit of a bug I'm afraid. A simple (import-for-syntax chicken) did the trick for me.

In CHICKEN 5, this works without such a strange import.

sjamaan
  • 2,282
  • 10
  • 19
  • Is there a way to see what symbols are imported in syntax phase in Chicken 4.9? – Sylwester Aug 11 '16 at 11:40
  • 1
    @Sylwester: There's a hack: `(map car (##sys#macro-environment))` shows you internal info about what's available for expanding to (I think...?). With `(map car (##sys#meta-macro-environment))` you can see the procedures available to procedural macros. – sjamaan Aug 11 '16 at 19:04
  • @sjamaan So the first one lists available macros, and the second lists available functions? But the output of both calls seem to be names of macros....? – Sod Almighty Aug 11 '16 at 22:28
  • @sjamaan ...and what is Chicken 5? I see no mention on the website of any version - even beta - after 4.11. – Sod Almighty Aug 12 '16 at 04:04
  • @SodAlmighty: It's currently in development. See [our roadmap](http://wiki.call-cc.org/chicken-5-roadmap) and the [issue tracker](http://bugs.call-cc.org/query?group=status&milestone=5.0) for progress. – sjamaan Aug 12 '16 at 07:46