Thanks for the feedback @matz! Is it the word `bounds` that you don't like in relation to the start and end values of a range? I personally think bounds or a boundary can be considered inclusive or exclusive which is why including `exclu...stuyam (Stuart Yamartino)
* [Feature #20080] Introduce #bounds method on Range (stuyam) * `#bounds` method on range to return raw bound data about the range `[ first, last, exclude_end? ]` * Easy array deconstruction for setting first and last as variables fr...stuyam (Stuart Yamartino)
* [Ticket #20080] Introduce #bounds method on Range (stuyam) * Easier serialization of ranges, easy array deconstruction for setting `begin` and `end` as variable.stuyam (Stuart Yamartino)
@Dan0042 great idea! At first I was against this because I thought it would make deconstruction harder but it actually wouldn't because deconstruction would work the same. I was thinking the second value if deconstructed would be an arra...stuyam (Stuart Yamartino)
@ufuk I like `#bounds` as a name also, great suggestion, let's try that. And thank you for showing beginless and endless examples, I agree with that usage. @Dan0042 Sorry for the bad example, I didn't show a good use case I just showed ...stuyam (Stuart Yamartino)
Yeah great point @Dan0042, `#minmax` _almost_ works, but as you point out it does not work because if the range is a reverse range you get `nil` for both values. Interesting! ```ruby (1..42).minmax #=> [1, 42] (42..1).minmax #=> [nil, ni...stuyam (Stuart Yamartino)
Thanks for the thoughtful responses @shan and @mame! Shan, you make great points. With the next `it` syntax coming in ruby 3.3 you could also do: ```ruby low, high = (42..420).then { [it.begin, it.end] } ``` Mame, thank you for discuss...stuyam (Stuart Yamartino)