chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] newbie questions about macros in modules


From: Imran Rafique
Subject: Re: [Chicken-users] newbie questions about macros in modules
Date: Thu, 29 Jul 2010 15:14:38 -0700

Felix,

Thanks. Now that I think about it - wow! From a newbie question, to a patch from the language implementor himself - all in the matter of a week. Dizzying ....

I applied the patch against vanilla 4.5.0, and it works perfectly. If anyone is using chicken-4.5.0 on gentoo, attached is a slightly modified ebuild which uses Felix's patch.

The attached tarball contains everything you need to put into your local overlay, to install a patched chicken-4.5.0. So for any gentoo users who want this, just:
- unpack into your local overlay
- run: ebuild chicken-4.5.0-r100.ebuild manifest
- the ebuild is labelled as an "unstable" package, meaning that you need to either have your global KEYWORDS (/etc/make.conf) set to "~<your_arch>", or add "dev-scheme/chicken" to /etc/package/keywords
- emerge it

Felix - do you want this sent downstream to the gentoo devs for incorporation into their portage tree? Not sure if you wanted patches like these rolled into standard distribution releases (in case you haven't tested side-effects of the patch, and don't want the maintainence hassle if it breaks other things for 4.5.0 users), so I haven't open a gentoo bug for this new patch yet.

Regards,
             Imran Rafique


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

Attachment: chicken_for_gentoo.tgz
Description: GNU Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]