jOOL icon indicating copy to clipboard operation
jOOL copied to clipboard

Don't swap Range bounds by default

Open lukaseder opened this issue 6 years ago • 3 comments

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.

lukaseder avatar Jun 24 '19 08:06 lukaseder

I'd like to fix this issue by creating a constructer for tuple2 so that users can choose whether to swap bounds by themselves.

awnofwheat avatar Apr 25 '21 06:04 awnofwheat

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.

lukaseder avatar Apr 25 '21 08:04 lukaseder

Thank you for your reply. I will be careful next time

awnofwheat avatar Apr 26 '21 04:04 awnofwheat