From: shyouhei@... Date: 2016-03-15T06:57:27+00:00 Subject: [ruby-core:74333] [Ruby trunk Feature#12133][Feedback] Ability to exclude start when defining a range Issue #12133 has been updated by Shyouhei Urabe. Status changed from Open to Feedback Do you have any practical situation where this is useful? The proposed grammar is ultra-hard to implement at sight (if not impossible). You are advised to show us why this feature is worth tackling. ---------------------------------------- Feature #12133: Ability to exclude start when defining a range https://bugs.ruby-lang.org/issues/12133#change-57457 * Author: Ryan Hosford * Status: Feedback * Priority: Normal * Assignee: ---------------------------------------- An intuitive, approach would be to allow defining ranges like so: ~~~ [1..10] [1..10) (1..10] (1..10) ~~~ ... where a square bracket indicates boundary inclusion and a parenthesis represents boundary exclusion. The syntax there is obviously not going to work, but it demonstrates the idea. A more feasible, still intuitive, solution might look like the following ~~~ (1..10) # [1..10] (1...10) # [1..10) ... Alternatively: (1..10).exclude_end (1..10).exclude_start # (1..10] (1...10).exclude_start # (1..10) ... Alternatively: (1..10).exclude_start.exclude_end ~~~ For consistency, I think we'd also want to add `#exclude_start?` & `#exclude_end` methods. -- https://bugs.ruby-lang.org/ Unsubscribe: