A solution didn't seem simple at the beginning. But
then we recalled the ISO core standard which doesn't
allow clause/2 for static predicates. So whats
going on in release 1.5.0 of Jekejeke Prolog? Well
the following decisions were made:
- dynamic, thread_local and group_local predicates
are not body indexed. Thats new, that we automatically
switch off body indexing for these types of predicates.
- static predicates have body indexing as before. And
static predicates cannot be accessed as before, we
still refuse access of static predicates via clause/2.
- in case really static predicates need to be accessed,
there are the new sys_rule/3 and sys_rule_ref/4. These
bypass body indexing, even for static predicates.
So meta programming has now two options. Declare the
predicate dynamic and use clause/2, get the head indexing
only. Or do something with sys_rule/3 respectively sys_rule_ref/4
in case indexing isn't important.