[#115884] Windows Ruby 3.2.2: Non-English character added to Windows Registry String Value — Jay Mav via ruby-core <ruby-core@...>
Hello,
3 messages
2023/12/24
[ruby-core:115661] [Ruby master Feature#20049] Destructive drop_while for Array and Hash
From:
"matheusrich (Matheus Richard) via ruby-core" <ruby-core@...>
Date:
2023-12-08 14:58:27 UTC
List:
ruby-core #115661
Issue #20049 has been updated by matheusrich (Matheus Richard).
What would be the return value? The same as `drop_while`?
----------------------------------------
Feature #20049: Destructive drop_while for Array and Hash
https://bugs.ruby-lang.org/issues/20049#change-105598
* Author: chucke (Tiago Cardoso)
* Status: Open
* Priority: Normal
----------------------------------------
I propose a "drop_while!" variant for arrays and hashes, which changes the current instance.
```ruby
h = {foo: 0, bar: 1, baz: 2}
h.drop_while!{|element| key, value = *element; value < 2 }
h #=> # => { baz: 2 }
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/