ストリームから項を読む。...
移動
次へ 前へ
上へ 最上
参考
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
イフコンピュータ > MINERVA > マニュアル > レファレンス > 述語 > 項の入出力 > read/1/2

read/1/2

ストリームから項を読む。

read (-項)
read (+ストリーム, -項)

read/1 は、現在入力ストリームから単項()を読む。
read/2は、与えられたストリーム(ストリーム)から単項()を読む。
もし、ストリームが最後までくると、は、アトム end_of_fileで単一化される。

引数

ストリーム           テキスト入力ストリーム
項                   項

?- open('test.data', write, Stream),
   print(Stream, [hello(world), '.']),
   close(Stream).

?- open('test.data', read, Stream), read(Stream, Term1), read(Stream, Term2).

Term1 = hello(world) Term2 = end_of_file

標準

これらの述語は、ISO-Prolog 標準に含まれる。

関連

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

続く..
MINERVA
ifcomputer logo
f
Expert Services on the Web
言語
English
Japanese
サーバー
USA
Japan
サイトマップ
索引
目次
全体目次
全体索引
印刷向き
imode
PDA
探索
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/term_io/read/home_jp.html
published 2012/2/6 update 1998/8/7 (c) 1996-2009 IF Computer Japan
IF Computer 〒113-0022 Tel 03-5814-3352 start (AT) ifcomputer.com
Customer Support 東京都文京区千駄木5-28-2   http://www.ifcomputer.co.jp
冒頭へ managed with ubiCMS