consult

BAP Online Manuals : Library Reference : Library by Name : consult
Previous: conlist
Next: cpu_usage

6.2.28. consult

adds clauses from a file to the database

SYNOPSIS

INCLUDE 'iolib.h'
consult("data.dbs")

SYNTAX

consult(FileName)(i)

ARGUMENTS

string(FileName) (i) Name of the file to be consulted

DESCRIPTION

Reads and parses the file given by FileName. The file may contain clauses and facts, separated by the dots. The current operator declarations are used.
NOTE: In this version of BAP neither comments nor keywords are allowed.
NOTE: To load compiled code to the system, use the load () or

load_all () predicates!

EXAMPLE

consult("data.dbs"),
database(data(X)),
write(X),nl.

/* Contents of "data.dbs": '/

data("Hello World.").
data("How are you?").

list([1,2,3,4]).

ERRORS

Weak error handling. Sorry. Will be updated soon.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

clause , database , retract , retractall , load


BAP Online Manuals : Library Reference : Library by Name : consult
Previous: conlist
Next: cpu_usage