load

BAP Online Manuals : Library Reference : Library by Name : load
Previous: listing
Next: load_all

6.2.78. load

loads an already compiled module to the node

SYNOPSIS

INCLUDE 'prolib.h'
load("demo")

SYNTAX

load(ModuleName)(i)

ARGUMENTS

string(ModuleName) (i) Name of Module to be loaded

DESCRIPTION

This adds the compiled module onto the current node. ModuleName is the name specified by the MODULE keyword in the associated source. If the module is already loaded the call will succeed immediately. Otherwise the system adds an '.lkd' ending to it and starts a search for a appropriate file. The Module should be contained either in the current directory, the library directory, or the binary directory. If it cannot be found, the load fails.
If you call a predicate via call (), xcall () or exec (), you must ensure that the code is already present. An easy way to do so would be issuing the call with a precede load predicate. Please see the example below.
To load code on each node of the system, you may use the load_all () predicate.
NOTE: You do not need this predicate if you use a compiled call to an external predicate. This will be done by the system.

EXAMPLE

xcall(( load(demo), start_demo )).	% load is needed

load(demo), call(start_demo).		% load is needed

IMPORT demo :- start_demo.
start_demo.					% load is NOT needed!

ERRORS

No runtime errors.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

load_all , reload , consult , compile , load_compiler


BAP Online Manuals : Library Reference : Library by Name : load
Previous: listing
Next: load_all