At least 4 ways to avoid this confusion:
- Return a copy. L1 and L2 are unaffected by JOIN. Memory
hungry.
- JOIN(L1,L2) transfers elements from L2 to L1. L2 ends up empty.
- Change `type' of L2 from List to Sublist. Restrict some
operations to operate only on Lists.
- L1 and L2 become exactly the same list: all subsequent
operations on one of them have identical effects on both.
This is a crucial consideration in formulating our specification.
We choose the following variation: JOIN(L1,L2) transfers elements
from L2 to L1, but L2 ends up undefined rather than merely
empty.