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
_______________________________________________
Bug-prolog mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-prolog