Re: Calling `listing` from the top-level

Boris Vassilev <[email protected]> Fri, 18 Apr 2014 17:02:36 +0300
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAFw8os+6uTdMdmbOor+w5ausBULi8eGbjq5RhkPe7XNHta2H2A@mail.gmail.com>
Thank you for the info. I should have read the documentation first :$ I
don't remember when I last used `listing/0`, and now I was a bit surprised
at getting more than what I expected.

Cheers,
Boris


On Fri, Apr 18, 2014 at 2:35 PM, Jan Wielemaker <[email protected]> wrote:

> 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
>
-------------- next part --------------
HTML attachment scrubbed and removed