I have a list of complex terms with the same functor and arity, but different arguments. Something like that:
Elements = [element(a, 1), element(b,2), element(c,3)]
And from it I want to create a new list containing only two arguments of each complex term in the list, for example:
Numbers = [1,2,3]
Is there a way to develop a predicate to solve this problem for any input list length?
source
share