In addition to what Alexander wrote above: how often DCGs are great for describing lists in this case, especially if you also want to smooth tuples in a tuple:
tuple_list((A,B))
tuple_list(A)
, , ( , ):
?- phrase(tuple_list((1,(2,3),4)), Ls).
Ls = [1, 2, 3, 4].
, , , DCG. , "defaulty", " " ( ), , . . , (a, b, c) , triple (a, b, c), , .., .
source
share