Dear list,
I am playing around with the c++ library. Swipl allows for compound terms with zero arguments, see,
e.g. compound_name_arity with arity 0, so I was wondering if I can create compounds without arguments from C++. But the code below produces an atom:
#include "SWI-cpp.h"
#include <iostream>
int main(int argc, char** argv)
{
PlEngine e(argc, argv) ;
PlTerm pred = PlCompound("noargs", PlTermv(0)) ;
PlQuery q("atom", pred) ;
if(q.next_solution())
std::cout << "atom" << std::endl ;
return 0 ;
}
Is this a bug or a feature? The thing is: I can easily create an atom with PlTerm(“noargs”), so it would actually make sense to create a compound with the above code.
Best wishes,
Matthias