Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested List Lengths

Status
Not open for further replies.

someguy045

Programmer
Feb 13, 2007
1
CA
hey I have nested list of form [[a,a],[f,g,h,j],[g,h,h]] and I need to take the length of the inner list and somehow generate a list of all the lengths of the inner lists. im trying to use append but I cant get it to keep track of the final list correctly through the recursion because I end up passing the old list as the result and then its a question and not an append
 
completely theoretical:

your list is like [A,B,C,...,X]
where letters are inner lists.

make a predicate that uses
length(A,Length)
where A is the list you are referring to
and Length is a var that gives you its length.

any help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top