I have been considering the following situation as part of documenting and interface (
A) and an implementation (
B) of that interface.
A contains methods which involve the following two arguments:
- A percentage, passed as an integer.
- A name, passed as a string.
The valid values for the percentage are the closed range [0, 100]. No matter how you implement the interface, it is an error to allow a value outside this range as an input.
The name, as defined in the interface, allows any string containing [1, 100] characters. I want to document the interface in such a way that it neither requires nor disallows an implementation to support a name with more than 100 characters.
Clearly the valid range for percentage is a closed, inclusive interval. How would you refer to a range like I defined above for the number of characters in name? I can't refer to the interval as right-open, because the implementation might not support values with more than 100 characters.