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 aritys to be defined. If you want to define a special form with an arbitrary number of arguments, use
defrel-special-form-macro
.
KnowledgeWorks and Prolog User Guide (Unix version) - 6 Dec 2011