ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:82948] [Ruby trunk Feature#13933] Add Range#empty?
       [not found] <redmine.issue-13933.20170924111714@ruby-lang.org>
@ 2017-09-24 11:17 ` drenmi
  2017-09-24 13:32 ` [ruby-core:82954] " shevegen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: drenmi @ 2017-09-24 11:17 UTC (permalink / raw
  To: ruby-core

Issue #13933 has been reported by ted (Ted Johansson).

----------------------------------------
Feature #13933: Add Range#empty?
https://bugs.ruby-lang.org/issues/13933

* Author: ted (Ted Johansson)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Range already responds to #size. It would be nice if it also responded to predicate #empty? :-)



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:82954] [Ruby trunk Feature#13933] Add Range#empty?
       [not found] <redmine.issue-13933.20170924111714@ruby-lang.org>
  2017-09-24 11:17 ` [ruby-core:82948] [Ruby trunk Feature#13933] Add Range#empty? drenmi
@ 2017-09-24 13:32 ` shevegen
  2017-09-24 14:33 ` [ruby-core:82957] " ruby-core
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: shevegen @ 2017-09-24 13:32 UTC (permalink / raw
  To: ruby-core

Issue #13933 has been updated by shevegen (Robert A. Heiler).


Would be nice.

----------------------------------------
Feature #13933: Add Range#empty?
https://bugs.ruby-lang.org/issues/13933#change-66857

* Author: ted (Ted Johansson)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Range already responds to #size. It would be nice if it also responded to predicate #empty? :-)



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:82957] [Ruby trunk Feature#13933] Add Range#empty?
       [not found] <redmine.issue-13933.20170924111714@ruby-lang.org>
  2017-09-24 11:17 ` [ruby-core:82948] [Ruby trunk Feature#13933] Add Range#empty? drenmi
  2017-09-24 13:32 ` [ruby-core:82954] " shevegen
@ 2017-09-24 14:33 ` ruby-core
  2017-09-24 17:14 ` [ruby-core:82959] " shannonskipper
  2017-10-25  9:19 ` [ruby-core:83560] " shevegen
  4 siblings, 0 replies; 5+ messages in thread
From: ruby-core @ 2017-09-24 14:33 UTC (permalink / raw
  To: ruby-core

Issue #13933 has been updated by marcandre (Marc-Andre Lafortune).


Note that `Range#size` currently returns `nil` for ranges of string, so it's not clear what `empty?` would return for ranges of strings.

----------------------------------------
Feature #13933: Add Range#empty?
https://bugs.ruby-lang.org/issues/13933#change-66859

* Author: ted (Ted Johansson)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Range already responds to #size. It would be nice if it also responded to predicate #empty? :-)



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:82959] [Ruby trunk Feature#13933] Add Range#empty?
       [not found] <redmine.issue-13933.20170924111714@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2017-09-24 14:33 ` [ruby-core:82957] " ruby-core
@ 2017-09-24 17:14 ` shannonskipper
  2017-10-25  9:19 ` [ruby-core:83560] " shevegen
  4 siblings, 0 replies; 5+ messages in thread
From: shannonskipper @ 2017-09-24 17:14 UTC (permalink / raw
  To: ruby-core

Issue #13933 has been updated by shan (Shannon Skipper).


Range mixes in Enumerable so you can use #none?.

~~~
('a'..'b').none? #=> false
('b'..'a').none? #=> true
~~~


----------------------------------------
Feature #13933: Add Range#empty?
https://bugs.ruby-lang.org/issues/13933#change-66860

* Author: ted (Ted Johansson)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Range already responds to #size. It would be nice if it also responded to predicate #empty? :-)



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:83560] [Ruby trunk Feature#13933] Add Range#empty?
       [not found] <redmine.issue-13933.20170924111714@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2017-09-24 17:14 ` [ruby-core:82959] " shannonskipper
@ 2017-10-25  9:19 ` shevegen
  4 siblings, 0 replies; 5+ messages in thread
From: shevegen @ 2017-10-25  9:19 UTC (permalink / raw
  To: ruby-core

Issue #13933 has been updated by shevegen (Robert A. Heiler).


I think the semantics between ".none?" is not the same as ".empty?". At
the least the latter appears to be more explicit to me.

But it's also not that important to me personally, I am fine either way. :-)

----------------------------------------
Feature #13933: Add Range#empty?
https://bugs.ruby-lang.org/issues/13933#change-67589

* Author: ted (Ted Johansson)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Range already responds to #size. It would be nice if it also responded to predicate #empty? :-)



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-25  9:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-13933.20170924111714@ruby-lang.org>
2017-09-24 11:17 ` [ruby-core:82948] [Ruby trunk Feature#13933] Add Range#empty? drenmi
2017-09-24 13:32 ` [ruby-core:82954] " shevegen
2017-09-24 14:33 ` [ruby-core:82957] " ruby-core
2017-09-24 17:14 ` [ruby-core:82959] " shannonskipper
2017-10-25  9:19 ` [ruby-core:83560] " shevegen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).