Author(s): Angel Fernandez Pineda.
Version: 1.10#7 (2006/4/26, 19:22:13 CEST)
Version of last change: 1.7#21 (2000/9/26, 13:37:17 CEST)
librowser
library provides a set of predicates wich enables the user to interactively find Ciao/Prolog libraries and/or any predicate exported by them.
This is a simple example:
?- apropos('*find*'). persdbrt_sql: dbfindall/4 persdbrtsql: dbfindall/4 conc_aggregates: findall/3 linda: rd_findall/3 vndict: find_name/4 internals: $find_file/8 aggregates: findall/4,findall/3 yes ?-
Librowser is specially usefull when using inside GNU Emacs, just place the cursor over a librowser response and press C-cTAB in order to get help on the related predicate. Refer to the "Using Ciao inside GNU Emacs" chapter for further information.
librowser
)ciaosh
. In order to do so, just make use of
use_module/1
as follows:
use_module(library(librowser))
.
Then, the library interface must be read. This is automatically done when calling any predicate at librowser, and the entire process will take a little moment.So, you should want to perform such a process after loading the Ciao toplevel:
Ciao 0.9 #75: Fri Apr 30 19:04:24 MEST 1999 ?- use_module(library(librowser)). yes ?- update.Whether you want this process to be automatically performed when loading
ciaosh
, you may include those lines in your .ciaorc personal initialization file.
librowser
)This predicate will scan the Ciao system libraries for predicate definitions. This may be done once time before calling any other predicate at this library.
update/0 will also be automatically called (once) when calling any other predicate at librowser.
Usage:
This predicate is fully reversible, and is provided to inspect concrete predicate specifications. For example:
?- browse(M,findall/A). A = 3, M = conc_aggregates ? ; A = 4, M = aggregates ? ; A = 3, M = aggregates ? ; no ?-
Usage: browse(Module, Spec)
Spec
predicate specification with the Module
which exports it.
Module
is a module name (an atom)
(librowser:module_name/1
)
Spec
is a Functor/Arity predicate specification
(librowser:pred_spec/1
)
This predicate will print at the screen the module needed in order to import a given predicate specification. For example:
?- where(findall/A). findall/3 exported at module conc_aggregates findall/4 exported at module aggregates findall/3 exported at module aggregates yes ?-
Usage: where(Spec)
Spec
.
Spec
is a Functor/Arity predicate specification
(librowser:pred_spec/1
)
This one is used to find out which predicates were exported by a given module. Very usefull when you know the library, but not the concrete predicate. For example:
?- describe(librowser). Predicates at library librowser : apropos/1 system_lib/1 describe/1 where/1 browse/2 update/0 yes ?-
Usage: describe(Module)
Module
Module
is a module name (an atom)
(librowser:module_name/1
)
It retrieves on backtracking all Ciao system libraries stored in the internal database. Certainly, those which were scanned at
update/0
calling.
Usage: system_lib(Module)
Module
variable will be successively instantiated to the system libaries stored in the internal database.
Module
is a module name (an atom)
(librowser:module_name/1
)
This tool makes use of
regular expresions in order to find predicate specifications. It is very usefull whether you can't remember the full name of a predicate. Regular expresions take the same format as described in library
patterns
. Example:
?- apropos('atom_*'). terms: atom_concat/2 concurrency: atom_lock_state/2 atomic_basic: atom_concat/3,atom_length/2,atom_codes/2 iso_byte_char: atom_chars/2 yes ?-
Usage: apropos(RegSpec)
Spec
which matches the given RegSpec
incomplete predicate specification.
RegSpec
is a Pattern/Arity specification.
(librowser:apropos_spec/1
)
librowser
)Defined as:
apropos_spec(_1). apropos_spec(Pattern/Arity) :- pattern(Pattern), int(Arity).
Usage: apropos_spec(S)
S
is a Pattern/Arity specification.
Go to the first, previous, next, last section, table of contents.