Re: streams
Cliff Bender <[email protected]>
| Newsgroups | gmane.comp.gnu.prolog.general |
|---|---|
| Message-ID | <[email protected]> |
Vic, Alexandre, Dunno why, but these methods seem to work. I have no idea why the method I showed doesn't, but this helps. I'm going to, i think, need to have to tie prolog and c together, later in the semester. When that happens, I'll be asking for help again... I hope I can count on you! Thanks, and in advance as well, Cliff On 9/5/05, Vic Bancroft <[email protected]> wrote: > > Cliff Bender wrote: > > >I'd like some help trying to understand the use of streams. > > > Hurrms, not sure what is broken w/ your example, however, I tend to use > the format construct. > > $ gprolog > GNU Prolog 1.2.18 > By Daniel Diaz > Copyright (C) 1999-2004 Daniel Diaz > | ?- assertz(p(1)), assertz(p(2)). > > yes > | ?- open('out.log', write, H), (p(X), format(H, "p(~w) ~n", [X]), > fail; close(H)), !. > > H = '$stream'(2) > > (1 ms) yes > | ?- system('cat out.log'). > p(1) > p(2) > > (1 ms) yes > > This explicit indication of the target stream is useful in context where > there is more than one and it also gives you more control over what is > sent to the stream . . . > > more, > l8r, > v > > -- > "The future is here. It's just not evenly distributed yet." > -- William Gibson, quoted by Whitfield Diffie > > _______________________________________________ Users-prolog mailing list [email protected] http://lists.gnu.org/mailman/listinfo/users-prolog