reads a term from a stream and retrieves information about variables....
Move to
Next Prev
Up Top
See also
current_op/3
op/3
print/1/2
println/1/2
read/1/2
read_term/2/3
write/1/2
write_canonical/1/2
write_term/2/3
writeq/1/2
IF Computer > MINERVA > Manual > Reference > Predicates > Term input/output > read_term/2/3

read_term/2/3

reads a term from a stream and retrieves information about variables.

read_term (-Term, +Options)
read_term (+Stream, -Term, +Options)

read_term/2 reads from the current inputstream a single term(Term).
read_term/3 reads from the given stream(Stream) a single term(Term).
If the end of the stream is reached, Term will be unified with the atom end_of_file.

Elements of the Options-list can be:

variables(-Vars)
variable_names(-VarList)
singletons(-VarList)

Arguments

Stream                 text input stream
Term                   term
Options                list of options

Examples

?- open('test.data', write, Stream),
   write(Stream, 'member(X, [X|L]).\n'),
   close(Stream).

?- open('test.data', read, Stream), read_term(Stream, Term, [variable_names(VarNames),singletons(Singletons)]).

Term = member(_1, [_1|_2]) VarName = ['X' = _1, 'L' = _2] Singletons = ['L' = _2]

Standard

These predicates are part of the ISO-Prolog Standard.

See also

current_op/3, op/3, print/1/2, println/1/2, read/1/2, write/1/2, write_canonical/1/2, write_term/2/3, writeq/2.

read on...
MINERVA
ifcomputer logo
f
Expert Services on the Web
Language
English
Japanese
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/term_io/read_term/home_en.html
published 2012/2/6 update 1998/8/7 (c) 1996-2009 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS