SRFI-9 define-record-type doesn't work in library

Create issue
Issue #66 resolved
Takashi Kato repo owner created an issue

This raises a macro expansion error.

(library (foo)
    (export make-foo foo?)
    (import (scheme base))
  (define-record-type <foo>
    (make-foo foo bar)
    foo?
    (foo foo-foo)
    (bar foo-bar)))
(import (foo))

Originally from this issue [https://github.com/okuoku/yuni/issues/9]

Comments (2)

  1. Takashi Kato reporter

    This is because of compiler. Compiler expands toplevel defined macro in library however it always uses a library of compile time environment even thought the target is identifier. When macro was expanded then it should use identifier library to lookup global variable.

  2. Takashi Kato reporter

    Toplevel macro expansion in library now considers the result of expanded form (Fixes #66) It always used compile time environment library however expanded form contains identifier and compiler should respect it to find global bindings.

    → <<cset cd0af2f3a8d8>>

  3. Log in to comment