This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Counting elements of a list

2 posts · 3092 views

Hi,

I am very new in lisp and I am trying to find the "vector" of a list of lists of different depths.
For example:
((1 (1 2 3)) (2 (1 2)) (4 (1 1 1 1))) and get a result (1 3 1 2 1 4).
I tried with length and various combinations of loop but it is not possible because the 1 or 2 or 4 are not lists.
If someone can help or give some direction i will be grateful.

Thank you in advance,

Ag