12.3 Differences between static and dynamic code
-
Only dynamic procedures can have clauses added or removed at run time.
- Matching clauses (section 5.5) are not supported by dynamic
code. A runtime error (about calling an undefined procedure -?->/1)
will
be raised when executing dynamic code that has a matching clause head.
- Clauses for a dynamic procedure need not be consecutive.
- Source tracing is not supported for dynamic procedures.
- assert/1, retract/1 and clause/1 do not
perform clause
transformation on the clause. If clause transformation is required,
this can be done explicitly with
expand_clause/2
before.
- Internally, dynamic procedures are represented differently from static
procedures. The execution of dynamic procedures will generally be slower
than for static procedures.