YAP 7.1.0
module/2

module(+ M:atom,+ L:list ) More...

Detailed Description

module(+ M:atom,+ L:list )

module(+ Module:atom, +ExportList:list)

properties: directive

the current file defines module M with exports L The list may include

  • predicate indicators
  • operator definitions that look like calls to op/3

The list L may include predicates imported from other modules If you want to fully reexport a module, or a sub-set, also consider reexport/1

Similar to module/2 , this directive defines the file where it appears in as a module file; it must be the first declaration in the file M must be an atom specifying the module name; L must be a list containing the module's public predicates specification, in the form [predicate_name/arity,...]

The last argument Options must be a list of options, which can be: +filename the filename for a module to import into the current module

  • library( +File ) a library file to import into the current module
  • hide( +Opt) if Opt is false, keep source code for current module, if true, disable
  • export(+PredicateIndicator ) Add predicates to the public list of the context module This implies the predicate will be imported into another module if this module is imported with use_module/1 and use_module/2
  • export_list(? Mod,? ListOfPredicateIndicator) The list ListOfPredicateIndicator contains all predicates exported by module Mod

Note that predicates are normally exported using the directive module/2 The export/1 argument is meant to allow export from dynamically created modules The directive argument may also be a list of predicates

properties: directive

define a new module

This directive defines the file where it appears as a module file; it must be the first declaration in the file Module must be an atom specifying the module name; ExportList must be a list containing the module's public predicates specification, in the form [predicate_name/arity,...] The ExportList can include operator declarations for operators that are exported by the module

The public predicates of a module file can be made accessible to other files through loading the source file, using the directives use_module/1 or use_module/2 , ensure_loaded/1 and the predicates consult/1 or reconsult/1 The non-public predicates of a module file are not supposed to be visible to other modules; they can, however, be accessed by prefixing the module name with the <tt>:/2 operator


The documentation for this class was generated from the following file: