Re: write_canonical and streams
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 02/12/2014 09:42 AM, Wouter Beek wrote:
> portray(Term):-
> (is_stream(Term) ; blob(Term, stream)), !,
The disjunction doesn't help much; they are the
same test. You probably want this:
blob(Term, Type),
Type \== text.
That is because atom(X) ==> blob(X, text). All
the others are somehow special.
> write(monkey).
>
> test:-
> open('README.md', read, Stream),
> write_term(Stream, [blob(portray)]),
It is blobs(portray).
--- Jan
> nl,
> halt.