Don't swap Range bounds by default
Currently, when using the Range type, bounds are swapped by default, if they are not in order. This can be convenient occasionally, but incorrect in other cases. With the suggestion of supporting (partially) unbounded ranges (#350), swapping may become wrong.
We should introduce new API that allows for swapping explicitly (akin to SQL's BETWEEN SYMMETRIC) and stop swapping implicitly.
This is an incompatible change. We might not actually implement it.
I'd like to fix this issue by creating a constructer for tuple2 so that users can choose whether to swap bounds by themselves.
I'd like to fix this issue by creating a constructer for tuple2 so that users can choose whether to swap bounds by themselves.
Thanks for your suggestion. For the record, the PR is here: https://github.com/jOOQ/jOOL/pull/384. I've rejected it mostly because it is not Tuple2's concern that one of its subtypes has a flaw. Let's not fix things by breaking other things or introducing unnecessary functionality.
You probably took inspiration by this sentence:
We should introduce new API that allows for swapping explicitly (akin to SQL's
BETWEEN SYMMETRIC) and stop swapping implicitly.
This "new API" must be limited to Range, not affect Tuple2 in any way.
Thank you for your reply. I will be careful next time