- Documentation
- Reference manual
- Foreign Language Interface
- The Foreign Include File
- Constructing Terms
- PL_put_variable()
- PL_put_atom()
- PL_put_bool()
- PL_put_chars()
- PL_put_atom_chars()
- PL_put_string_chars()
- PL_put_string_nchars()
- PL_put_list_chars()
- PL_put_integer()
- PL_put_int64()
- PL_put_pointer()
- PL_put_float()
- PL_put_functor()
- PL_put_list()
- PL_put_nil()
- PL_put_term()
- PL_cons_functor()
- PL_cons_functor_v()
- PL_cons_list()
- Constructing Terms
- The Foreign Include File
- Foreign Language Interface
- Packages
- Reference manual
Availability:C-language interface function
term_t objects as the arity of
the functor. To create the term animal(gnu, 50), use:
{ term_t a1 = PL_new_term_ref();
term_t a2 = PL_new_term_ref();
term_t t = PL_new_term_ref();
functor_t animal2;
/* animal2 is a constant that may be bound to a global
variable and re-used
*/
animal2 = PL_new_functor(PL_new_atom("animal"), 2);
PL_put_atom_chars(a1, "gnu");
PL_put_integer(a2, 50);
PL_cons_functor(t, animal2, a1, a2);
}
After this sequence, the term references a1 and a2 may be used for other purposes.