This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: initial modules.texi
- To: ttn at netcom dot com
- Subject: Re: initial modules.texi
- From: Mark Galassi <rosalia at lanl dot gov>
- Date: 21 Jan 2000 19:52:01 -0700
- Cc: guile at sourceware dot cygnus dot com
- References: <200001202334.PAA08210@mingle.glug.org>
I would like to add that we should have something as simple and
straightforward (for use in most situations) as Python's module
approach.
In case you don't know Python, you can import a module with
import string
in which case all the functions in the "string" API are accessed with
string.atof(...)
and so forth.
Or you can import individual functions from module string, in which
case they enter the global namespace:
from string import atof, atoi
...
atof(...)
atoi(...)
You can also do (not recommended for most situations):
from string import *
in which case all functions in module string are available in the
global namespace.
There is also a Python primitive dir() which allows you to see what
symbols are exported by a module:
>>> import string
>>> dir(string)
['__builtins__', '__doc__', '__file__', '__name__', '_idmap', '_idmapL', '_lower', '_swapcase', '_upper', 'atof', 'atof_error', 'atoi', 'atoi_error', 'atol', 'atol_error', 'capitalize', 'capwords', 'center', 'count', 'digits', 'expandtabs', 'find', 'hexdigits', 'index', 'index_error', 'join', 'joinfields', 'letters', 'ljust', 'lower', 'lowercase', 'lstrip', 'maketrans', 'octdigits', 're', 'replace', 'rfind', 'rindex', 'rjust', 'rstrip', 'safe_env', 'split', 'splitfields', 'strip', 'swapcase', 'translate', 'upper', 'uppercase', 'whitespace', 'zfill']
>>>