- Added tuple_to_termlist function.
This commit is contained in:
parent
1c075db161
commit
83bf0ec704
@ -858,3 +858,26 @@ termlist_to_tuple (Termlist tl)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! Split a tuple term into termlist components.
|
||||
Termlist
|
||||
tuple_to_termlist (Term t)
|
||||
{
|
||||
t = deVar (t);
|
||||
if (t == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (realTermTuple (t))
|
||||
{
|
||||
return termlistConcat (tuple_to_termlist (TermOp1 (t)),
|
||||
tuple_to_termlist (TermOp2 (t)));
|
||||
}
|
||||
else
|
||||
{
|
||||
return termlistAdd (NULL, t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,5 +56,6 @@ Termlist termlistForward (Termlist tl);
|
||||
int termlistOrder (Termlist tl1, Termlist tl2);
|
||||
int termlist_iterate (Termlist tl, int (*func) ());
|
||||
Term termlist_to_tuple (Termlist tl);
|
||||
Termlist tuple_to_termlist (Term t);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user