[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Re: module for srfi-35
From: |
felix winkelmann |
Subject: |
[Chicken-users] Re: module for srfi-35 |
Date: |
Tue, 14 Oct 2008 10:56:11 +0200 |
On Mon, Oct 13, 2008 at 1:46 PM, Jörg F. Wittenberger
<address@hidden> wrote:
>
> I would rather have used (import (prefix srfi-35 srfi35:)) . But either
> I did not understand what I should put where I left the ellipsis here or
> this might not work correctly at top level? Whatever I tried, the top
> level bindings ended up as undefined values (or was it unbound?).
To make the variables available at toplevel (for compiled code),
use (import srfi-35). To make them available in evaluated code,
eval '(import srfi-35) first. This should normally work.
>
> (define foo '(import (prefix srfi-35 srfi:35)))
>
> (define bar '(import (rename srfi-18 (raise issue))))
>
> (define (export-them! lst envt)
> (fold-import-statements
> (lambda (param init) (apply environment-extend! init param) init)
> envt
> lst))
>
> (define env (make-environment))
>
> (export-them! foo env)
> (export-them! bar env)
>
> Now in "env" "issue" is bound to "raise", SRFI-35 is bound with prefix.
Modules and first-class environments can currently not be combined,
sorry.
>
> Desperately: get an example how to save some typing with rename.
>
> Alternatively: get an idea how to save even more typing using low level
> access.
For value bindings, you can use the "<modulename>#<identifier>" hack,
for syntax, I can not provide an easy way. You mix module code, non-module
code and evaluated code in convoluted ways. There is no lowlevel module-API
yet, and I can't come up with one easily. This all is still under
heavy development.
cheers,
felix
- [Chicken-users] Re: let-location & modules, (continued)
- [Chicken-users] Re: let-location & modules, F. Wittenberger, 2008/10/08
- [Chicken-users] Re: let-location & modules, felix winkelmann, 2008/10/09
- [Chicken-users] Re: let-location & modules, F. Wittenberger, 2008/10/09
- [Chicken-users] Re: let-location & modules - modules for srfi-34&35 - 2 questions, F. Wittenberger, 2008/10/10
- [Chicken-users] how to pass a certain environment to "eval", F. Wittenberger, 2008/10/10
- [Chicken-users] Re: how to pass a certain environment to "eval", felix winkelmann, 2008/10/12
- [Chicken-users] Re: how to pass a certain environment to "eval", felix winkelmann, 2008/10/13
- [Chicken-users] module for srfi-35, F. Wittenberger, 2008/10/10
- [Chicken-users] Re: module for srfi-35, felix winkelmann, 2008/10/12
- [Chicken-users] Re: module for srfi-35, F. Wittenberger, 2008/10/13
- [Chicken-users] Re: module for srfi-35,
felix winkelmann <=
- [Chicken-users] Re: module for srfi-35, F. Wittenberger, 2008/10/14
- [Chicken-users] Re: module for srfi-35, felix winkelmann, 2008/10/14
- Re: [Chicken-users] Re: module for srfi-35, F. Wittenberger, 2008/10/14
- [Chicken-users] Re: let-location & modules - modules for srfi-34&35 - 2 questions, felix winkelmann, 2008/10/12