BAP Online Manuals : Library Reference : Library by Name : call
Previous: bound
Next: cd

6.2.14. call

calls its Argument

SYNOPSIS

EXPORT goal(void).
call(goal(arguments))

SYNTAX

call(Goal) (i)

ARGUMENTS

void(Goal) (i) the goal or compound goal to be called

DESCRIPTION

Standard PROLOG call predicate.
Call() is able to call all 'exported' predicates. Goal may consist of compound goals. The number of arguments of the called predicates is restricted to 10. This restriction only applies to the 'top level' of the predicate. Any Argument itself may be a struct and contain an unlimited amount components.
In most PROLOG implementations a call just fails if the predicate called does not exists. However, in BAP we issue a warning because in most cases you call a not available predicate it is due to a program error. You may check the existence of a predicate by the use of the exists () predicate, thus avoiding this warning.
If you call predicates that are defined in different modules, you may have to ensure that these modules are loaded already.

EXAMPLE

read(X),read(Y),
call(( X ; Y )).

read(X),
exists(X),
call(X).

ERRORS

Warning and failure if the Goal predicate is not currently available in the symbol table.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

exec , exists , xcall , load , load_all


BAP Online Manuals : Library Reference : Library by Name : call
Previous: bound
Next: cd