The 'list' is a singly linked list which may contain other lists or just string values.
So creating is just allocating to sentinel nodes..(It could be made into nullptrs if required though..)
Good idea... I'll do so.
As construction is all or nothing, we can see that 'L2' (and thus 'L1') will not be modified if the string can't be parsed correctly.
If the members of the `list' objects are swapped, instead of using a potentially expensive copy operation, the construction is "free" in that we will continue using those elements as referenced from 'L2' (and thus 'L1').
The function is clear and concise. (Though the name is verbose here for other purposes.)
The checking can't be less complicated than creating...I think.
As.. "(1 2 3 4)" and "(()(a b c)((1 2 3 4)(x y z)))" are both valid for constructing the list.