I did a length:data encoding in the fake Lisp-like library in cppawk. Haha.<p>For instance cons(1, 1) produces "C1,1:12". Type code C followed by two decimal integers separated by a comma, terminated by colon, followed by the car/cdr data. The decimal integers give the lengths of the car and cdr part after the colon.<p><a href="https://www.kylheku.com/cgit/cppawk/tree/cppawk-cons.1" rel="nofollow noreferrer">https://www.kylheku.com/cgit/cppawk/tree/cppawk-cons.1</a><p>The list (1 2 3) looks like "C1,12:1C1,6:2C1,0:3" .<p>A cursory scan through the string tells us that there are three C's, so three cells in there.<p>Note the C1,0:3 at the end: (3 . nil). nil is a zero length object: the empty string represents nil. So the cdr length of the last cell is zero.