home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Caml Light 0.61 / Source / src / lib / toplevel.mli < prev    next >
Encoding:
Text File  |  1993-09-24  |  3.3 KB  |  64 lines  |  [TEXT/MPS ]

  1. (* System functions for interactive use *)
  2.  
  3. value quit : unit -> unit
  4.         (* Exit the toplevel loop. *)
  5.   and include : string -> unit
  6.         (* Read, compile and execute source phrases from the given file.
  7.            Definitions are entered in module [top], as if they were
  8.            read from the keyboard.
  9.            The [.ml] extension is automatically added to the file name,
  10.            if not present. *)
  11.   and load : string -> unit
  12.         (* Load in core the source for a module.
  13.            Read, compile and execute source phrases from the given file.
  14.            Definitions are entered in a new module with the given name.
  15.            The [.ml] extension is automatically added to the file name,
  16.            if not present. *)
  17.   and compile : string -> unit
  18.         (* Compile a module implementation ([.ml] file) or module
  19.            interface ([.mli] file), as with the batch compiler [camlc].
  20.            The filename must end with either the [.ml] or the [.mli]
  21.            extension.
  22.            The outcome of the compilation is left in [.zo] and [.zi]
  23.            files, and not loaded in core in any way. *)
  24.   and verbose_mode: bool -> unit
  25.         (* [verbose_mode true] causes the [compile] function to print
  26.            the inferred types and other information. [verbose_mode false]
  27.            reverts to the default silent behavior. *)
  28.   and load_object : string -> unit
  29.         (* Load in core a compiled bytecode file.
  30.            The [.zo] extension is automatically added, if not present. *)
  31.   and trace : string -> unit
  32.         (* After [trace "foo"], all calls to the global function named [foo]
  33.            will be traced.
  34.            That is, the argument and the result are displayed for each call,
  35.            as well as exceptions escaping out of [foo]. *)
  36.   and untrace : string -> unit
  37.         (* [untrace "foo"] stops tracing function [foo]. *)
  38.   and new_printer : string -> ('a -> unit) -> unit
  39.         (* [new_printer "mytype" f] registers function [f] as a printer
  40.            for objects of type [mytype]. That is, the toplevel loop will
  41.            call [f] when it has an object of type [mytype] to print.
  42.            This is not type-safe: the system does not check that [f]
  43.            actually accepts arguments of type [mytype]. *)
  44.   and default_printer : string -> unit
  45.         (* [default_printer "mytype"] reverts to the default printing
  46.            behavior for objects of type [mytype]. *)
  47.   and debug_mode: bool -> unit
  48.         (* Set whether extended module interfaces must be used
  49.            [debug_mode true] or not [debug_mode false]. Extended
  50.            module interfaces are [.zix] files that describe the actual
  51.            implementation of a module, including private types and
  52.            variables. They are generated when compiling with [camlc -g],
  53.            or with the [compile] function above when [debug_mode] is
  54.            [true]. When [debug_mode] is [true], toplevel phrases can refer
  55.            to private types and variables of modules, and private functions
  56.            can be traced with [trace]. Setting [debug_mode true] is equivalent
  57.            to starting the toplevel with the [-g] option. *)
  58.   and gc : unit -> int
  59.         (* Finish the current GC cycle and return the number of free bytes
  60.        in the heap. *)
  61.   and cd : string -> unit
  62.         (* Change the current working directory. *)
  63. ;;    
  64.