[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: read/2 problem in gprolog-1.2.16 with SuSE 8.1
From: |
Vic Bancroft |
Subject: |
RE: read/2 problem in gprolog-1.2.16 with SuSE 8.1 |
Date: |
Mon, 14 Oct 2002 09:55:00 -0400 (EDT) |
I would just add one more predicate to the example to return the atom . . .
On Mon, 14 Oct 2002, Detlef Sax wrote:
> On 14-Oct-2002 address@hidden wrote:
> >
> > My intension is simply to read a plain ASCII text, so that
> > read(F,R) will bee unified with R = 'test123'.
>
> % open.pl
> % GPL, what else? 2002 sax
atom_io( Atom) :- io( List ), atom_codes( Atom, List ).
> io(List) :-
> open('zeichen.txt', read, Stream),
> add_stream_alias(Stream, ali),
> chars_from_stream(List).
>
> chars_from_stream(_) :-
> at_end_of_stream(ali),
> close(ali).
> chars_from_stream([Char| Chars]) :-
> get_my_byte(Char),
> chars_from_stream(Chars).
>
> get_my_byte(C) :-
> get_char(ali, C).
> % get_code(ali, C).
> % EOF
more,
l8r,
-------------------------------------------------------------------
Victor Bancroft, Principal Engineer, Zvolve Systems [v]770.551.4505
1050 Crown Pointe Pkwy, Suite 300, Atlanta GA 30338 [f]770.551.4509
Fellow, Artificial Intelligence Center [v]706.542-0358
Athens, Georgia 30602, U.S.A http://ai.uga.edu/~bancroft