Project

General

Profile

Actions

Feature #19698

open

Need an idiomatic way to define an empty range

Added by shouichi (Shouichi Kamiya) over 1 year ago. Updated over 1 year ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:113693]

Description

It seems there is no idiomatic way to define an empty range. We can define empty ranges in several ways such as

irb(main):001:0> (0...0).none?
=> true
irb(main):002:0> (1...-1).none?
=> true

I think the above examples do not communicate the intention well.

Actions

Also available in: Atom PDF

Like1
Like1Like1