Some implementations do not need to remember the number of elements stored. But the user might want to know that. Options:
- Write source with length computation then manipulate code at runtime to remove useless operations and properties?
- Write two very similar implementations.
- Use inheritance.
- ...