
compile(++File)

   Compile specified file, or list of files, with default options

Arguments
   File                Atom, structure or string, or a list of them.

Type
   Predicate Database and Compiler

Description

    Compiles the specified ECLiPSE source file or list of source files.
    The default options are used, and the resulting code is directly
    loaded into memory and ready for execution.  See compile/2 for details.


Modes and Determinism
   compile(++) is det

Modules
   This predicate is sensitive to its module context (tool predicate, see @/2).

Exceptions
     4 --- File is not instantiated.
     5 --- File is instantiated, but not to an atom or string, or a list of atoms or strings.
    61 --- A predicate that was already defined is later declared to be a tool.
    62 --- Illegal attempt to change a predicate's properties like: tool, dynamic, demon, parallel, calling convention.
    82 --- The module in which the clauses should be compiled is locked.
    94 --- There is already am imported predicate of the same name.
   130 --- The head of a clause is not an atom or a compound term.
   131 --- A subgoal in the body of a clause is not an atom, a compound term or a variable.
   134 --- The clauses of a procedure are not consecutive.
   137 --- A procedure which was previously referenced as built-in or external is now defined as a regular one, or vice versa.
   139 --- This event is invoked at the end of each compiled file, by default it prints the compilation time and size of compiled code.
   143 --- A query in the compiled file has failed. This is by default ignored and the compilation continues.
   145 --- A procedure is being redefined in another file than the original one.
   147 --- This event is raised just before a compilation is aborted because of an error.
   148 --- An unrecognised pragma was used in the code.
   171 --- File does not exist.

Examples
   
Success:
   [hanoi].         % compiles the file hanoi.pl

   [eclipse]: sh('cat file1').
   p:-q(hello).
   yes.
   [eclipse]: sh('cat file2').
   q(X) :- writeln(X).
   yes.
   [eclipse]: compile(user), p.
    p :- writeln(hi).
    user compiled 92 bytes in 0.00 seconds
   hi
   yes.
   [eclipse]: compile([file1, file2]), p.
   /home/lp/user/file1 compiled 32 bytes in 0.02 seconds
   /home/lp/user/file2 compiled 92 bytes in 0.00 seconds
   hello
   yes.


   % example showing use of relative pathnames.
   [eclipse]: sh('ls -FR /home/lp/user/pl').
   a.pl        util/

   /home/lp/user/pl/util:
   b.pl        c.pl

   yes.
   [eclipse]: sh('cat /home/lp/user/pl/a.pl').
   :- compile('util/b').
   p.

   yes.
   [eclipse]: compile('/home/lp/user/pl/a').
   /home/lp/user/pl/util/b.pl compiled 92 bytes in 0.00 seconds
   /home/lp/user/pl/a.pl compiled 28 bytes in 0.00 seconds
   yes.

Error:
   compile(F).            (Error 4).
   compile(file1/1).      (Error 5).
   compile(file).         (Error 171).


See Also
   compile / 2, compile_stream / 1, compile_term / 1, compile_term / 2, ensure_loaded / 1, lib / 1, use_module / 1, pragma / 1, fcompile : fcompile / 1
