The fact that
- Succeeds with no further constraining of
Termis sufficiently instantiated to decide that it is a
Typeand is indeed a
- Otherwise throws.
practically commands that it be used only for computational state checks (in this case, whether the caller passed the correct goods) immediately at predicate entry; or maybe a bit further to the right to verify that things are still “on track”.
This also means that one should be able to disable
must_be/2 in programs that are “sufficiently tested” without any change in semantics (unless the developer did something that he should not) – improving performance. Similar to disabling assertions in Java.
How can that be done simplest? Maybe with a specific
expand_term/2 statement? It would not work for precompiled libraries though (are there any, even? Like .class files in Java?)
One could always filter the source code directly with a script of course. Perl scripts I can do.