Subject: [SWIPL] C++ and Prolog

From: [email-masked]
Date: Wed, 10 Oct 2001 13:11:09 -0400

Hello,

In reviewing the SWI-cpp.h header file I found
that in the PlTermv class, the PlTermv(PlTerm m0, PlTerm m1, ...)
constructors are coded as, for instance:

   __inline PlTermv::PlTermv(PlTerm m0, PlTerm m1, PlTerm m2) {
      size = 3;
      a0 = PL_new_term_refs(3);
      PL_put_term(a0+0, m0);
      PL_put_term(a0+1, m1);
      PL_put_term(a0+2, m2);
   }

Should not this be?

  __inline PlTermv::PlTermv(PlTerm m0, PlTerm m1, PlTerm m2) {
      size = 3;
      a0 = PL_new_term_refs(3);
      PL_put_term(a0+0, m0.ref);
      PL_put_term(a0+1, m1.ref);
      PL_put_term(a0+2, m2.ref);
   }

Thanks for your help.

Frank Cordoba
Research Engineer
CHI Systems Inc.
U.S.A.