All Manuals > KnowledgeWorks and Prolog User Guide > A Common Prolog

NextPrevUpTopContentsIndex

A.8 Common Prolog Macros

Macros may be defined within the logic system using the form:

(defrelmacro <name> <arg-list> <body>)

which is effectively the same as a Common Lisp defmacro. Logic macros are expanded before variable translation so that logic variables may be treated as atoms. defrelmacro forms must have a fixed number of arguments. This allows different predicates with the same name but different arities to be defined. If you want to define a special form with an arbitrary number of arguments, use defrel-special-form-macro.

A.8.1 Example


KnowledgeWorks and Prolog User Guide (Unix version) - 24 Mar 2017

NextPrevUpTopContentsIndex