From: "Dan0042 (Daniel DeLorme) via ruby-core" Date: 2023-09-22T12:50:25+00:00 Subject: [ruby-core:114879] [Ruby master Feature#13933] Add Range#empty? Issue #13933 has been updated by Dan0042 (Daniel DeLorme). duerst (Martin D�rst) wrote in #note-10: > Are you saying that true shouldn't be equal to true? That would be strange, at least to me. I understand that it appears logical, but <=> is a *comparison* operator, used to compare with *other* values during sort/min/max. It's pretty much useless if the only valid comparison is with itself. What's the use case for `[true,true].min == true` but `[true,anything_else].min #=> ArgumentError` ? I can't think of anything reasonable. At least if `true<=>true` was nil, that would tell us this value is not comparable with any other value. But I'm not suggesting we change this now, it seems too backward incompatible. ---------------------------------------- Feature #13933: Add Range#empty? https://bugs.ruby-lang.org/issues/13933#change-104732 * Author: ted (Ted Johansson) * Status: Open * Priority: Normal ---------------------------------------- Range already responds to #size. It would be nice if it also responded to predicate #empty? :-) -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/