Next: , Previous: Documentation, Up: Reflection


36.2 Known Names

An experimental database of known names provided by the core Guile system (available with guile -c) can be queried by evaluating:

     (use-modules (ice-9 known-names))

The database is read-only, and contains items specific to the installed Guile. Each item belongs in one or more groups and has exactly one class. These are the groups:

C+scheme~%in both groups `scheme' and `C' -- should be empty!~%
embedded-libltdl~%begins with lt_ -- should become empty over time~%
libguile-internal~%begins with scm_i_~%
gdb~%begins with gdb_~%
coop~%begins with coop_~%
gh~%begins with gh_~%
g-fdes~%begins with g and ends with fds~%
r-fdes~%begins with r and ends with fds~%
scm~%begins with scm_~%
k~%constants~%
POSIX~%POSIX support~%
math~%math functions~%
docinfo~%documented in the info manual~%
guile-C-API~%the official guile API available to C programs~%
questionable~%exposed to C but not in the official API and not scm_~%

An item's class is a symbol describing the nature of the item and how to interpret the extra information (if any) associated with that item. In the following table, we call this extra. It is a string, possibly empty.

none
There is no additional information available for this item.
letter
letter is in the range A through Z, inclusive. This means that the item is a C symbol and probably belongs to the C group. The letter is from the second column of the nm(1) output from which this item was scanned.
single-symbol
This class is presently unused, so it's probably a bug if any item claims to belong to it. Please report the freak occurance!
primitive
The item is a primitive Scheme procedure (see API Overview).
primitive-alias
The item is an alias for a primitive Scheme procedure. extra names the primitive Scheme procedure. For example, format is an alias for simple-format.
procedure
The item is a Scheme procedure. extra is a representation of the arguments taken by the procedure. For example, extra for item atan is (z . y), while for item error it is args.
procedure-alias
The item is an alias for a Scheme procedure. extra is the name of the Scheme procedure followed by space followed by a representation of the arguments taken by the procedure.

[Probably with a SMOP, this module's interface can be formalized into some kind of discovery protocol, which would allow us to make guile-tools generate-METAINFO emit all the necessary code for arbitrary module collections. –ttn]

— Scheme Procedure: known? name

If name (a string) is known, return #t, otherwise #f.

— Scheme Procedure: known-info name

If name (a string) is known, return a list of the form (GROUPS CLASS EXTRA), otherwise return #f.