depth
ABSTRACT
Returns the depth of the given element. We define the depth recursively. If an element is not a vector, its depth is said to be zero. Otherwise if the element is a vector, its depth is said to be 1 more than the maximum depth of all its elements. The empty vector is said to have depth 1.
PARAMETERS
v | the element we want to take the depth of. Note that it need not be a vector, in which case the returned value is 0 |
RETURN
the depth of the given element as specified above
DECLARATION
func depth(v)