[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:74023] [Ruby trunk Feature#12110] Create a method to avoid vacuous truth?
From:
andrew@...
Date:
2016-02-27 13:59:18 UTC
List:
ruby-core #74023
Issue #12110 has been updated by Andrew Vit.
Waldyr de Souza wrote:
> I often find myself running into unexpected results when using #all? for example
>
> `[].all? { |e| false } # => true`
If you expect all false, then why not use `none?`, is it not sufficient?
> Even though it's logically correct could we have a method that express the following?
>
> `foo.any? && foo.all?(&:bar)`
This also has edge cases, try: `foo = [nil]`
Matthew Kerwin wrote:
> I seem to recall someone suggesting 'any_and_all?' in the past.
This makes sense and it's consistent with `foo.any?(&block) && foo.all?(&block)`
This is still surprising to me, it looks like a contradiction:
```
[].any? #=> false
[].all? #=> true
```
I would expect "all" to be a superset of "any": both should mean "at least one".
Is there a reason for the existing behaviour, or is it just history now?
----------------------------------------
Feature #12110: Create a method to avoid vacuous truth?
https://bugs.ruby-lang.org/issues/12110#change-57174
* Author: Waldyr de Souza
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
I often find myself running into unexpected results when using #all? for example
[].all? { |e| false } # => true
Even though it's logically correct could we have a method that express the following?
foo.any? && foo.all?(&:bar)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>