Arguments to PL_predicate

This example is from Initiating a query from C

char *
ancestor(const char *me)
{ term_t a0 = PL_new_term_refs(2);
  static predicate_t p;

  if ( !p )
    p = PL_predicate("is_a", 2, "database");

  PL_put_atom_chars(a0, me);
  PL_open_query(NULL, PL_Q_NORMAL, p, a0);
  ...
}

Who is module “database” ??

Just an example module name. Can be anything, as long as the predicate is visible in that database.

2 Likes

I think FFI will be the next “real world” tutorial

2 Likes