6.2 Defining a Module
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Modules
        • Defining a Module
          • module/2
          • module/3
    • Packages
:- module(+Module, +PublicList)
This directive can only be used as the first term of a source file. It declares the file to be a module file, defining a module named Module. Note that a module name is an atom. The module exports the predicates of PublicList. PublicList is a list of predicate indicators (name/arity or name//arity pairs) or operator declarations using the format op(Precedence, Type, Name). Operators defined in the export list are available inside the module as well as to modules importing this module. See also section 4.25.

Compatible to Ciao Prolog, if Module is unbound, it is unified with the basename without extension of the file being loaded.