[Tutor] How to test a list for nesting

kevin parks cpsoct@lycos.com
Sun, 21 Jan 2001 18:00:36 +0900


Is there a way to test if a list in nested and if so how deep? so that you could type
 
y=[1,2,3]
x=[1,[2,3]]
 
howDeep(y)
howDeep(x)
 
and it would return 0 (no nesting) for y and 1, for x (1 level of nesting)
 
Is this possible? It would seem really useful, but i don't see anything in the docs about how to do this.
 
 
cheers,
kevin parks
seoul korea



Get your small business started at Lycos Small Business at http://www.lycos.com/business/mail.html