bug-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: listing/1 behavior


From: Nuno Morgadinho
Subject: Re: listing/1 behavior
Date: Wed, 23 Nov 2005 16:57:51 +0000
User-agent: Mutt/1.5.9i

Ok, found it. Just for the archives, from [1] 

"The problem here is that listing/1 does not write to stdout (which is what
tell/1 redirects) but rather to top_level_output. I don't know if there's
any way to redirect top_level_output. (I would think listing/1 *should*
use stdout.)

You can write listing/1 to an arbitrary stream using a *mirror*:


?- open('foo', write, S), add_stream_mirror(top_level_output, S),
listing(kb), close(S).

This will write the listing for kb to file 'foo'.


Lindsey Spratt"

Having the problem solved, I still wonder why listing/1 doesn't write to
stdout but rather to top_level_output. I agree with Lindsey when she says
it should use stdout.

Cheers,

[1] - http://lists.gnu.org/archive/html/bug-prolog/2005-11/msg00003.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]