Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:prolog:pllib:consulting_file [2019/06/27 15:50] (aktualna)
Linia 1: Linia 1:
 +====== Consulting file ======
 +{{tag>​file read/write memory}}
 +===== Description =====
 +Consulting a file
  
 +
 +**Source**: ​ The Art of Prolog
 +===== Download =====
 +Program source code: {{consulting_file.pl}}
 +===== Listing =====
 +<code prolog>
 +/*
 +
 +    consult_(File) :- 
 +
 + The clauses of the program in the file File are read and asserted.
 +
 +*/
 +
 +
 +
 + consult_(File) :- open(File,​read,​DD),​ consult_loop(DD),​ close(DD).
 +
 +
 +
 + consult_loop(DD) :- repeat, read(Clause),​ process(Clause,​DD)),​ !.
 +
 +
 +
 + process(Clause,​DD) :- at_end_of_stream(DD).
 +
 + process(Clause,​DD) :- assertz(Clause),​ fail.
 +
 +
 +
 +%  Program 12.9:    Consulting a 
 +file
 +
 +</​code>​
 +===== Comments =====
 +RTERR: /​prolog-pllib-consulting_file.pl:​6:​8:​ Syntax error: Illegal start of term
pl/prolog/pllib/consulting_file.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0