[#100689] [Ruby master Feature#17303] Make webrick to bundled gems or remove from stdlib — hsbt@...
Issue #17303 has been reported by hsbt (Hiroshi SHIBATA).
11 messages
2020/11/02
[#100852] [Ruby master Feature#17326] Add Kernel#must! to the standard library — zimmerman.jake@...
Issue #17326 has been reported by jez (Jake Zimmerman).
24 messages
2020/11/14
[#100930] [Ruby master Feature#17333] Enumerable#many? — masafumi.o1988@...
Issue #17333 has been reported by okuramasafumi (Masafumi OKURA).
10 messages
2020/11/18
[#101071] [Ruby master Feature#17342] Hash#fetch_set — hunter_spawn@...
Issue #17342 has been reported by MaxLap (Maxime Lapointe).
26 messages
2020/11/25
[ruby-core:100991] [Ruby master Feature#16241] Shorter syntax for anonymous refinements
From:
eregontp@...
Date:
2020-11-20 19:22:31 UTC
List:
ruby-core #100991
Issue #16241 has been updated by Eregon (Benoit Daloze).
This sounds fine to me.
I think `using do; refine Array do; ...; end; end` would be a good way too (https://bugs.ruby-lang.org/issues/17336#note-6), but matz thinks it's confusing whether the block is for defining refinements or for using refinements, and whether refinements apply after (https://bugs.ruby-lang.org/issues/14344#note-15).
----------------------------------------
Feature #16241: Shorter syntax for anonymous refinements
https://bugs.ruby-lang.org/issues/16241#change-88657
* Author: palkan (Vladimir Dementyev)
* Status: Open
* Priority: Normal
----------------------------------------
The original discussion is here https://bugs.ruby-lang.org/issues/14344.
tl;dr
- Refinements are often used in-place with anonymous modules
- Having shorter syntax could lower the barrier of entry for Rubyist wanting to explore this feature
- Previous syntax suggestions were not accepted.
I suggest adding a shorter syntax (technically, API):
```ruby
# before
using(Module.new do
refine Array do
def foo;"bar";end
end
end)
# after
refining Array do
def foo; "bar"; end
end
```
The original idea was to use `using_refined` instead of `refining` but after discussing with Matz we decided that it's too verbose, and `refining` seems better. But is it good enough? Any thoughts?
--
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>