chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] A few questions about modules


From: felix winkelmann
Subject: Re: [Chicken-users] A few questions about modules
Date: Sun, 4 Jan 2009 16:57:24 +0100

On Thu, Jan 1, 2009 at 1:06 AM, Jack Trades <address@hidden> wrote:
> 1.  import, if and define-syntax  --  Where do they come from?  Can they be
> redefined?

They are currently handled specially (i.e. hardcoded). The proper
way to do it would be to introduce internal special forms and define
the forms you mention as syntax. Another thing for my todo-list.

>
> 2.  Can I get a list of all the exported functions of a module?

(##sys#module-exports (##sys#find-module '<name>))

will return 3 values:

1) list of exported names
2) list of exported value bindings (a-list)
3) list of exported syntax bindings (a-list, circular)

Note that this is an internal API, so subject to change. There is no
official module API yet.

>
> 3.  Can I get a list of all defined (and imported) symbols in a module?  In
> the global environment?

There is no public API, but the module-structure returned by ##sys#find-module
is defined in line 1265 of expand.scm, the defined-lists may be of interest,
which you can access with ##sys#slot (or block-ref). The parameter
##sys#currrent-environment holds the currently imported bindings.

I hope this is somewhat useful.


cheers,
felix




reply via email to

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