Project

General

Profile

Actions

Feature #19698

open

Need an idiomatic way to define an empty range

Added by shouichi (Shouichi Kamiya) 11 months ago. Updated 10 months 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