Re: Calling `listing` from the top-level

Jan Wielemaker <[email protected]> Fri, 18 Apr 2014 13:35:54 +0200
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 04/18/2014 10:03 AM, Boris Vassilev wrote:
> Hi,
> 
> currently, `listing/0` at the top level has a whole bunch of output. Random
> excerpt:
> 
> ---
> prolog_file_type(qlf, qlf).
> prolog_file_type(A, executable) :-
>     system:current_prolog_flag(shared_object_extension, A).
> 
> :- dynamic library_directory/1.
> :- multifile library_directory/1.
> 
> library_directory(B) :-
>     '$parms':
>     (   cached_library_directory(local, A=lib, A),
>     B=A
>     ).
> ---
> 
> 
> Is that meant to be there? Did I mess up my installation somehow?

These are things that historically reside in the user module and listing
lists what is defined in the user module.  It is not that easy to find
out what the user added and even if we could, what should it list?  What
is there or what the user added?  Listing the real content makes a lot
of sense.  What if the user added clauses for library_directory/1 for
its own application need (i.e., unaware of the hook) and observes strange
behaviour?  Using listing/1 might give a clue as in `hey, there are also
other clauses??  may be this is something special'.

Most new hooks are defined in the module `prolog`, which avoids these
issues ...

	Cheers --- Jan