The Ciao library browser
Author(s): Angel Fernandez Pineda.The librowser library provides a set of predicates wich enable the user to interactively find Ciao 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 useful when 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.
Usage and interface
- Library usage:
It is not necesary to use this library at user programs. It is designed to be used at the Ciao toplevel shell: 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.
- Exports:
- Predicates:
update/0, browse/2, where/1, describe/1, system_lib/1, apropos/1.
- Predicates:
- Imports:
- System library modules:
regexp/regexp_code, read, fastrw, system, streams, lists. - Packages:
prelude, nonpure, assertions, regexp.
- System library modules:
Documentation on exports
update/0 will also be automatically called (once) when calling any other predicate at librowser.
Usage:
Creates an internal database of modules at Ciao system libraries.
?- browse(M,findall/A). A = 3, M = conc_aggregates ? ; A = 4, M = aggregates ? ; A = 3, M = aggregates ? ; no ?-
Usage:browse(Module,Spec)
Asocciates the given Spec predicate specification with the Module which exports it.
- The following properties should hold at call time:
(librowser:module_name/1)Module is a module name (an atom)
(librowser:pred_spec/1)Spec is a Functor/Arity predicate specification
?- 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)
Display what module to load in order to import the given Spec.
- The following properties should hold at call time:
(librowser:pred_spec/1)Spec is a Functor/Arity predicate specification
?- describe(librowser). Predicates at library librowser : apropos/1 system_lib/1 describe/1 where/1 browse/2 update/0 yes ?-
Usage:describe(Module)
Display a list of exported predicates at the given Module
- The following properties should hold at call time:
(librowser:module_name/1)Module is a module name (an atom)
Usage:system_lib(Module)
Module variable will be successively instantiated to the system libaries stored in the internal database.
- The following properties should hold at call time:
(librowser:module_name/1)Module is a module name (an atom)
?- 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)
This will search any predicate specification Spec which matches the given RegSpec incomplete predicate specification.
- The following properties should hold at call time:
(librowser:apropos_spec/1)RegSpec is a Pattern/Arity specification.
Documentation on internals
apropos_spec(_1). apropos_spec(_1/Arity) :- int(Arity).
Usage:apropos_spec(S)
S is a Pattern/Arity specification.