[ruby-core:119682] [Ruby master Misc#20781] DevMeeting-2024-11-07
From:
"furunkel (Julian Aron Prenner) via ruby-core" <ruby-core@...>
Date:
2024-11-01 18:16:43 UTC
List:
ruby-core #119682
Issue #20781 has been updated by furunkel (Julian Aron Prenner).
* [Feature #20818] Allow passing a block to Hash#store to update current value (furunkel)
* currently, to update a value in a hash we have to call `#[]` followed by `#[]=`
* this calls `#hash` twice (on key), and requires two lookups; this also happens for shortcuts such as `h[k] += c`
* the problem could be solved by introducing a block form for `Hash#store` (`Hash#update` is already taken)
* the block is called with the current value or the default value if the key does not exist; return value = new value
* inverse of `Hash#fetch`, which also can take block
* `h[k] = some_method(h[k])` could be written as `h.store(k) { some_method(_1) }`, more efficient and more elegant in some cases (e.g., if `k` is complex, no repetition)
* exists in other languages: e.g., `Map#computeIfAbsent|Present` (Java) or `and_modify` (Rust)
* existing implementation: GH PR#11956
----------------------------------------
Misc #20781: DevMeeting-2024-11-07
https://bugs.ruby-lang.org/issues/20781#change-110342
* Author: mame (Yusuke Endoh)
* Status: Open
----------------------------------------
# The next dev meeting
**Date: 2024/11/07 13:00-17:00** (JST)
Log: *TBD*
- Dev meeting *IS NOT* a decision-making place. All decisions should be done at the bug tracker.
- Dev meeting is a place we can ask Matz, nobu, nurse and other developers directly.
- Matz is a very busy person. Take this opportunity to ask him. If you can not attend, other attendees can ask instead of you (if attendees can understand your issue).
- We will write a record of the discussion in the file or to each ticket in English.
- All activities are best-effort (keep in mind that most of us are volunteer developers).
- The date, time and place of the meeting are scheduled according to when/where we can reserve Matz's time.
- *DO NOT* discuss then on this ticket, please.
# Call for agenda items
If you have a ticket that you want matz and committers to discuss, please post it into this ticket in the following format:
```
* [Ticket ref] Ticket title (your name)
* Comment (A summary of the ticket, why you put this ticket here, what point should be discussed, etc.)
```
Example:
```
* [Feature #14609] `Kernel#p` without args shows the receiver (ko1)
* I feel this feature is very useful and some people say :+1: so let discuss this feature.
```
- It is recommended to add a comment by 2024/11/04. We hold a preparatory meeting to create an agenda a few days before the dev-meeting.
- The format is strict. We'll use [this script to automatically create an markdown-style agenda](https://gist.github.com/mame/b0390509ce1491b43610b9ebb665eb86). We may ignore a comment that does not follow the format.
- Your comment is mandatory. We cannot read all discussion of the ticket in a limited time. We appreciate it if you could write a short summary and update from a previous discussion.
--
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/lists/ruby-core.ml.ruby-lang.org/