On Thu, Jul 29, 2010 at 3:39 AM, Felix
<address@hidden> wrote:
From: Imran Rafique <
address@hidden>
Subject: [Chicken-users] newbie questions about macros in modules
Date: Thu, 22 Jul 2010 16:46:39 -0700
> 2) module io defines a macro (debug-info) and a function (print-info).
> debug-info calls print-info. If module io is imported without a prefix, then
> it works. If module io is imported WITH a prefix, then the macro
> (debug-info) is trying to call a function (print-info) which isn't available
> (only <prefix>print-info is). Is there any way to account for this when
> creating the macro?
>
> Example code below
>
> ;;; ---- repl ----
>> (define _debug #t)
>> (load-relative "/home/imran/src/scheme/lib/io.scm")
>> (import (prefix io io/))
>> (io/print-info "blah")
> [lib/io 15:42:43] blah
>> (io/debug-info "blah")
> Error: unbound variable: print-info
>
>> (import io)
>> (debug-info "blah")
> [lib/io 15:47:00] (debugging) blah
>
Attached is a patch that should help. The problem was an inconsistency
how the static environment of syntax definitions was created on
import. You can also use the "experimental" branch in the git repository.
cheers,
felix