moopT said:
Hi,
I think to have a function to inverse a list is quite natural to be
embedded into the standard JSE library, how do you think about that?
It depends on what you mean by inversing a list.
If you mean that a given list contains 0, 1, 2, 3, and 4 and you want the
inverse function to give you the other digits, i.e. 5 through 9 inclusive,
that might be reasonable, as long as you are willing to ignore that some
cultures have their own number systems that don't use the base 10 digits.
You'd have similar issues if you wanted to inverse letters. If a given list
contains 'A', 'B', and 'C' what inverse would you want to see? If you are an
English-speaker, you'd presumably want 'D' through 'Z' inclusive. But other
cultures that used other languages, alphabets, and scripts would want
something quite different.
At the very least, your inverse function would need to be very
culturally-sensitive if it was to work beyond the confines of English and
base 10 arithmetic.
Rhino