streams

Cliff Bender <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <[email protected]>
Hi, 

I'd like some help trying to understand the use of streams. As I understand, 
this should produce a file 'out.txt', with the listing in it. However, the 
listing gets printed to the screen, and the file is empty:

| ?- open('out.txt', write, H, [alias(out)]), current_output(COUT), 
set_output(out), listing, set_output(COUT).

squint([], []).
squint([A|B], [C|D]) :-
 integer(A),
 C is A * A,
 squint(B, D).
squint([A|B], [A|C]) :-
 squint(B, C).

COUT = '$stream'(1)
H = '$stream'(2)

(1 ms) yes
| ?-
 
If anyone has any ideas, suggestions, anything, please reply.
Thanks and have a great weekend.
Cliff

_______________________________________________
Users-prolog mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/users-prolog
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.